3

I am having problems with mysql 5.7 in ubuntu 16.04 when it comes to giving users privileges, so I want to re-install it again but when I type the command for removing mysql I get the following message

nato@nato-Compaq-Presario-CQ61-Notebook-PC:~$ sudo apt-get remove --purge mysql-server mysql-client mysql-common
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
 dbconfig-mysql : Depends: mysql-client but it is not going to be installed or
                  mariadb-client but it is not going to be installed or
                  virtual-mysql-client

E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.

I have also tried the following command but it has the same results

sudo apt-get remove --purge mysql*
sudo apt-get autoremove
sudo apt-get autoclean
  • I would be interested in an answer to this question, I had the same issue on Ubuntu 16.04 recently and ended up just reinstalling the entire OS. – the_velour_fog May 16 '16 at 9:29
  • Have you tried apt-get update then try to uninstall it again? Have an Ubuntu 16.04 and I did not see that issue. – Alex H May 16 '16 at 10:54
  • i tried it but I am still receiving the same error. – Ian Nato May 16 '16 at 11:29
  • So i decided to reinstall Ubuntu 16.04 just as the_velour_fog did and i reinstalled Mysql-server and Mysql-client and now its working fine. – Ian Nato May 18 '16 at 20:47
8

Uninstall

sudo apt-get purge mysql-server mysql-client mysql-common mysql-server-core-5.5 mysql-client-core-5.5

Remove directory

sudo rm -rf /etc/mysql /var/lib/mysql

Clean-up

sudo apt-get autoremove
sudo apt-get autoclean
| improve this answer | |
  • but from this command dpkg -l | grep mysql you have to check that all mysql modules are uninstall or not. – mehmoodnisar125 Dec 4 '18 at 5:25
8

The answer is in the error itself.

dbconfig-mysql : Depends: mysql-client but it is not going to be installed or mariadb-client but it is not going to be installed or virtual-mysql-client

The first step is to remove the dependency which disallows the removal of MySQL packages.

sudo apt-get remove dbconfig-mysql
sudo apt-get remove --purge mysql*
sudo apt-get autoremove
sudo apt-get autoclean
| improve this answer | |
  • works great. according to this specific problem only this solution works. – fthopkins Nov 26 '17 at 7:53
  • This is the only solution that worked for me. – Neon Wizard Mar 22 '18 at 23:19
2

It worked for me using

sudo apt-get purge mysql*
sudo apt-get autoremove

Also try to take a look at https://askubuntu.com/questions/776845

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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