Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

This has been happening for a few weeks. Every other package upgrades without issue except this one, but I'm not sure what's causing this or how to debug it.

sudo apt-get upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be upgraded:
  percona-server-server-5.5
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/22.1 MB of archives.
After this operation, 845 kB disk space will be freed.
Do you want to continue [Y/n]? 

Preconfiguring packages ...


(Reading database ... 684209 files and directories currently installed.)
Preparing to replace percona-server-server-5.5 5.5.30-rel30.1-465.precise (using .../percona-server-server-5.5_1%3a5.5.30-rel30.2-503.precise_amd64.deb) ...
 * Stopping MySQL (Percona Server) mysqld                                                                                                                                                                [fail] 
invoke-rc.d: initscript mysql, action "stop" failed.
dpkg: warning: subprocess old pre-removal script returned error exit status 1
dpkg - trying script from the new package instead ...
 * Stopping MySQL (Percona Server) mysqld                                                                                                                                                                [fail] 
invoke-rc.d: initscript mysql, action "stop" failed.
dpkg: error processing /var/cache/apt/archives/percona-server-server-5.5_1%3a5.5.30-rel30.2-503.precise_amd64.deb (--unpack):
 subprocess new pre-removal script returned error exit status 1
 * Stopping MySQL (Percona Server) mysqld                                                                                                                                                                [fail] 
invoke-rc.d: initscript mysql, action "stop" failed.
 * Starting MySQL (Percona Server) database server mysqld                                                                                                                                                [ OK ] 
Errors were encountered while processing:
 /var/cache/apt/archives/percona-server-server-5.5_1%3a5.5.30-rel30.2-503.precise_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
share|improve this question
1  
What happens if you shut down the Percona Server yourself? stop mysql-server Also inspect the log files (syslog or other log you enabled for Percona). –  gertvdijk May 24 '13 at 14:22
1  
gertvdijk's tip works for me: service mysql stop && aptitude safe-upgrade –  Kevin Horst Jun 9 '13 at 13:54

3 Answers 3

Stop mysql first. Then run the update. It should then work.

Edit. Before you run the update try

sudo service mysql stop

then

sudo apt-get upgrade

Then you can do

service mysql start

If you still have trouble then you might want to check that the "sudo service mysql stop" command leaves no MySQL processes behind. You can check for processes with the following command. Interpreting the output of ps is beyond the scope of this answer ps -ef |grep mysql

However for completeness here is what I get when MySQL is running

root@control:~# ps -ef |grep mysql
root      1304     1  0 Oct24 ?        00:00:00 /bin/sh /usr/bin/mysqld_safe
mysql     2568  1304  6 Oct24 ?        10:55:04 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql/ --plugin-dir=/usr/lib/mysql/plugin --user=mysql --log-error=/var/lib/mysql/mysql-error.log --open-files-limit=65535 --pid-file=/var/lib/mysql/mysql.pid --socket=/var/run/mysqld/mysqld.sock
root      4492 23102  0 11:32 pts/3    00:00:00 grep --color=auto mysql

... and when MySQL is stopped ...

root@control:~# ps -ef |grep mysql
root      4492 23102  0 11:32 pts/3    00:00:00 grep --color=auto mysql
share|improve this answer
    
Welcome to AU! We value and encourage high-quality answers. While your answer sounds generally helpful, it gives readers only a rough idea what to do. Can you describe in detail the steps necessary to enact your solution? –  David Foerster Oct 30 at 10:17
    
Hey Dave. I've updated my answer! Thanks for your comment. –  Stewart Robinson Oct 31 at 11:34

I had exactly the same problem, the only way I was able to solve it was killing mysql:

ps aux | grep mysql 
mysql     1325 10.3  3.3 2216444 309324 ?      Sl   Sep24  22:38 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib/mysql/plugin --user=mysql --log-error=/var/
lib/mysql/ecom-mysql.err --pid-file=/var/lib/mysql/ecom-mysql.pid --socket=/var/run/mysqld/mysqld.sock --port=3306

sudo kill  -9 1325    
sudo apt-get update && sudo apt-get dist-upgrade
share|improve this answer

I too had this problem on Debian Wheezy. All I could do was to kill the mysql process manually, run my apt-get update, and that worked fine.

share|improve this answer
    
Welcome to AU! We value and encourage high-quality answers. While your answer sounds generally helpful, it gives readers only a rough idea what to do. Can you describe in detail the steps necessary to enact your solution? I suspect that it's going to be the same as the other two answers though. –  David Foerster Oct 30 at 10:16

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.