I want to delete mysql-client. I installed mysql-client and mysql-server by command:

sudo apt-get install mysql-server mysql-client

And now I can't remove it.

cyberha4@cyberha4-VirtualBox:/var/www/html$ sudo apt-get remove mysql-client
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package 'mysql-client' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 21 not upgraded.

"Package 'mysql-client' is not installed, so not removed", but it installed and i use it. Similar things happend when i tried to delete 'mysql-server' and some other packages. Whats wrong?

I used command:

cyberha4@cyberha4-VirtualBox:/var/www/html$ apt list --installed| grep mysql*
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
libdbd-mysql-perl/xenial-updates,xenial-security,now 4.033-1ubuntu0.1 i386 [installed,automatic]
libmysqlclient20/xenial-updates,xenial-security,now 5.7.19-0ubuntu0.16.04.1 i386 [installed,automatic]
mysql-common/xenial-updates,xenial-security,now 5.7.19-0ubuntu0.16.04.1 all [installed,automatic]
php7.1-mysql/xenial,now 7.1.8-2+ubuntu16.04.1+deb.sury.org+4 i386 [installed]

And I didn't see mysql-client or server.

This helped me, after delete mysql and reinstalled it, all packages started showing up after command

cyberha4@cyberha4-VirtualBox:/var/www/html$ dpkg --get-selections | grep mysql* mysql-client install mysql-client-5.7 install mysql-client-core-5.7 install mysql-common install mysql-server install mysql-server-5.7 install mysql-server-core-5.7 install php7.0-mysql deinstall php7.1-mysql install

  • during the installation, have you confirmed it installed properly. cos it says package not found. I suggest you use purge. sudo apt-get purge mysql*
    – saviour123
    Aug 16, 2017 at 9:35

1 Answer 1

sudo apt-get --purge remove mysql-client mysql-server mysql-common 
sudo apt-get autoremove
sudo rm -rf /etc/mysql/

I hope you get some help. :)

  • Yeah, thanks so much, its delete mysql, but after i installed mysql again (im learning ubuntu) and saw that command 'sudo apt-get install mysql-server mysql-client' installed 9 packages and they are displayed correctly when i use command dpkg --get-selections | grep mysql*
    – cyberha4
    Aug 16, 2017 at 11:20
  • some of the those packages are just dependencies and you should not worry much about it.
    – saviour123
    Aug 16, 2017 at 12:09

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.