我无法修复我的 Ubuntu 机器上的损坏软件包。我按照论坛上发布的许多命令操作。但什么也没发生!
存在问题的软件包有:
mysql-server-5.5
mysql-server
有什么办法可以解决吗?我的电脑配置是希腊语,我无法给你一些有用的输出,因为这个问题阻止我更改控制台的语言!谢谢!
好的,这是输出!
unknown@unknown-pc:~$ sudo apt-get install --reinstall mysql-server-5.5 mysql-server-5.5
[sudo] password for unknown:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
tinyca mailx
The following packages will be upgraded:
mysql-server-5.5
1 upgraded, 0 newly installed, 0 to remove and 47 not upgraded.
2 not fully installed or removed.
Need to get 0 B/8746 kB of archives.
After this operation, 0 B of additional disk space will be used.
Preconfiguring packages ...
(Reading database ... 366372 files and directories currently installed.)
Preparing to replace mysql-server-5.5 5.5.31-0ubuntu0.12.04.1 (using .../mysqlserver-5.5_5.5.31-0ubuntu0.12.04.2_i386.deb) ...
invoke-rc.d: unknown initscript, /etc/init.d/mysql not found.
dpkg: warning: subprocess old pre-removal script returned error exit status 100
dpkg - trying script from the new package instead ...
invoke-rc.d: unknown initscript, /etc/init.d/mysql not found.
dpkg: error processing /var/cache/apt/archives/mysql-server-5.5_5.5.31-0ubuntu0.12.04.2_i386.deb (--unpack):
subprocess new pre-removal script returned error exit status 100
No apport report written because MaxReports is reached already
invoke-rc.d: unknown initscript, /etc/init.d/mysql not found.
invoke-rc.d: unknown initscript, /etc/init.d/mysql not found.
dpkg: error while cleaning up:
subprocess installed post-installation script returned error exit status 100
Errors were encountered while processing:
/var/cache/apt/archives/mysql-server-5.5_5.5.31-0ubuntu0.12.04.2_i386.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
未知@未知-pc:~$
答案1
不知何故,您的软件包系统出了问题。显然文件/etc/init.d/mysql
在处理过程中丢失了。添加一个虚拟文件以帮助软件包系统克服丢失:
$ sudo -i
# cat > /etc/init.d/mysql << EOF
> #!/bin/true
> EOF
# chmod 755 /etc/init.d/mysql
...然后删除所有 mysql 包...
# apt-get remove --purge mysql-server-5.5 mysql-server
这应该也会删除虚拟脚本。如果没有,请手动删除它。之后您应该能够再次正常安装 mysql。
答案2
您应该能够通过从终端运行以下命令来修复损坏的软件包:
sudo apt-get -f install