I run sudo apt-get install git-all in Ubuntu 16.04 and see the following in the end

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:
E: Sub-process /usr/bin/dpkg returned an error code (1)

I get the error after rebooting my system also. It really blocks my whole system. I run killall update-notifier. I run sudo apt-get install git-all but I get the same error message. I run pgrep -a apt but get nothing as output. I run pgrep -a update but get nothing as output. A bug report about the case here.

  • In Grub, Choose Advanced options > Ubuntu (Upstart) Linux kernel 4.22. Doing the same only in terminal without systemd causes the same error.

Why is this error here with runit?


2 Answers 2


Gerrit Pape, who maintains both xyr own runit and Bernstein's daemontools packages for Debian, is one of the few developers that took the idea of "init-system neutrality" (that was much bandied about after the Debian systemd hoo-hah) really to heart and has tried hard to support running these under van Smoorenburg init, upstart, and systemd.

The post-installation maintainer script for runit you will find unpacked on your system from the package somewhere such as /var/lib/dpkg/info/runit.postinst. As you can see, it tries to detect the presence of upstart and start the runsvdir upstart job if upstart is present. It does the same with systemd and runit.service.

Unfortunately, on Ubuntu 14 and later both systemd and upstart are installed. And so the post-installation maintainer script for the package is trying to run the upstart job with upstart's start command. Of course, upstart isn't (by default) the system-wide service manager in Ubuntu 15 and later, and upstart's start command fails to work.

The following is a rough idea of how to patch the script in order to overcome this:

if test -r /usr/share/debconf/confmodule; then
  . /usr/share/debconf/confmodule

if test -d /run/systemd/system ; then
  systemctl start runit.service
elif test -x /sbin/start ; then
  /sbin/start runsvdir

This is not ideal, but it is a beginning. runit.prerm and runit.postrm likewise require some adjustments.

Further reading

  • I updated the body. I really cannot find a workaround. I have not yet tested your solution because I cannot understand the complete resolution. Can you propose more? This is a fresh Ubuntu installation so it is strange that such a bug is there. Is there any complete workaround for this? Why does the problem occurs? For me, it seems to be a bug in the system, but I would not like to accept it. Commented May 20, 2016 at 20:19
  • I opened a bug report about the case here bugs.launchpad.net/ubuntu/+source/runit/+bug/1584214 Commented May 20, 2016 at 20:38
  • I choose Ubuntu (upstart) in Grub, and I run the apt-get command. I get the same error. Is this startup without systemd really? Commented Jun 1, 2016 at 13:57

I managed to find a temporary solution to the problem. Change the location of source servers, etc from the main server to Finland or to Estonia. It resolves the acute problem for a while.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .