Ubuntu

package mysql-server-5.1 5.1.41-3ubuntu12.3 failed to install/upgrade: Package is in a very bad inconsistent state - you should reinstall it before attempting a removal.

Reported by David Mawdsley on 2010-08-03
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
mysql-dfsg-5.1 (Ubuntu)
Low
Unassigned

Bug Description

dpkg: error processing mysql-server-5.1; however:
   Package mysql-server-5.1 is not configured yet.
dpkg: error processing mysql-server (--configure):
   dependency problems - leaving unconfigured
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place
Errors were encountered while processing:
  mysql-server-5.1
  mysql-server
Preconfiguring packages ...
Preconfiguring packages ...
none
(Reading database ... 193150 files and directories currently installed.)
Preparing to replace mysql-server-5.1 5.1.41.3ubuntu12.3 (using .../mysql-server-5.1_5.1.41-3ubuntu12.6_i386.deb) ...

(This was part of an update using Package Manager which completely stops at this point. I noticed a space in the last line in the mysql-server-5.1(here)5.1.41.3ubuntu12.3 though perhaps that's not an issue.)
My system:
Description: Ubuntu 10.04.1 LTS
Release: 10.04

ProblemType: Package
DistroRelease: Ubuntu 10.04
Package: mysql-server-5.1 5.1.41-3ubuntu12.3
ProcVersionSignature: Ubuntu 2.6.32-24.38-generic 2.6.32.15+drm33.5
Uname: Linux 2.6.32-24-generic i686
AptOrdering:
 mysql-server: Remove
 mysql-server-5.1: Remove
Architecture: i386
Date: Tue Aug 3 16:41:06 2010
ErrorMessage: Package is in a very bad inconsistent state - you should reinstall it before attempting a removal.
InstallationMedia: Ubuntu 10.04 LTS "Lucid Lynx" - Release i386 (20100429)
Logs.var.log.daemon.log:

MySQLConf.etc.mysql.conf.d.mysqld.safe.syslog.cnf:
 [mysqld_safe]
 syslog
MySQLVarLibDirListing: ['MadMod09', 'mysql_upgrade_info', 'ibdata1', 'phpmyadmin', 'debian-5.1.flag', 'mysql', 'ib_logfile1', 'ib_logfile0']
SourcePackage: mysql-dfsg-5.1
Title: package mysql-server-5.1 5.1.41-3ubuntu12.3 failed to install/upgrade: Package is in a very bad inconsistent state - you should reinstall it before attempting a removal.

David Mawdsley (dm-madmod) wrote :
Thierry Carrez (ttx) wrote :

Looks like parts of the package were uninstalled manually, which put the package in a very bad inconsistent state. Did you try reinstalling it before attempting the removal, as advised ?

Changed in mysql-dfsg-5.1 (Ubuntu):
importance: Undecided → Low
status: New → Incomplete
David Mawdsley (dm-madmod) wrote :

Probably not. I've tried installing and removing but with the same stall point.
sudo apt-get remove --purge mysql-server-5.1 was unsuccessful also. That command results in:

E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)
E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?

I don't know where to go from here.

David Mawdsley (dm-madmod) wrote :

I paid a visit to Mark Rijckenberg's page https://help.ubuntu.com/community/PackageManagerTroubleshootingProcedure and went through the procedure step-by-step.

The line: LANG=C;sudo apt-get --purge autoremove was unsuccessful with "E: The package mysql-server-5.1 needs to be reinstalled, but I cant' find the archive for it." However, I continued on with the procedure until the next problem at
sudo dpkg --configure -a where it complained about the bad state of mysql-server-5.1 and recommended reinstall.

LANG=C;sudo apt-get -f install hangs completely. I then restarted the computer and gave it
sudo dpkg --configure -a so that I could at least use update-manager for other packages.

