第1步:列出mysql殘余文件信息
root@witts:/# dpkg --get-selections | grep mysql mysql-apt-config deinstall mysql-common deinstall mysql-community-client deinstall mysql-community-server deinstall mysql-workbench-community deinstall
第2步:依次清理上面列出的殘余文件信息
root@witts:/# apt-get --purge remove mysql-apt-config 正在讀取軟件包列表... 完成 正在分析軟件包的依賴關系樹 正在讀取狀態信息... 完成 下列軟件包將被【卸載】: mysql-apt-config* 升級了 0 個軟件包,新安裝了 0 個軟件包,要卸載 1 個軟件包,有 1 個軟件包未被升級。 解壓縮后會消耗 0 B 的額外空間。 您希望繼續執行嗎? [Y/n] y (正在讀取數據庫 ... 系統當前共安裝有 214935 個文件和目錄。) 正在清除 mysql-apt-config (0.8.9-1) 的配置文件 ...
第3步:清除mysql的common,client,server
root@witts:/# apt-get --purge remove mysql-community-client root@witts:/# apt-get --purge remove mysql-community-client root@witts:/# apt-get --purge remove mysql-community-server
第4步:清除相關的依賴和相關的信息
root@witts:/# apt-get autoremove //依賴關系
root@witts:/# apt-get autoclean //殘留信息
root@witts:rm /etc/mysql/ -R
root@witts:rm /var/lib/mysql/ -R