1

linux noob here. Been trying to setup git and having some difficulty setting up a repository and linking it to git hub. But that is another issue. while trying to figure this out I used the following commands one after another at various times to try and install the correct packages I need

apt-get install git
apt-get install git-core

and finally

apt-get install git-all

While running the last command I received the following error

 E: Sub-process /usr/bin/dpkg returned an error code (1)

I have searched the site to try and find a solution but it seems to be case dependent so I ran

sudo apt-get install -f

and got the following output

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer     required:
linux-headers-4.4.0-31 linux-headers-4.4.0-31-generic linux-headers- 4.4.0-38
linux-headers-4.4.0-38-generic linux-image-4.4.0-31-generic
linux-image-4.4.0-38-generic linux-image-extra-4.4.0-31-generic
linux-image-extra-4.4.0-38-generic
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 45 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
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 it 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)

Can someone tell me which file is causing the error and how I can fix it. Also some details as to why this happens or any useful info would be greatly appreciated. Thanks

muru
  • 207,228

2 Answers2

0

it's not a rare problem, the problem is runit package, try this simple solution:

$ 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

Edit: Upstart no longer supported in latest Ubuntu versions. If for some reason anyone really wants to run with upstart they can install this: sudo apt install upstart-sysv

elichai2
  • 691
  • 6
  • 14
0

After a little research I discovered the bug has something to do with the fact that ubuntu 16.4.1 no longer runs Upstart. (Turns out the question has been answered already so appologies for that) Versions from ubuntu 15 onwards use systemd. Answer in the link below. Thanks to all who posted solutions

Failed to connect to socket /com/ubuntu/upstart: Connection refused: Errors were encountered while processing: runit