在dist将Ubuntu升级到Ubuntu20.04之后,mysql无法工作。我试图删除它,我的目标是重新安装它。问题是我无法删除mysql-server-8.0:
sudo dpkg -r --force-all mysql-server-8.0
(Reading database ... 210243 files and directories currently installed.)
Removing mysql-server-8.0 (8.0.28-0ubuntu0.20.04.3) ...
Failed to stop mysql.service: Unit mysql.service not loaded.
invoke-rc.d: initscript mysql, action "stop" failed.
dpkg: error processing package mysql-server-8.0 (--remove):
installed mysql-server-8.0 package pre-removal script subprocess returned error exit status 1
Failed to stop mysql.service: Unit mysql.service not loaded.
invoke-rc.d: initscript mysql, action "stop" failed.
Failed to preset unit: File mysql.service: Link has been severed
/usr/bin/deb-systemd-helper: error: systemctl preset failed on mysql.service: No such file or directory
Failed to start mysql.service: Unit mysql.service not found.
invoke-rc.d: initscript mysql, action "start" failed.
Unit mysql.service could not be found.
dpkg: error while cleaning up:
installed mysql-server-8.0 package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
mysql-server-8.0
openhabvm@OpenHABVM:~$ sudo dpkg -r --force-all mysql-server-8.0
(Reading database ... 210243 files and directories currently installed.)
Removing mysql-server-8.0 (8.0.28-0ubuntu0.20.04.3) ...
Failed to stop mysql.service: Unit mysql.service not loaded.
invoke-rc.d: initscript mysql, action "stop" failed.
dpkg: error processing package mysql-server-8.0 (--remove):
installed mysql-server-8.0 package pre-removal script subprocess returned error exit status 1
Failed to stop mysql.service: Unit mysql.service not loaded.
invoke-rc.d: initscript mysql, action "stop" failed.
Failed to preset unit: File mysql.service: Link has been severed
/usr/bin/deb-systemd-helper: error: systemctl preset failed on mysql.service: No such file or directory
Failed to start mysql.service: Unit mysql.service not found.
invoke-rc.d: initscript mysql, action "start" failed.
Unit mysql.service could not be found.
dpkg: error while cleaning up:
installed mysql-server-8.0 package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
mysql-server-8.0发布于 2023-02-25 08:46:18
在从Ubuntu 20.04切换到22.04之后,我遇到了同样的问题(即无法安装mariadb-server或mysql-server),并且能够通过删除以下内容,然后重复安装过程来解决这个问题:
试试这个,看看它是否适合你。
https://askubuntu.com/questions/1391952
复制相似问题