从那以后,我一直在尝试使用一个名为 topgrade 的软件,但在我的系统上遇到了一些问题,该问题以前运行良好。一开始无法使用命令行启动 vscode code
(即使它已安装并且我可以通过按窗口键并查找它来启动它)然后我发现我的 apt 也坏了。每当我尝试使用 apt 安装任何东西时,它都会卡在
Setting up mysql-server-5.7 (5.7.27-0ubuntu0.16.04.1) ...
insserv: warning: current start runlevel(s) (empty) of script `mysql' overrides LSB defaults (2 3 4 5).
insserv: warning: current stop runlevel(s) (0 1 2 3 4 5 6) of script `mysql' overrides LSB defaults (0 1 6).
因此,我关闭了正在运行安装的终端并尝试将其安装在另一个终端中,但 dpkg 锁定前端错误开始出现,所以我尝试杀死所有 apt 进程并再次运行安装,但 dpkg 锁定错误仍然出现所以我继续删除lock-frontend
文件仍然没有工作
重新启动是否再次尝试 apt install 并且我被要求配置 dpkg 所以我运行sudo dpkg --configure -a
它再次卡在 mysql-server 设置中。
所以我尝试了这篇文章中的解决方案来修复 mysql-server在配置 mysql-server-5.7 时挂起Ubuntu 更新停止
它至少工作 mysql 服务器不再挂起但是当我运行sudo dpkg --configure -a
并得到以下日志https://pastebin.com/nwcAcZW8 现在显示git-daemon-run
错误并且当我尝试运行 apt install 时出现相同的错误
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n]
Setting up runit (2.1.2-3ubuntu1) ...
start: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused
dpkg: error processing package runit (--configure):
subprocess installed post-installation script returned error exit status 1
No apport report written because the error message indicates its a followup error from a previous failure.
dpkg: dependency problems prevent configuration of git-daemon-run:
git-daemon-run depends on runit; however:
Package runit is not configured yet.
dpkg: error processing package git-daemon-run (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
runit
git-daemon-run
E: Sub-process /usr/bin/dpkg returned an error code (1)
sudo apt-get purge runit
sudo apt-get autoremove
sudo apt update
sudo apt install runit
所以我清除了runit并尝试再次安装它并出现以下错误
The following NEW packages will be installed:
fgetty runit
0 upgraded, 2 newly installed, 0 to remove and 205 not upgraded.
Need to get 121 kB of archives.
After this operation, 567 kB of additional disk space will be used.
Do you want to continue? [Y/n]
Get:1 http://it-mirrors.evowise.com/ubuntu xenial/universe amd64 fgetty amd64 0.7-1 [18.9 kB]
Get:2 http://it-mirrors.evowise.com/ubuntu xenial/universe amd64 runit amd64 2.1.2-3ubuntu1 [102 kB]
Fetched 121 kB in 1s (62.8 kB/s)
Selecting previously unselected package fgetty.
(Reading database ... 538427 files and directories currently installed.)
Preparing to unpack .../fgetty_0.7-1_amd64.deb ...
Unpacking fgetty (0.7-1) ...
Selecting previously unselected package runit.
Preparing to unpack .../runit_2.1.2-3ubuntu1_amd64.deb ...
Unpacking runit (2.1.2-3ubuntu1) ...
Processing triggers for man-db (2.7.5-1) ...
Processing triggers for ureadahead (0.100.0-19) ...
ureadahead will be reprofiled on next reboot
Setting up fgetty (0.7-1) ...
Setting up runit (2.1.2-3ubuntu1) ...
start: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused
dpkg: error processing package runit (--configure):
subprocess installed post-installation script returned error exit status 1
Processing triggers for ureadahead (0.100.0-19) ...
Errors were encountered while processing:
runit
E: Sub-process /usr/bin/dpkg returned an error code (1)
更新
我尝试了@karel 在他们的回答中建议的解决方案,当我执行最后一个命令重新安装 runit 时,出现以下错误
start: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused
dpkg: error processing package runit (--configure):
subprocess installed post-installation script returned error exit status 1
Processing triggers for ureadahead (0.100.0-19) ...
Errors were encountered while processing:
runit
E: Sub-process /usr/bin/dpkg returned an error code (1)
要删除
dpkg: error processing package runit (--configure):
错误,请打开终端并键入:上面的命令应该可以消除配置错误,但现在 runit 包会导致
Failed to connect to socket /com/ubuntu/upstart: Connection refused
错误。如果您卸载 runit,它不会破坏 Ubuntu 中的任何核心组件。通过运行强制删除runitsudo dpkg -r runit git-daemon-run
。您可能需要使用其中一个--force-*
选项才能将其删除。