我嘗試重新安裝 MariaDB,我使用了:
sudo apt-get purge mysql* mariadb*
但在上述嘗試失敗後,唯一需要卸載的軟體包是mariadb-server-10.0
.
當我嘗試使用以下方法清除它:
sudo apt-get purge mariadb-server-10.0
我得到這個輸出:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
libdbi-perl libterm-readkey-perl
Use 'apt-get autoremove' to remove them.
The following packages will be REMOVED:
mariadb-server-10.0*
0 upgraded, 0 newly installed, 1 to remove and 1 not upgraded.
1 not fully installed or removed.
After this operation, 74.5 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 50%
(Reading database ... 460851 files and directories currently installed.)
Removing mariadb-server-10.0 (10.0.23-0ubuntu0.15.04.1) ...
Failed to stop mysql.service: Unit mysql.service not loaded.
invoke-rc.d: initscript mysql, action "stop" failed.
dpkg: error processing package mariadb-server-10.0 (--purge):
subprocess installed pre-removal script returned error exit status 5
Failed to stop mysql.service: Unit mysql.service not loaded.
invoke-rc.d: initscript mysql, action "stop" failed.
Failed to start mysql.service: Unit mysql.service failed to load: No such file or directory.
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error while cleaning up:
subprocess installed post-installation script returned error exit status 6
Errors were encountered while processing:
mariadb-server-10.0
E: Sub-process /usr/bin/dpkg returned an error code (1)
我應該如何繼續嘗試解決此問題?謝謝
答案1
MariaDB 是 MySQL 的開源版本(沒有任何父級 Oracle 的麻煩)。你需要從MariaDB的安裝日誌中找到MySQL安裝在哪裡(可能在/etc/init.d下)然後停止它
sudo /etc/init.d/mysql stop
完成後,請執行您嘗試執行的相同操作。