我希望完全删除服务器上与mysql相关的任何包。但我似乎无法完成这一任务。APT似乎无法理解mysql-server没有安装在服务器上。是否可以手动告诉apt一个包被删除了?
╭─root@home /etc/apt
╰─➤ apt-get remove mysql-server-core-5.5
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
mysql-server-5.5 : Depends: mysql-client-5.5 (>= 5.5.54-0+deb8u1) but it is not going to be installed
Depends: mysql-server-core-5.5 (>= 5.5.54-0+deb8u1) but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).我也试过“清洗”
╭─root@home /etc/apt
╰─➤ apt-get purge mysql-server-core-5.5 100 ↵
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
mysql-server-5.5 : Depends: mysql-client-5.5 (>= 5.5.54-0+deb8u1) but it is not going to be installed
Depends: mysql-server-core-5.5 (>= 5.5.54-0+deb8u1) but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).运行apt -f安装不会解决任何问题。
dpkg: error processing package mysql-server-5.5 (--configure):
subprocess installed post-installation script returned error exit status 6
Processing triggers for libc-bin (2.19-18+deb8u7) ...
Errors were encountered while processing:
mysql-server-5.5
E: Sub-process /usr/bin/dpkg returned an error code (1)运行apt-get安装mysql-服务器-5.5-重新安装两者都不使用。
╭─root@home /etc/apt
╰─➤ apt-get install mysql-server-5.5 --reinstall 100 ↵
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
E: Internal Error, No file name for mysql-server-5.5:amd64尝试用dpkg --清除--强制--mysql--社区服务器-- mysql-server-5.5 -server-core-5.5手动删除
╭─root@home /etc/apt
╰─➤ dpkg --purge --force-all mysql-community-server mysql-server-5.5 mysql-server-core-5.5 1 ↵
(Reading database ... 40739 files and directories currently installed.)
Removing mysql-community-server (5.7.17-1debian8) ...
Purging configuration files for mysql-community-server (5.7.17-1debian8) ...
................
dpkg: error processing package mysql-community-server (--purge):
subprocess installed post-removal script returned error exit status 1
Removing mysql-server-5.5 (5.5.54-0+deb8u1) ...
Failed to stop mysql.service: Unit mysql.service not loaded.
invoke-rc.d: initscript mysql, action "stop" failed.
dpkg: error processing package mysql-server-5.5 (--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
dpkg: warning: ignoring request to remove mysql-server-core-5.5 which isn't installed
Errors were encountered while processing:
mysql-community-server
mysql-server-5.5一个接一个地删除包也不起作用,提示我使用“对话框”来设置mysql服务器的根密码。
删除mysql服务器获取删除mysql客户端apt获取删除mysql服务器核心
我会尽我最大的努力来更新这个问题,如你所愿,但我目前正在拔出我的头发。我几乎要重新安装整个服务器了。
发布于 2017-02-22 18:53:19
根据所显示的消息,由于依赖项,apt-get停止,这是正确的行为.否则,模块依赖于包将停止工作。
正确的方法是读取关于依赖于它的模块的消息,然后依次删除它们,直到您耗尽所有模块。
从消息来看,mysql-server需要mysql-server-core。所以你必须按顺序做移除。
sudo apt-get purge mysql-server
sudo apt-get purge mysql-client
sudo apt-get purge mysql-common
# I think when you uninstall mysql-server, it will also remove the core最好的方法是始终使用dpkg -l | grep mysql来检查已安装的相关包。
如果上述所有问题都失败了,请尝试申请答案声明的在这个问题上。尽管如此,一些问题是由于指向过时的debian/ubuntu存储库而引起的,其中包含旧的/修补程序安装脚本,但这是很少见的。
https://serverfault.com/questions/834251
复制相似问题