mysql-server 安装混乱-无法完成安装或卸载

mysql-server 安装混乱-无法完成安装或卸载

安装 mysql-server 时 apt-get 卡住了。我不知道为什么,但它就是停止工作,再也没有继续。我不得不在安装过程中重新启动机器。

现在,如果我尝试安装或清除 mysql-server 包,apt-get 会首先尝试配置 mysql-server(告诉我它在此之前尚未安装)并取消并显示错误消息:

Sub-process /usr/bin/dpkg returned an error code(1)

apt-get 还告诉我有两个包未成功安装或删除。

这是完整的控制台输出:

christian@devbox:~$ sudo apt-get install mysql-server
[sudo] password for christian: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
mysql-server is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 17 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue [Y/n]? y
Setting up mysql-server-5.5 (5.5.32-0ubuntu7) ...
start: Job failed to start
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error processing mysql-server-5.5 (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of mysql-server:
 mysql-server depends on mysql-server-5.5; however:
  Package mysql-server-5.5 is not configured yet.

dpkg: error processing mysql-server (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                                          Errors were encountered while processing:
 mysql-server-5.5
 mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
christian@devbox:~$ 

答案1

我不知道为什么实际的包会有错误所以我建议强制通过 dpkg 进行安装。

sudo dpkg -i --force-all package.deb

您可以在 /var/cache/apt/archives/ 中找到实际的包

相关内容