So now I'm back where I was with mysql-server-5.1 messed up. Luckly, I don't need my database 'MadMod09' to keep my business running and will have to do without it until I can get a real fix working. The rest of the computer with Ubuntu 10.04 LTS is working fine. Interestingly enough, mysql-server-5.1 took the update properly on my server, but I'm not using 'MadMod09' on my server as it's only used as a fileserver for our network. So the update from the repository is okay.

Thierry Carrez (ttx) wrote :

I'd try reinstalling the package from the archive, something like

sudo apt-get install mysql-server-5.1
or
sudo apt-get install --reinstall mysql-server-5.1

since it sounds like it's in a too bad shape to even uninstall properly.

David Mawdsley (dm-madmod) wrote :

Hi Thierry,

First, thanks for any help on this sticky problem you can give. Here's what I've done along with notes:

I gave the command: sudo apt-get install --reinstall mysql-server-5.1 which results in:

Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
  tinyca mailx
Recommended packages:
  libhtml-template-perl
The following packages will be upgraded:
  mysql-server-5.1
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0B/7,008kB of archives.
After this operation, 0B of additional disk space will be used.
Preconfiguring packages ...
(Reading database ... 193134 files and directories currently installed.)
Preparing to replace mysql-server-5.1 5.1.41-3ubuntu12.3 (using .../mysql-server-5.1_5.1.41-3ubuntu12.6_i386.deb) ...

This refuses to time out, hangs completely and won't exit with ctrl+c, so a force quit is needed.

I then opened another shell and tried:
madmod@madmod-laptop:~$ sudo dpkg --configure -a
dpkg: status database area is locked by another process

So then I restarted the computer and opened a shell and tried:
madmod@madmod-laptop:~$ sudo dpkg --configure -a

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

But at least update-manager is back to working.

Thierry Carrez (ttx) wrote :

No longer an issue, according to a private email from the reporter. Thanks for keeping us posted !

Changed in mysql-dfsg-5.1 (Ubuntu):
status: Incomplete → Invalid
Jia Chen (chen-1002) wrote :

Hi Thierry,

I still have this issue. When I run sudo apt-get autoremove && sudo apt-get autoclean, I get the following

sudo apt-get autoremove && sudo apt-get autoclean
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
  mysql-server-5.1
0 upgraded, 0 newly installed, 1 to remove and 61 not upgraded.
1 not fully installed or removed.
After this operation, 15.7MB disk space will be freed.
Do you want to continue [Y/n]? y
dpkg: error processing mysql-server-5.1 (--remove):
 Package is in a very bad inconsistent state - you should
 reinstall it before attempting a removal.
Errors were encountered while processing:
 mysql-server-5.1
E: Sub-process /usr/bin/dpkg returned an error code (1)
chenj@chenj-desktop:~$ sudo apt-get remove mysql-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package mysql-server is not installed, so not removed
The following packages were automatically installed and are no longer required:
  mysql-server-5.1
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 62 not upgraded.
1 not fully installed or removed.
Need to get 0B/7,103kB of archives.
After this operation, 0B of additional disk space will be used.
Preconfiguring packages ...
Selecting previously deselected package mysql-server-5.1.
(Reading database ... 203997 files and directories currently installed.)
Preparing to replace mysql-server-5.1 5.1.41-3ubuntu12.3 (using .../mysql-server-5.1_5.1.41-3ubuntu12.3_amd64.deb) ...

Then it hangs there. Could you tell us how the reporter fixed this issue?

Thierry Carrez (ttx) wrote :

Here was the email contents:

=============
Thanks very much for your efforts at helping me with this problem--not a
bug after all. My system got messed up a bit.

Here's basically what I did: (may be of use to others)

1. I went to /etc/init and gave the command:
sudo gedit mysql.conf so that I could comment out the start-on lines,
saved the file and rebooted the computer.

2. I then cleared up package manager with: sudo dpkg --configure -a

3. I then used: sudo apt-get --reinstall install mysql-server

4. Next I used: sudo apt-get remove mysql-server

5. And then finally: sudo apt-get autoremove

6. After a reboot I was able to completely use update-manager.

I don't know how to dump the Bug #613195, but it totally resolved at
this point.
===============

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers