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. cant stop mysql server to reinstall it

Bug #580375 reported by kgb
76
This bug affects 15 people
Affects Status Importance Assigned to Milestone
mysql-dfsg-5.1 (Ubuntu)
Medium
Unassigned

Bug Description

Ubuntu 10.04 LTS

Reading package lists... Done
Building dependency tree
Reading state information... Done
Reading extended state information
Initializing package states... Done
The following packages will be REINSTALLED:
  mysql-server-5.1
0 packages upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 28 not upgraded.
Need to get 0B/7,103kB of archives. After unpacking 0B will be used.
Writing extended state information... Done
Preconfiguring packages ...
(Reading database ... 140437 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_amd64.deb) ...
/var/lib/dpkg/info/mysql-server-5.1.prerm: line 12: 2851 Killed stop mysql
stop: Job has already been stopped: mysql
invoke-rc.d: initscript mysql, action "stop" failed.
invoke-rc.d returned 1
There is a MySQL server running, but we failed in our attempts to stop it.
Stop it yourself and try again!
dpkg: error processing /var/cache/apt/archives/mysql-server-5.1_5.1.41-3ubuntu12_amd64.deb (--unpack):
 subprocess new pre-installation script returned error exit status 1
/var/lib/dpkg/info/mysql-server-5.1.postinst: line 280: 3047 Killed start mysql
Errors were encountered while processing:
 /var/cache/apt/archives/mysql-server-5.1_5.1.41-3ubuntu12_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
A package failed to install. Trying to recover:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Reading extended state information
Initializing package states... Done

"stop mysql" and "start mysql" just hang and dont seem to do anything. killing mysql process while attempting reinstallation makes dpkg try to start it again, so it keeps doing nothing.

ProblemType: Package
DistroRelease: Ubuntu 10.04
Package: mysql-server-5.1 5.1.41-3ubuntu12
ProcVersionSignature: Ubuntu 2.6.32-22.33-generic 2.6.32.11+drm33.2
Uname: Linux 2.6.32-22-generic x86_64
Architecture: amd64
Date: Fri May 14 11:51:28 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 amd64 (20100429)
Logs.var.log.kern.log:
 May 13 20:36:40 kgb kernel: [ 2413.726506] type=1505 audit(1273768600.742:15): operation="profile_load" pid=13240 name="/usr/sbin/mysqld"
 May 13 21:12:00 kgb kernel: [ 9.971952] type=1505 audit(1273770719.992:14): operation="profile_load" pid=800 name="/usr/sbin/mysqld"
 May 14 11:48:45 kgb kernel: [ 10.647012] type=1505 audit(1273823325.662:14): operation="profile_load" pid=781 name="/usr/sbin/mysqld"
MySQLConf.etc.mysql.conf.d.mysqld.safe.syslog.cnf:
 [mysqld_safe]
 syslog
MySQLVarLibDirListing: ['kgb.pid', 'mysql', 'ib_logfile1', 'debian-5.1.flag', 'mysql_upgrade_info', 'ib_logfile0', 'ibdata1']
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
kgb (yeriomin) wrote :
Revision history for this message
Chuck Short (zulcss) wrote :

Do you have a mysql root password set?

Regards
chuck

Changed in mysql-dfsg-5.1 (Ubuntu):
importance: Undecided → Medium
status: New → Incomplete
Revision history for this message
kgb (yeriomin) wrote : Re: [Bug 580375] 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. cant stop mysql server to reinstall it
Download full text (4.3 KiB)

Hi, chuck
What do you mean? Mysql root password is not empty. Should i put it somewhere?
I've read on the ubuntu forum that it's actually a problem with mysql
upstart script.. So at first i was doing "sudo -u mysql mysqld" after
each boot, then i copied an init.d script from an other machine. Both
solutions work, so the problem is not with mysql.

sergey

