Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Trying to fix a broken mysql installation, this happened after upgrading from debian 6.0 to 7.0. I have the dotdeb.org packages in my /etc/apt/sources.list.

root@ginger:/var/log/mysql# apt-get install mysql-client
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-5.5 : Depends: mysql-client-5.5 (>= 5.5.31+dfsg-0+wheezy1) but 5.5.30-1~dotdeb.0 is to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

Running apt-get -f install results in :

root@ginger:/var/log/mysql# apt-get install -f
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
  libfont-freetype-perl libfontenc1 libgmp3c2 libgsf-1-114 libgsf-1-common libpython2.6 libxcb-render-util0
  libxfont1 mysql-client-core-5.5 xfonts-encodings xfonts-utils
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
Suggested packages:
The following packages will be upgraded:
1 upgraded, 0 newly installed, 0 to remove and 141 not upgraded.
178 not fully installed or removed.
Need to get 1,923 kB of archives.
After this operation, 6,752 kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://ftp.us.debian.org/debian/ wheezy/main mysql-client-5.5 amd64 5.5.31+dfsg-0+wheezy1 [1,923 kB]
Fetched 1,923 kB in 0s (2,323 kB/s)
Reading changelogs... Done
(Reading database ... 36477 files and directories currently installed.)
Preparing to replace mysql-client-5.5 5.5.30-1~dotdeb.0 (using .../mysql-client-5.5_5.5.31+dfsg-0+wheezy1_amd64.deb) ...
Unpacking replacement mysql-client-5.5 ...
dpkg: error processing /var/cache/apt/archives/mysql-client-5.5_5.5.31+dfsg-0+wheezy1_amd64.deb (--unpack):
 trying to overwrite '/usr/bin/mysqlcheck', which is also in package mysql-client-core-5.5 5.5.30-1~dotdeb.0
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Errors were encountered while processing:
E: Sub-process /usr/bin/dpkg returned an error code (1)

Any idea how to remove and do a clean install of mysql?

share|improve this question
Take a look at linuxquestions.org/questions/debian-26/… –  msanford Jul 27 '13 at 3:22
The real problem here is mixing official repos with dotdeb ones. –  dawud Jul 27 '13 at 5:32

3 Answers 3

up vote 1 down vote accepted

The following worked for me :

apt-get -f install -o Dpkg::Options::="--force-overwrite"

And followed by :

apt-get remove –purge mysql\*
rm -rf /var/lib/mysql
rm -rf /etc/mysql
dpkg -l | grep -i mysql
apt-get clean
apt-get install mysql-client mysql-client-5.5 mysql-common mysql-server-5.5

Make sure to backup all data as this will delete everything.

I found this solution here

share|improve this answer

I have got this working:

apt-get remove --purge mysql-client-5.5 mysql-common mysql-server mysql-server-5.5 mysql-server-core-5.5
apt-get -f install -o Dpkg::Options::="--force-overwrite" mysql-server

This recreated me deleted /ets/mysql and /var/lib/mysql directories with defaults. I have found this packages list with OP's dpkg -l | grep -i mysql .

share|improve this answer

It looks like your missing dpkg. Are you having issues installing other packages using apt-get? try wget a binary of mysql then dpkg to install it. If you get an error about the command or package dpkg doesn't exists then you know your problem is dpkg and you will need to get it on your system then try installing it.

share|improve this answer
Nope dpkg is working fine I can install other packages. –  Barış Uşaklı Jul 27 '13 at 3:27
@Bans Have you tried wget ftp.us.debian.org/debian/pool/main/m/mysql-5.5/… then dpkg -i mysql-client-5.5_5.5.31+dfsg-0+wheezy1_amd64.deb –  Ben P. Dorsi-Todaro Jul 27 '13 at 3:27

Your Answer


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.