[SOLVED] "Package is in a very bad inconsistent state"
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I logged into my server today and received multiple error messages right away. I couldn't figure out what they were until I happened to check my fail2ban for unrelated reasons. Here are the types of messages I see:
Code:
root@myserver /etc/fail2ban # sudo apt-get install --reinstall fail2ban
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
Need to get 104 kB of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 http://mirrordirector.raspbian.org/raspbian/ wheezy/main fail2ban all 0.8.6-3wheezy3 [104 kB]
Fetched 104 kB in 0s (218 kB/s)
Selecting previously unselected package fail2ban.
(Reading database ... 119957 files and directories currently installed.)
Preparing to replace fail2ban 0.8.6-3wheezy3 (using .../fail2ban_0.8.6-3wheezy3_all.deb) ...
[....] Stopping authentication failure monitor: fail2banTraceback (most recent call last):
File "/usr/lib/python2.7/site.py", line 68, in <module>
import os
File "/usr/lib/python2.7/os.py", line 49, in <module>
import posixpath as path
File "/usr/lib/python2.7/posixpath.py", line 17, in <module>
import warnings
File "/usr/lib/python2.7/warnings.py", line 8, in <module>
import types
File "/usr/lib/python2.7/types.py", line 36, in <module>
BufferType = buffer
NameError: name 'buffer' is not defined
. ok
Traceback (most recent call last):
File "/usr/lib/python2.7/site.py", line 68, in <module>
import os
File "/usr/lib/python2.7/os.py", line 49, in <module>
import posixpath as path
File "/usr/lib/python2.7/posixpath.py", line 17, in <module>
import warnings
File "/usr/lib/python2.7/warnings.py", line 8, in <module>
import types
File "/usr/lib/python2.7/types.py", line 36, in <module>
BufferType = buffer
NameError: name 'buffer' is not defined
dpkg: warning: subprocess old pre-removal script returned error exit status 1
dpkg: trying script from the new package instead ...
[....] Stopping authentication failure monitor: fail2banTraceback (most recent call last):
File "/usr/lib/python2.7/site.py", line 68, in <module>
import os
File "/usr/lib/python2.7/os.py", line 49, in <module>
import posixpath as path
File "/usr/lib/python2.7/posixpath.py", line 17, in <module>
import warnings
File "/usr/lib/python2.7/warnings.py", line 8, in <module>
import types
File "/usr/lib/python2.7/types.py", line 36, in <module>
BufferType = buffer
NameError: name 'buffer' is not defined
. ok
Traceback (most recent call last):
File "/usr/lib/python2.7/site.py", line 68, in <module>
import os
File "/usr/lib/python2.7/os.py", line 49, in <module>
import posixpath as path
File "/usr/lib/python2.7/posixpath.py", line 17, in <module>
import warnings
File "/usr/lib/python2.7/warnings.py", line 8, in <module>
import types
File "/usr/lib/python2.7/types.py", line 36, in <module>
BufferType = buffer
NameError: name 'buffer' is not defined
dpkg: error processing /var/cache/apt/archives/fail2ban_0.8.6-3wheezy3_all.deb (--unpack):
subprocess new pre-removal script returned error exit status 1
Traceback (most recent call last):
File "/usr/lib/python2.7/site.py", line 68, in <module>
import os
File "/usr/lib/python2.7/os.py", line 49, in <module>
import posixpath as path
File "/usr/lib/python2.7/posixpath.py", line 17, in <module>
import warnings
File "/usr/lib/python2.7/warnings.py", line 8, in <module>
import types
File "/usr/lib/python2.7/types.py", line 36, in <module>
BufferType = buffer
NameError: name 'buffer' is not defined
dpkg: error while cleaning up:
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
/var/cache/apt/archives/fail2ban_0.8.6-3wheezy3_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
I have tried apt-get install --reinstall fail2ban, apt-get remove --purge fail2ban, and none of those worked. Fail2ban is not functioning and I cannot get it to reinstall or be removed at all. Everything was working totally fine until today when all of a sudden fail2ban stopped working.
Another typical sort of error from this:
Code:
dpkg: error processing fail2ban (--configure):
Package is in a very bad inconsistent state - you should
reinstall it before attempting configuration.
Errors were encountered while processing:
fail2ban
E: Sub-process /usr/bin/dpkg returned an error code (1)
Has anyone encountered this error before? Does anyone know why this is happening? I have no idea how to fix it. Thank you...
Hmm... nothing happens if I enter that into the terminal.
By the way, upon restarting the server, I was able to uninstall and reinstall fail2ban. However, the fail2ban service will not start, so I don't know where the problem really is. If I enter "service fail2ban status," it always gives "fail2ban is not running... failed!"
Seems that something about Fail2ban must have changed, because when I disabled my jail.local file and restarted fail2ban, it restarted just fine. Perhaps there were two issues here: a python error that was resolved by rebooting and reinstalling fail2ban; and a fail2ban error, resolved by disabling several jails in jail.local that prevented fail2ban from functioning. I disabled a few jails and now it works. Shrug. Going to mark this as SOLVED but if anyone has input I'd still love to hear it. I don't really consider this a fix so much as a "huh, it works now... cool."
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.