2010/5/17, Chuck Short <email address hidden>:
> Do you have a mysql root password set?
>
> Regards
> chuck
>
> ** Changed in: mysql-dfsg-5.1 (Ubuntu)
> Importance: Undecided => Medium
>
> ** Changed in: mysql-dfsg-5.1 (Ubuntu)
> Status: New => Incomplete
>
> --
> 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. cant stop mysql server to reinstall it
> https://bugs.launchpad.net/bugs/580375
> You received this bug notification because you are a direct subscriber
> of the bug.
>
> Status in “mysql-dfsg-5.1” package in Ubuntu: Incomplete
>
> Bug description:
> Ubuntu 10.04 LTS
>
> Reading package lists... Done
> Building dependency tree
> Reading state information... Done
> Reading extended state information
> Initializing package states... Done
> The following packages will be REINSTALLED:
> mysql-server-5.1
> 0 packages upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 28
> not upgraded.
> Need to get 0B/7,103kB of archives. After unpacking 0B will be used.
> Writing extended state information... Done
> Preconfiguring packages ...
> (Reading database ... 140437 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_amd64.deb) ...
> /var/lib/dpkg/info/mysql-server-5.1.prerm: line 12: 2851 Killed
> stop mysql
> stop: Job has already been stopped: mysql
> invoke-rc.d: initscript mysql, action "stop" failed.
> invoke-rc.d returned 1
> There is a MySQL server running, but we failed in our attempts to stop it.
> Stop it yourself and try again!
> dpkg: error processing
> /var/cache/apt/archives/mysql-server-5.1_5.1.41-3ubuntu12_amd64.deb
> (--unpack):
> subprocess new pre-installation script returned error exit status 1
> /var/lib/dpkg/info/mysql-server-5.1.postinst: line 280: 3047 Killed
> start mysql
> Errors were encountered while processing:
> /var/cache/apt/archives/mysql-server-5.1_5.1.41-3ubuntu12_amd64.deb
> E: Sub-process /usr/bin/dpkg returned an error code (1)
> A package failed to install. Trying to recover:
> Reading package lists... Done
> Building dependency tree
> Reading state information... Done
> Reading extended state information
> Initializing package states... Done
>
>
> "stop mysql" and "start mysql" just hang and dont seem to do anything.
> killing mysql process while attempting reinstallation makes dpkg try to
> start it again, so it keeps doing nothing.
>
> ProblemType: Package
> DistroRelease: Ubuntu 10.04
> Package: mysql-server-5.1 5.1.41-3ubuntu12
> ProcVersionSignature: Ubuntu 2.6.32-22.33-generic 2.6.32.11+drm33.2
> Uname: Linux 2.6.32-22-generic x86_64
> Architecture: amd64
> Date: Fri May 14 11:51:28 2010
>...

Read more...

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

Here is some stuff from my experience:

# ps auxw | grep dpkg
root 5823 0.0 0.0 3320 804 pts/2 S+ 13:08 0:00 grep --color=auto dpkg
root 14257 0.0 0.2 13804 11232 pts/0 Ss+ 13:01 0:00 /usr/bin/dpkg --status-fd 20 --force-depends --force-remove-essential --remove libhtml-template-perl mysql-server-5.1 mysql-server-core-5.1
root 14335 0.0 0.1 10212 6988 pts/0 S+ 13:01 0:00 /usr/bin/perl -w /usr/share/debconf/frontend /var/lib/dpkg/info/mysql-server-5.1.prerm remove
root 14363 0.0 0.0 4236 1360 pts/0 S+ 13:01 0:00 /bin/bash -e /var/lib/dpkg/info/mysql-server-5.1.prerm remove

Just freezes, and stays in memory forever. Same thing in the case of the install. I cannot get removed, nor installed.

Changed in mysql-dfsg-5.1 (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
Xeno Campanoli (xeno) wrote :

# apt-get autoremove
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
  mysql-server-5.1 mysql-server-core-5.1
0 upgraded, 0 newly installed, 2 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 26.9MB disk space will be freed.
Do you want to continue [Y/n]?
(Reading database ... 56121 files and directories currently installed.)
Removing mysql-server-5.1 ...

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

Sorry...just sticks there forever at the ... ending in my last comment.

Revision history for this message
Tom Helner (duffman) wrote :
Revision history for this message
Rohit Khatkar (mldy) wrote :

Hey i ran the above command but does not work for me..........then i ran the following command ,the same problem accours...terminal freezes and does not show anything..........

sudo service mysql stop

it means there is some problem in mysql thats why mysql is not stopping and upgrade is not happening....

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

Other bug subscribers