Elasticsearch Errors while doing any operation with system? - python

I have installed Elasticsearch and now due to some changes done by other folks at my work place some errors keep on popping up during any operation like update, install a new package and also the elasticsearch is not working properly.
Error Log is attached for installing new package.
$ sudo apt-get install bash-completion
Reading package lists... Done
Building dependency tree
Reading state information... Done
bash-completion is already the newest version (1:2.1-4.2ubuntu1.1).
0 upgraded, 0 newly installed, 0 to remove and 15 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] Y
Setting up elasticsearch (5.5.0) ...
Failed to restart systemd-sysctl.service: No such method 'RestartUnit'
See system logs and 'systemctl status systemd-sysctl.service' for details.
dpkg: error processing package elasticsearch (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
elasticsearch
E: Sub-process /usr/bin/dpkg returned an error code (1)
I even tried different solutions from online like trying to remove elasticsearch completely from system.
Steps I followed.
sudo rm -rf /var/lib/elasticsearch
sudo rm -rf /etc/elasticsearch
sudo apt-get install -f
$ sudo apt-get install -f
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 15 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up elasticsearch (5.5.0) ...
Failed to restart systemd-sysctl.service: No such method 'RestartUnit'
See system logs and 'systemctl status systemd-sysctl.service' for details.
dpkg: error processing package elasticsearch (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
elasticsearch
E: Sub-process /usr/bin/dpkg returned an error code (1)
sudo apt-get --purge autoremove elasticsearch
$ sudo apt-get --purge autoremove elasticsearch
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
elasticsearch*
0 upgraded, 0 newly installed, 1 to remove and 15 not upgraded.
1 not fully installed or removed.
After this operation, 37.3 MB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database ... 329402 files and directories currently installed.)
Removing elasticsearch (5.5.0) ...
Stopping elasticsearch service...Failed to stop elasticsearch.service: Unknown unit: elasticsearch.service
See system logs and 'systemctl status elasticsearch.service' for details.
Failed to get load state of elasticsearch.service: No such property 'LoadState'
dpkg: error processing package elasticsearch (--purge):
subprocess installed pre-removal script returned error exit status 1
Failed to restart systemd-sysctl.service: No such method 'RestartUnit'
See system logs and 'systemctl status systemd-sysctl.service' for details.
dpkg: error while cleaning up:
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
elasticsearch
E: Sub-process /usr/bin/dpkg returned an error code (1)
I restarted the system but the error keep on appearing again and again.
Any one with suggestions on how to solve this issue?
Also this command gives nothing
$ systemctl status systemd-sysctl.service
Failed to get properties: No such interface ''

is systemd your init service in this installation? Also what linux distribution is this? Which version of your distribution? I am currently thinking that you might not be using systemd, but the elasticsearch package is assuming this somehow.
I'd highly appreciate if you open up a bug report in the elasticsearch repository with all of the above information, this warrants more research on the ES side (disclaimer: I'm an ES developer and keen to get this fixed :-).
Also: You can try to remove the elasticsearch package completely by running dpkg -P elasticsearch.
And in addition you can try to add set -x to /var/lib/dpkg/info/elasticsearch.postinst and run sh /var/lib/dpkg/info/elasticsearch.postinst configure
to get more debugging output

I had quite the same problem.
It is obiviously related to systemctl, not elasticsearch.
First you have to determine if u are using it.
[[ `systemctl` =~ -\.mount ]] && echo yes || echo no
In my case, the answer was "no"
So you have to enable it.

Related

Tried reinstalling python on ubtuntu: dpkg: error processing package software-properties-common (--configure)

