如何解决 16.04 LTS 上安装 Git 时出错的问题

如何解决 16.04 LTS 上安装 Git 时出错的问题

sudo apt-get 安装 git-all

输出结果如下:

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
Setting up libcommon-sense-perl (3.74-1build1) ...
No apport report written because the error message indicates its a followup error from a previous failure.
                          Setting up libtypes-serialiser-perl (1.0-1) ...
Setting up libjson-xs-perl (3.010-2build1) ...
Setting up libpackage-stash-xs-perl (0.28-2build2) ...
Setting up tla-doc (1.3.5+dfsg1-2) ...
Processing triggers for libc-bin (2.23-0ubuntu9) ...
Processing triggers for systemd (229-4ubuntu13) ...
Processing triggers for ureadahead (0.100.0-19) ...
Processing triggers for ufw (0.35-0ubuntu2) ...
Errors were encountered while processing:
 runit
 git-daemon-run
E: Sub-process /usr/bin/dpkg returned an error code (1)

我看见另一个类似的问题并执行以下步骤,

sudo apt-get update --> update package information
sudo apt-get dist-upgrade --> upgrade packages on system
sudo apt-get -f install --> fix broken packages

但它并没有解决问题。git install 还会导致“检测到系统程序问题”弹出窗口。随后是“崩溃报告 = 抱歉,安装软件时出现问题。软件包:runit 2.1.2-3ubuntu1。

答案1

经过进一步的搜索和实验,我发现此程序这为我修复了这个问题:

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

相关内容