如何删除 mysql-client

如何删除 mysql-client

我想删除 mysql-client。我使用以下命令安装了 mysql-client 和 mysql-server:

sudo apt-get install mysql-server mysql-client

现在我无法删除它。

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.

“软件包‘mysql-client’未安装,因此未删除”,但它已安装并且我使用它。当我尝试删除‘mysql-server’和其他一些软件包时也发生了类似的事情。出了什么问题?

我使用命令:

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]

我没有看到 mysql-client 或服务器。

帮助了我,删除mysql并重新安装后,所有包都在命令后开始显示

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

答案1

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

我希望你能得到一些帮助。:)

相关内容