首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法删除Ubuntu 20.04上的mysql-server-8.0

问无法删除Ubuntu 20.04上的mysql-server-8.0
EN

Ask Ubuntu用户
提问于 2022-02-09 13:41:05
回答 1查看 6.7K关注 0票数 2

在dist将Ubuntu升级到Ubuntu20.04之后,mysql无法工作。我试图删除它,我的目标是重新安装它。问题是我无法删除mysql-server-8.0:

代码语言:javascript
复制
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
EN

回答 1

Ask Ubuntu用户

发布于 2023-02-25 08:46:18

在从Ubuntu 20.04切换到22.04之后,我遇到了同样的问题(即无法安装mariadb-server或mysql-server),并且能够通过删除以下内容,然后重复安装过程来解决这个问题:

  1. sudo rm /var/lib/dpkg/info/mysql-server-8.0.postinst
  2. sudo rm /var/lib/dpkg/info/mysql-server-8.0
  3. sudo rm /var/lib/dpkg/info/mysql-server-8.0

试试这个,看看它是否适合你。

票数 0
EN
页面原文内容由Ask Ubuntu提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://askubuntu.com/questions/1391952

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档