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 
4
  • 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. Commented May 16, 2016 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. Commented May 16, 2016 at 10:54
  • i tried it but I am still receiving the same error. Commented May 16, 2016 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. Commented May 18, 2016 at 20:47

3 Answers 3

10

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 
2
  • works great. according to this specific problem only this solution works. Commented Nov 26, 2017 at 7:53
  • This is the only solution that worked for me. Commented Mar 22, 2018 at 23:19
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 
1
  • but from this command dpkg -l | grep mysql you have to check that all mysql modules are uninstall or not. Commented Dec 4, 2018 at 5:25
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

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.