"dpkg: error processing gzip (--configure): Package is in a very bad inconsistent state - you should reinstall it before attempting configuration. Errors were encountered while processing: gzip"

Asked by parchezian

Actually my system hangs frequently,so i followed the suggestion given in the forum( https://answers.launchpad.net/ubuntu/+question/47604)...While trying the first command in terminal( sudo dpkg --configure -a) it shows the following error...
"dpkg: error processing gzip (--configure):
 Package is in a very bad inconsistent state - you should
 reinstall it before attempting configuration.
Errors were encountered while processing:
 gzip"

.. searched in google for solution,but ther is no exact topic ....
Plz Help me.......
Thanks in Advance..

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
parchezian
Solved:
Last query:
Last reply:
Revision history for this message
Mark Rijckenberg (markrijckenberg) said :
#1

Hi,

First please make sure to close all open programs, including all package managers like Synaptic, Add/remove programs, etc ...

Then please try this procedure:

Step 1: Open Terminal from "Applications->Accessories->
Terminal"

Step 2: Please COPY-PASTE each line below into the Terminal then hit <enter> after each line)

sudo cp -arf /var/lib/dpkg /var/lib/dpkg.backup
sudo cp /var/lib/dpkg/status-old /var/lib/dpkg/status
sudo cp /var/lib/dpkg/available-old /var/lib/dpkg/available
sudo rm -rf /var/lib/dpkg/updates/*
sudo rm -rf /var/lib/apt/lists
sudo mkdir /var/lib/apt/lists
sudo mkdir /var/lib/apt/lists/partial
LANG=C;sudo aptitude clean
LANG=C;sudo aptitude autoclean
LANG=C;sudo apt-get update
sudo dpkg --clear-avail
sudo dpkg --configure -a
sudo aptitude reinstall gzip
LANG=C;sudo aptitude install -f
LANG=C;sudo aptitude update
LANG=C;sudo aptitude dist-upgrade

Step 3: Please post results (copy/paste terminal output from each command) on this thread

Hope it helps,

Regards,

Mark

Revision history for this message
Mark Rijckenberg (markrijckenberg) said :
#2

If the previous procedure did not help, please proceed with the following:

Open a Terminal and run the following command:

gksudo gedit /var/lib/dpkg/status

Search for "gzip" in the file /var/lib/dpkg/status and you should find the following lines:

Package: gzip
Essential: yes
Status: install ok installed
Priority: required
Section: utils
Installed-Size: 280
Maintainer: Ubuntu Core Developers <email address hidden>
Architecture: i386
Version: 1.3.12-8ubuntu1.1
Pre-Depends: libc6 (>= 2.4)
Suggests: less
Description: GNU compression utilities
 This package provides the standard GNU file compression utilities, which
 are also the default compression tools for Debian. They typically operate
 on files with names ending in '.gz', but can also decompress files ending
 in '.Z' created with 'compress'.
Original-Maintainer: Bdale Garbee <email address hidden>

Remove these lines from the file and save the change.

Then run the following commands again:

LANG=C;sudo aptitude clean
LANG=C;sudo aptitude autoclean
LANG=C;sudo apt-get update
sudo dpkg --clear-avail
sudo dpkg --configure -a
sudo aptitude reinstall gzip
LANG=C;sudo aptitude install -f
LANG=C;sudo aptitude update
LANG=C;sudo aptitude dist-upgrade

Revision history for this message
parchezian (rap-ivak) said :
#3

Thanks for your kind information... My problem was solved, I did the following procedure... Updated the software packages in the Update Manager....So now i can run the "sudo dpkg --configure -a" command in the terminal....
If i found any trouble in future, may follow ur suggestion....But your information may usefull for many people who suffer with tis problem....Once again Thanking You...