安装软件包 git-all 时出现问题

安装软件包 git-all 时出现问题

我正在尝试使用以下命令安装 git-all:

sudo apt update
sudo apt install git-all

我得到以下结果:

jonathan@Aristotle:~$ sudo apt install git-all
Reading package lists... Done
Building dependency tree       
Reading state information... Done
git-all is already the newest version (1:2.7.4-0ubuntu1).
0 upgraded, 0 newly installed, 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.
Do you want to continue? [Y/n] y
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
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
No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                                          Errors were encountered while processing:
 runit
 git-daemon-run
E: Sub-process /usr/bin/dpkg returned an error code (1)

我找到了对类似问题的回答: http://askubuntu.com/questions/728581/how-to-fix-error-processing-package-git-daemon-run/728748#728748 但其中提到的解决方案对我都不起作用。有什么想法可以指导我下一步该怎么做吗?

答案1

我发现这是一个 Ubuntu 错误,已报告为 https://bugs.launchpad.net/ubuntu/+source/runit/+bug/1448164。

问题出现的原因在于 runit 依赖 upstart,而 Ubuntu 从 15.04 开始改用 systemd,解决方法如下:

sudo apt-get purge runit
sudo apt-get purge git-all
sudo apt-get purge git
sudo apt-get autoremove
sudo apt update
sudo apt install git

基本上,您完全摆脱了 runit、git-all 和 git,清理 apt 数据库,然后重新安装 git。无需再次安装 git-all,只需挑选您真正需要的软件包并安装它们即可。

答案2

摆脱 runit 和 git-daemon-run。安装 git-daemon-sysvinit。git-daemon-sysvinit 是 git-daemon-run 的替代品,它实际上可以在 Ubuntu 15.04 及更高版本上运行。

一旦安装了 git-daemon-sysvinit,git-all 的依赖关系就应该得到满足,然后您就可以继续了。

答案3

我在尝试在 Ubuntu 16.04 LTS 上安装所有 git 软件包时遇到了同样的问题。我这样做了:

sudo apt-get purge runit
sudo apt-get purge git-all
sudo apt-get purge git
sudo apt-get autoremove
sudo apt update 
sudo apt-get install git-daemon-sysvinit
sudo apt-get install git-all

我根据 Johnathon 和 Stephen 的上述两篇文章编写了这段代码。它对我很有用!

相关内容