安装包 git-all 时出现问题

Jon*_*han 6 apt

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

sudo apt update
sudo apt install git-all
Run Code Online (Sandbox Code Playgroud)

我得到以下结果:

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)
Run Code Online (Sandbox Code Playgroud)

我找到了对类似问题的回答:http : //askubuntu.com/questions/728581/how-to-fix-error-processing-package-git-daemon-run/728748#728748 但没有提到其中的任何解决方案为我工作。关于我如何从这里开始的任何想法?

Jon*_*han 22

我发现这是一个 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
Run Code Online (Sandbox Code Playgroud)

基本上你完全摆脱了runit、git-all和git,清理了apt数据库,然后重新安装git。与其再次安装 git-all,不如选择您实际需要的软件包并安装它们。