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

Bug #574557 reported by Mickg01
68
This bug affects 14 people
Affects Status Importance Assigned to Milestone
mysql-dfsg-5.1 (Ubuntu)
Confirmed
Medium
Unassigned

Bug Description

Upon upgrading from Ubuntu 9.10 to 10.04 I was unable to run MySQL Administrator or MySQL Query Browser:
MySQL Error Nr. 2002
Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

pinging localhost succeeds.

I attempted to reinstall mysql-server-5.1 5.1.41-3ubuntu12 it gets to: Selecting previously deselected package mysql-server-5.1.
(Reading database ... 168691 files and directories currently installed.)
Preparing to replace mysql-server-5.1 5.1.41-3ubuntu12 (using .../mysql-server-5.1_5.1.41-3ubuntu12_i386.deb) ...

and then stops.

I did attempt to uninstall it and got:
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)

I'd like to get this repaired and then rescue my database but am at a loss as to how to proceed.

ProblemType: Package
DistroRelease: Ubuntu 10.04
Package: mysql-server-5.1 5.1.41-3ubuntu12
ProcVersionSignature: Ubuntu 2.6.32-21.32-generic 2.6.32.11+drm33.2
Uname: Linux 2.6.32-21-generic i686
AptOrdering:
 mysql-server: Remove
 mysql-server-5.1: Remove
Architecture: i386
Date: Mon May 3 11:38:18 2010
ErrorMessage: Package is in a very bad inconsistent state - you should reinstall it before attempting a removal.
InstallationMedia: Ubuntu 9.10 "Karmic Koala" - Release i386 (20091028.5)
Logs.var.log.daemon.log:

Logs.var.log.kern.log: May 3 02:16:42 mick-desktop kernel: [ 15.031014] type=1505 audit(1272867402.843:14): operation="profile_load" pid=831 name="/usr/sbin/mysqld"
MySQLConf.etc.mysql.conf.d.mysqld.safe.syslog.cnf:
 [mysqld_safe]
 syslog
MySQLVarLibDirListing: ['timetrex', 'guestbook', 'mysql_upgrade_info', 'ibdata1', 'debian-5.0.flag', 'ib_logfile1', 'my_db', 'mick-desktop.err', 'mysql', 'timberoaks', 'ZIP', 'timetrex1', 'ib_logfile0', 'phpmyadmin', 'DDC', 'debian-5.1.flag']
SourcePackage: mysql-dfsg-5.1
Title: package mysql-server-5.1 5.1.41-3ubuntu12 failed to install/upgrade: Package is in a very bad inconsistent state - you should reinstall it before attempting a removal.

Revision history for this message
Mickg01 (mickg01) wrote :
Revision history for this message
C de-Avillez (hggdh2) wrote :

Thank you for opening thig bug and helping make Ubuntu better. Unfortunately, the dpkg terminal log attached only shows the attempt to uninstall. Can you please try reinstalling it as suggested in the error message?

Changed in mysql-dfsg-5.1 (Ubuntu):
status: New → Incomplete
Revision history for this message
Mickg01 (mickg01) wrote : Re: [Bug 574557] Re: package mysql-server-5.1 5.1.41-3ubuntu12 failed to install/upgrade: Package is in a very bad inconsistent state - you should reinstall it before attempting a removal. Reinstall goes so far then freezes.

On 05/03/2010 01:21 PM, C de-Avillez wrote:
> Thank you for opening thig bug and helping make Ubuntu better.
> Unfortunately, the dpkg terminal log attached only shows the attempt to
> uninstall. Can you please try reinstalling it as suggested in the error
> message?
>
> ** Changed in: mysql-dfsg-5.1 (Ubuntu)
> Status: New => Incomplete
>
>
mick@mick-desktop:~$ sudo apt-get install mysql-server-5.1
Reading package lists... Done
Building dependency tree
Reading state information... Done
mysql-server-5.1 is already the newest version.
mysql-server-5.1 set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
Need to get 0B/7,007kB 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 ... 168691 files and directories currently installed.)
Preparing to replace mysql-server-5.1 5.1.41-3ubuntu12 (using
.../mysql-server-5.1_5.1.41-3ubuntu12_i386.deb) ...

ANd there it stayed for several hours with no further message.

Revision history for this message
Nicola Ferralis (feranick) wrote :

Reopening the bug. The entry in the dpkg.log is shown below:

2010-05-07 19:07:36 startup packages configure
2010-05-07 19:08:18 startup packages purge
2010-05-07 19:08:18 status half-configured mysql-server-5.1 5.1.41-3ubuntu12
2010-05-07 19:08:19 startup packages configure
2010-05-07 19:08:38 startup archives unpack
2010-05-07 19:08:38 upgrade mysql-server-5.1 5.1.41-3ubuntu12 5.1.41-3ubuntu12
2010-05-07 19:08:38 status half-configured mysql-server-5.1 5.1.41-3ubuntu12

Currently hanging while trying to reinstall.

Changed in mysql-dfsg-5.1 (Ubuntu):
status: Incomplete → New
Revision history for this message
Jonne (jonathan-vanherpe) wrote :

2010-05-10 11:01:00 configure mysql-common 5.1.41-3ubuntu12.1 5.1.41-3ubuntu12.1
2010-05-10 11:01:00 status unpacked mysql-common 5.1.41-3ubuntu12.1
2010-05-10 11:01:00 status unpacked mysql-common 5.1.41-3ubuntu12.1
2010-05-10 11:01:00 status half-configured mysql-common 5.1.41-3ubuntu12.1
2010-05-10 11:01:00 status installed mysql-common 5.1.41-3ubuntu12.1
2010-05-10 11:01:01 startup archives unpack
2010-05-10 11:01:01 upgrade mysql-server-5.1 5.1.41-3ubuntu12 5.1.41-3ubuntu12.1
2010-05-10 11:01:01 status half-configured mysql-server-5.1 5.1.41-3ubuntu12

same thing here. I had this issue during the initial upgrade from karmic to lucid too, I needed to reboot and run dpkg manually to finish the upgrade then.

Revision history for this message
Jonne (jonathan-vanherpe) wrote :

ok, i noticed in the system monitor that a process kept trying to run 'stop mysql', but mysql wasn't running (probably stopped earlier in the dpkg script). If you're into this situation, run 'sudo start mysql' and dpkg will continue normally.

Chuck Short (zulcss)
Changed in mysql-dfsg-5.1 (Ubuntu):
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
Xeno Campanoli (xeno) wrote :

This looks like what I've got.

Revision history for this message
rubenbentein (ruben-bentein) wrote :

@Jonne

Thanks, this solved the problem for me

Revision history for this message
Xeno Campanoli (xeno) wrote :

I just tried re-installing again, and the service won't come up. Here is the pastie:

http://pastie.org/982103

Revision history for this message
Eduard Mann (edma) wrote :

I had the same problem.

After comment out the "skip-bdb" line in my.cnf and killing all related install processes the

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

command worked fine.

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

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.