I wanted to update python 3.8 to 3.10 but ran into some issues which is why I wanted to reinstall python, however, when removing it, I ran into even more issues and now I am unsure of what to do.
I am not experienced with ubuntu, but now my package manager system seems to be broken. When I try running commands such as, apt-get install -f, I get the following error.
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
3 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up python3-click (7.0-3) ...
/var/lib/dpkg/info/python3-click.postinst: 6: py3compile: not found
dpkg: error processing package python3-click (--configure):
installed python3-click package post-installation script subprocess returned error exit status 127
Setting up python3-software-properties (0.99.9.8) ...
/var/lib/dpkg/info/python3-software-properties.postinst: 6: py3compile: not found
dpkg: error processing package python3-software-properties (--configure):
installed python3-software-properties package post-installation script subprocess returned error exit status 127
dpkg: dependency problems prevent configuration of software-properties-common:
software-properties-common depends on python3-software-properties (= 0.99.9.8); however:
Package python3-software-properties is not configured yet.
dpkg: error processing package software-properties-common (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
python3-click
python3-software-properties
software-properties-common
E: Sub-process /usr/bin/dpkg returned an error code (1)
How do I solve this problem? I just want python back and solve these problems.
Thanks in advance

apt - dpkg python-rpi.gpio dependency problems

Every time i try to install something, upgrade or autoremove this error happens!
I've searched the web and tried some fixes but they don't seem to work, I don't have python2.7 installed only 3 and can't install python2 or anything because of this. I've tryed to sudo rm python-rpi.gpio_0.7.0-0.1~bpo10+4_armhf.deb but the file will keep comming. Pls I really need some help since I've got some work on my pi and don't want to get a new image
sudo apt autoremove
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
python-rpi.gpio
The following packages will be upgraded:
python-rpi.gpio
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
18 not fully installed or removed.
Need to get 0 B/20.7 kB of archives.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Reading changelogs... Done
(Reading database ... 152893 files and directories currently installed.)
Preparing to unpack .../python-rpi.gpio_0.7.0-0.1~bpo10+4_armhf.deb ...
/var/lib/dpkg/info/python-rpi.gpio.prerm: 6: /var/lib/dpkg/info/python-rpi.gpio.prerm: pyclean: Too many levels of symbolic links
dpkg: warning: old python-rpi.gpio package pre-removal script subprocess returned error exit status 2
dpkg: trying script from the new package instead ...
/var/lib/dpkg/tmp.ci/prerm: 6: /var/lib/dpkg/tmp.ci/prerm: pyclean: Too many levels of symbolic links
dpkg: error processing archive /var/cache/apt/archives/python-rpi.gpio_0.7.0-0.1~bpo10+4_armhf.deb (--unpack):
new python-rpi.gpio package pre-removal script subprocess returned error exit status 2
/var/lib/dpkg/info/python-rpi.gpio.postinst: 6: /var/lib/dpkg/info/python-rpi.gpio.postinst: pycompile: Too many levels of symbolic links
dpkg: error while cleaning up:
installed python-rpi.gpio package post-installation script subprocess returned error exit status 2
Errors were encountered while processing:
/var/cache/apt/archives/python-rpi.gpio_0.7.0-0.1~bpo10+4_armhf.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
Some notes: I really really don't want to change the SD Card and parcially lose what I have, second I've tried sudo apt-get install -f and sudo apt update --fix-missing when i followed this guide the sudo dpkg --remove --force-remove --reinstreq command was showing this error dpkg: error: unknown force/refuse option 'remove'
As it turns out I still had remainnings of Python2 and Python3 binaries and those were not linked properly by the OS, this means that Python3 was linked to Python2 and vice-versa.
To get it working I had to:
Uninstall the Python2 dependencies
Get the link working correctly
Reinstall Python2 with wget
Verify if all links are working correctly (for Raspbian this means):
python --version links to Python2
python2 --version links to Python2
python3 --version links to Python3
Use the following commands:
sudo dpkg -i --force-overwrite /var/cache/apt/archives//python-rpi.gpio_0.7.0-0.1~bpo10+4_armhf.deb
Still have the same problem, use:
sudo mv /var/lib/dpkg/info/python-rpi.gpio.* /tmp/
sudo dpkg --remove --force-remove-reinstreq python-rpi.gpio
A typo in your command sudo dpkg --remove --force-remove --reinstreq isn't valide. The correct option is --force-remove-reinstreq. See dpkg --force-help.

Not able to install any package on Ubuntu 14.04 LTS, seeing dpkg: error processing package

I'm trying to install Python3 package which was required to upgrade it to 16.04 LTS and then 18.04 OS. I've come across several links to solve it, but found no luck. Implemented following steps to remove and reinstall -
sudo mv /var/lib/dpkg/info/<packagename>.* /tmp/
sudo dpkg --remove --force-remove-reinstreq <packagename>
sudo apt-get remove <packagename>
sudo apt-get autoremove && sudo apt-get autoclean
However, seeing the same issues
Reading package lists... Done
Building dependency tree
Reading state information... Done
python3-gi is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
12 not fully installed or removed.
Need to get 0 B/8666 B of archives.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] Y
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LC_CTYPE = "UTF-8",
LANG = "en_US.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
dpkg: error processing package python3 (--configure):
package is in a very bad inconsistent state; you should
reinstall it before attempting configuration
dpkg: dependency problems prevent configuration of python3-distupgrade:
python3-distupgrade depends on python3:any (>= 3.3.2-2~); however:
Package python3 is not configured yet.
dpkg: error processing package python3-distupgrade (--configure):
dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
.....
.....
.....
.....
.....
.....
.....
dpkg: error processing package cloud-init (--configure):
dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
dpkg: dependency problems prevent configuration of dh-python:
dh-python depends on python3:any (>= 3.3.2-2~); however:
Package python3 is not configured yet.
dpkg: error processing package dh-python (--configure):
dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
E: Sub-process /usr/bin/dpkg returned an error code (1)
Can anyone guide me through ??

Remove mercurial-common from Ubuntu 15.04

I'm having Python 2.x problems on Ubuntu 15.04. I wanted to completely uninstall and reinstall Python. I can't uninstall Python because mercurial-common depends on it. I try to remove that and I get an error:
➜ ~ sudo apt-get remove --purge mercurial-common
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
gnome-control-center-data gnome-icon-theme gnome-icon-theme-symbolic gnome-settings-daemon libcolord-gtk1 libexpat1-dev libgoa-backend-1.0-1 libjs-excanvas libpython3-dev
libpython3.4-dev python3-colorama python3-dev python3-distlib python3-wheel python3.4-dev
Use 'apt-get autoremove' to remove them.
The following packages will be REMOVED:
mercurial-common*
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 8,610 kB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database ... 206144 files and directories currently installed.)
Removing mercurial-common (3.1.2-2+deb8u1build0.15.04.2) ...
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
ImportError: No module named site
dpkg: error processing package mercurial-common (--purge):
subprocess installed pre-removal script returned error exit status 1
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
ImportError: No module named site
dpkg: error while cleaning up:
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
mercurial-common
E: Sub-process /usr/bin/dpkg returned an error code (1)
The mercurial-common removal scripts use python
/var/lib/dpkg/info/mercurial-common.prerm
If you type which pyclean I assume it exists.
However I suspect you python problems prevent it working. (you could try running it manually to verify this)
Unfortunately pyclean is in package python-minimal so you prolly can't uninstall this before mercurial-common.
you could try just removing it manually by:
sudo mv /usr/bin/pyclean /usr/bin/pyclean.backup
(Just remember to put it back).
Alternatively rather than completely removing python you could try just reinstalling python package .deb over the top of the existing install using dpkg --install

Errors with every package/program installation Ubuntu 12.04

This problem occur after I try to use the script to install Maya 2014 and because I failed with some libraries, I used synaptic package manager to completely remove Maya and I used
sudo rm -r /usr/autodesk
After that I used Terminal to install Skype and get this error message
Setting up composite-2014 (2014.0-862716) ...
python: can't open file '/usr/autodesk/Composite_2014/etc/configure.py': [Errno 2] No such file or directory
dpkg: error processing composite-2014 (--configure):
subprocess installed post-installation script returned error exit status 2
Errors were encountered while processing:
composite-201400
E: Sub-process /usr/bin/dpkg returned an error code (1)
I will now install Wine and put the whole process and it will be more clear where the error occur.
Here's the installation process
Errors were encountered while processing:
composite-2014
E: Sub-process /usr/bin/dpkg returned an error code (1)
try this commands:
apt-get install -f
dpkg-reconfigure -a
maybe helps
If the last answer don't work as well (like it happens to me .. and its rear)
Just "Fake" /usr/autodesk/Composite_2014/etc/configure.py
Open the Terminal (ctl+alt+t)
sudo nautilus
Browse to /usr/autodesk and create Composite_2014/etc/configure.py (one by one)
good luck

Categories