mysql-server cant install on linux

Bozgun picture Bozgun · Nov 8, 2017 · Viewed 11k times · Source

I removed the current mysql like that :

apt-get remove --purge mysql-server mysql-client mysql-common
apt-get remove --purge mysql-client-core-5.5
apt-get autoremove
apt-get autoclean
rm -rf /var/lib/mysql

And than when I want to reinstall I got some problems:

apt-get install mysql-server 

//the output is

The following packages have unmet dependencies:
 mysql-server : Depends: mysql-server-5.5 but it is not going to be installed
E: Unable to correct problems, you have held broken packages.**

and again

apt-get install mysql-server-5.5 

//the output is

The following information may help to resolve the situation:

The following packages have unmet dependencies:
mysql-server-5.5 : PreDepends: mysql-common (>= 5.5.47-0+deb7u1) but it is not going to be installed
Depends: mysql-client-5.5 (>= 5.5.47-0+deb7u1) but it is not going to be installed
Recommends: mailx
E: Unable to correct problems, you have held broken packages.

I have already installed many times mysql-common and mysql-clint-5.5

What might be problem?

Answer

Bozgun picture Bozgun · Nov 8, 2017

I solved this after 6 hours :) Main problem was version number.After unistalling you should write like this:

To install mysql-server :

firstly install mysql-server-5.5

And to install mysql-server-5.5:

install mysql-common apt-get install mysql-common=5.5.47-0+deb7u1

install mysql-client-5.5 apt-get install mysql-client=5.5.47-0+deb7u1

After install them : install mysql-server-5.5 apt-get install mysql-server-5.5

And finally : install mysql-server mysql-client apt-get install mysql-server mysql-client