尝试安装mysql,总是出现以下错误:
处理时遇到错误:/var/cache/apt/archives/mysql-server-5.7_5.7.21-0ubuntu0.17.10.1_amd64.deb E: 子进程 /usr/bin/dpkg 返回错误代码 (1)
全文见下文:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
mailx tinyca
The following NEW packages will be installed:
mysql-server-5.7
0 upgraded, 1 newly installed, 0 to remove and 6 not upgraded.
Need to get 0 B/3,184 kB of archives.
After this operation, 48.3 MB of additional disk space will be used.
Preconfiguring packages ...
(Reading database ... 283762 files and directories currently installed.)
Preparing to unpack .../mysql-server-5.7_5.7.21-0ubuntu0.17.10.1_amd64.deb ...
Failed to stop mysql.service: Unit mysql.service not loaded.
invoke-rc.d: initscript mysql, action "stop" failed.
invoke-rc.d returned 5
There is a MySQL server running, but we failed in our attempts to stop it.
Stop it yourself and try again!
dpkg: error processing archive /var/cache/apt/archives/mysql-server-5.7_5.7.21-0ubuntu0.17.10.1_amd64.deb (--unpack):
subprocess new pre-installation script returned error exit status 1
Errors were encountered while processing:
/var/cache/apt/archives/mysql-server-5.7_5.7.21-0ubuntu0.17.10.1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
我已经尝试过这个解决方案
以及 stackoverflow 上几乎所有可用的解决方案,但它并没有解决我的问题,即使 mysql 服务器也没有完全被sudo apt-get remove --purge mysql-server
. 我必须使用突触管理器将其删除