"Unable to connect to Upstart" error when installing git-all

I am using 15.04.

So I'm working with git and I installed the standard version. I set up the ssh keys and was able to clone one of my repositories to the correct folder. Everything was working great and then I decided it was a good idea to install more packages. I ran sudo apt-get install git-all. I'm looking at error codes now having to deal with upstart.

start: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused
No apport report written because the error message indicates its a followup error from a previous failure.
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
Errors were encountered while processing:
 runit
 git-daemon-run
E: Sub-process /usr/bin/dpkg returned an error code (1)

This is what happens when I even update/upgrade my system. At this point all I'm looking to do is be able to install software and update my current software. Is there any way I can potentially reverse this issue or at least correct it?

Edit: Thankfully this issue was solved only a day or two after it happened. The accepted answer worked perfectly and took care of my issue


Solution 1:

It's happening because of this bug https://bugs.launchpad.net/ubuntu/+source/runit/+bug/1448164

You need to remove runit and git-daemon-run. That should fix the problem.

sudo apt-get purge runit git-daemon-run

Don't forget to visit the bug report and clicking Yes, this bug affects me.

git-all without error

It seems you can have git-all with daemon support without failing on this error. git-all recommends either git-daemon-run or git-daemon-sysvinit package. apt was choosing git-daemon-run as first choice. But If you explicitly mention the package you want (i.e git-daemon-sysvinit), apt won't try to install git-daemon-run.

All you need to do is

sudo apt-get install git-all git-daemon-sysvinit

Hope that helps.

Solution 2:

You'll need to forcibly remove runit. Running sudo dpkg -r runit should work. You might need to use one of the --force-* options.

Solution 3:

Try:

sudo apt update 
sudo apt --purge remove git 
sudo apt install git

instead.