I run a Debian 6 server and use it to host a dozen of LAMP based websites. I configured it to email me whenever a software update becomes available, and this morning I received the notification for 6 new available updates all related to mySql:

mysql-server, mysql-client, mysql-common

and few other dependencies. I tried to run an

apt-get update apt-get upgrade

and everything went ok until the upgrade process met mysql-client. The error that I get is the following:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following packages will be upgraded:
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
Need to get 0 B/1,772 kB of archives.
After this operation, 7,049 kB of additional disk space will be used.
Do you want to continue [Y/n]? Y

Reading changelogs... Done

(Reading database ... 84121 files and directories currently installed.)
Preparing to replace mysql-client-5.5 5.5.38-1~dotdeb.0 (using .../mysql-client-5.5_5.5.46-0+deb6u1_amd64.deb) ...

Unpacking replacement mysql-client-5.5 ...
dpkg: error processing /var/cache/apt/archives/mysql-client-5.5_5.5.46-0+deb6u1_amd64.deb (--unpack):

 trying to overwrite '/usr/share/man/man1/mysql.1.gz', which is also in package mysql-client-core-5.5 5.5.38-1~dotdeb.0
configured to not write apport reports
                                  dpkg-deb: subprocess paste killed by signal (Broken pipe)

Processing triggers for man-db ...

Errors were encountered while processing:

E: Sub-process /usr/bin/dpkg returned an error code (1)

I'm not experienced enough to completely understand what happened. I tried to run the apt-get -f install as suggested by the message, but nothing happened. I also tried to remove mysql-client (the idea was "I remove this one, then re-install it from scratch") but also this operation failed with the same error. I tried to purge mysql, but the system was unable to complete that operation either.

At the moment, I re-started the service, and everything looks to be working now, but the problem with this failed upgrade persists.

Here is a grep of all the mysql-related packages I have installed on my server:

~# dpkg -l | grep -i mysql
ii  libdbd-mysql-perl                     4.016-1                      Perl5 database interface to the MySQL database
ii  libmysqlclient16                      5.1.73-1+deb6u1              MySQL     database client library
ii  mysql-client                          5.5.46-0+deb6u1              MySQL database client (metapackage depending on the latest version)
ii  mysql-client-5.5                      5.5.38-1~dotdeb.0            MySQL database client binaries
ii  mysql-client-core-5.5                 5.5.38-1~dotdeb.0            MySQL database core client binaries
ii  mysql-common                          5.5.38-1~dotdeb.0            MySQL database common files, e.g. /etc/mysql/my.cnf
ii  mysql-common-5.5                      5.5.46-0+deb6u1              MySQL database common files, e.g. /etc/mysql/my.cnf
ii  mysql-server                          5.5.46-0+deb6u1              MySQL database server (metapackage depending on the latest version)
rc  mysql-server-5.1                      5.1.73-1+deb6u1              MySQL database server binaries and system database setup
iU  mysql-server-5.5                      5.5.46-0+deb6u1              MySQL database server binaries and system database setup
ii  mysql-server-core-5.5                 5.5.46-0+deb6u1              MySQL database server binaries
ii  php5-mysql                            5.4.45-1~dotdeb+6.1          MySQL module for php5
rc  php5-mysqlnd                          5.4.45-1~dotdeb+6.1          MySQL module for php5 (Native Driver)
ii  phpmyadmin                            4:3.3.7-10                   MySQL web administration tool

Adding the result of the apt-get remove

~# apt-get remove mysql-server-5.5
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
 mysql-server : Depends: mysql-server-5.1 but it is not going to be installed or
                         mysql-server-5.5 but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

Can anyone help me understanding how to fix this? Thank you in advance, Simone

  • Try upgrading mysql-client-core-5.5 first (apt-get install mysql-client-core-5.5).
    – wurtel
    Dec 16, 2015 at 11:00
  • I got the same problem as you. Please remove all mysql packages apt-get remove ... and than install same again. We had success. Dec 18, 2015 at 13:43

2 Answers 2


As this has been explained by @M Somerville, there is a conflict between the packages previously installed by the dotdeb repository that you're using, and the official debian repository that now contains a more recent version of mysql 5.5.

What you need to do is remove mysql 5.5 completely and then install the latest version available in your repositories.

This solved the problem for me without any loss of data / configuration:

apt-get remove mysql-client-5.5 mysql-client-core-5.5 mysql-client mysql-server-5.5 mysql-server


apt-get install mysql-client mysql-server

In any case I cannot stress enough the importance of a backup before you try this.

Good luck

  • It worked, even with a slight change: apt-get remove mysql-client-5.5 mysql-client-core-5.5 mysql-client mysql-server-5.5 mysql-server Thanks for your help! Jan 11, 2016 at 15:59
  • Thanks for the feedback, I've updated my answer accordingly! Glad I could help.
    – Guillaume
    Jan 12, 2016 at 9:44
  • Thanks to you, 'cause this solved a real headache... with that error, I wasn't able to upgrade anything on the machine. :) Jan 13, 2016 at 10:15

Debian backported MySQL 5.5.46 to squeeze-lts on 9th December. From what you say it sounds like you have been using the dotdeb repository as well as Debian’s, and dotdeb contains MySQL 5.5.38. So now squeeze-lts contains a later package for a package you have installed, it tries to install it. But the two repositories do not appear to agree on package names/conflicts/dependencies, and so the upgrade of mysql-client-5.5 (present in both repositories) conflicts due to a dotdeb package mysql-client-core-5.5 that squeeze-lts knows nothing about (so the comment from wurtel won’t help, as there’s nothing to upgrade).

In general, I would never run a force install, even if something suggests you should :) If you’re happy with 5.5.46 from squeeze-lts, then I suggest you try and uninstall any 5.5.38-version packages, so e.g. mysql-client-core-5.5, not mysql-client, then mysql-client-5.5, then mysql-common – hopefully that will be possible without conflicts, though I can’t be sure, sorry. If it does work, then your idea of removing and readding does sound like a good one to make sure it’s all cleanly installed.

This may all happen all over again if dotdeb updates their repository to a later version than squeeze-lts, in general I would suggest if you’re getting something from a third party repo such as dotdeb that you pin the packages from there so that they won’t be overridden by changes in the core repository.

  • Thanks for your reply. I tried to remove the packages in the order you suggested, but failed with the same error. I don't know why I added dotdeb to the source lists, really don't remember. Anyway, I think I'll wait for dotdeb to release a newer version of mysql-client and that should resolve the issue, correct? Thanks, S. Dec 16, 2015 at 14:21
  • I’m afraid I don’t think dotdeb will be doing that, the last release of 5.5 for squeeze was July 2014, later releases have been for wheezy. It sounds like you might have to manually remove the packages, sorry not sure of the details of that. Dec 16, 2015 at 14:27
  • @simonelippolis Could you put the error you've received when trying to remove the package into your question?
    – gxx
    Dec 17, 2015 at 1:49
  • I don't understand why you're trying to remove mysql-server-5.5, which wasn't what I suggested. But anyway, that error is saying it can't remove mysql-server-5.5 without removing mysql-server which depends upon it (or 5.1), so you would remove mysql-server and mysql-server-5.5 in the same command to get past that (and presumably get a different issue). Dec 21, 2015 at 9:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .