问题安装包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但没有提到它的解决方案为我工作。 关于我如何从这里开始的任何想法?

我发现这是一个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樱桃挑选你真正需要的包并安装它们。

摆脱runit和git-daemon-run。 请改为安装git-daemon-sysvinit。 git-daemon-sysvinit是git-daemon-run的替代品,它实际上适用于Ubuntu 15.04及更高版本。

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

尝试在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上面的两篇文章写了这段代码。它为我工作!