14

This question already has an answer here:

I'm using Ubuntu 15.04. Whenever I tried to install any package, I got the error message in the title. How can I get rid of this annoying error message?

:~$ uname -a
Linux LongerVision001 3.19.0-25-generic #26-Ubuntu SMP Fri Jul 24 21:17:31 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 15.04
Release:        15.04
Codename:       vivid
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 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
Errors were encountered while processing:
 runit
E: Sub-process /usr/bin/dpkg returned an error code (1)

marked as duplicate by jokerdino Sep 4 '16 at 12:49

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • Please post the content of /var/lib/dpkg/info/runit.postrm – kos Jul 31 '15 at 8:59
  • The official ubuntu package as for now (Nov 2016) doesn't work in ubuntu 16.04. I got it working with a test build released more then a year ago (I'm not aware of any other more recent ones what a shame) goo.gl/92V9eU – diramazioni Dec 3 '16 at 16:27
19

I've encountered the same error. Reading the error message, it appears that the runit install script expects upstart at one point, but my system (and I suspect yours) is running systemd. Notably, I've another machine that did not have this error during installation; the only substantive difference is that the erroring machine was an upgrade from 14.10, while the the "just works" machine was a fresh install.

As Vivid is not an LTS, I submit that one could edit the post installation dpkg file to get this back on track. (This trick should also work for LTS installations as well, but hopefully would be a non-issue).

When dpkg errors out with

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
Processing triggers for ureadahead (0.100.0-19) ...
Errors were encountered while processing:
 runit
E: Sub-process /usr/bin/dpkg returned an error code (1)

it will have left the runit package in an semi-installed state. You should find a runit.postinst file in /var/lib/dpkg/info/. This file is executed as part of the post-installation details for the runit package (mainly for starting up runit immediately after installation, as opposed to waiting until next system boot). The error is that the script appears to forget the exclusive nature of systemd/upstart. Since you're clearly not running upstart, comment out the relevant lines (lines 58 - 60 on my install, currently).

Before:

if [ -x /sbin/start ]; then #provided by upstart
  /sbin/start runsvdir
fi

After:

#if [ -x /sbin/start ]; then #provided by upstart
#  /sbin/start runsvdir
#fi

When you've saved that change, you can tell apt to finish where it left off and you should be good to go:

$ sudo apt-get install -f

  • 3
    This answer is easier to follow than the one in the post that this is a duplicate of. – jlovegren Jan 21 '16 at 18:34
  • 1
    I had this very same issue on Ubuntu 15.10 (Wily), and this answer fixed the problem! Thanks @jlovegren! – Seann Feb 7 '16 at 20:13
  • 1
    It helped me for the same problem on Ubuntu 16.04 (I just installed git-all and reproduced this). – kinORnirvana Nov 17 '16 at 9:29
  • sorry i didn't understand, which is the file that i should uncomment?? @MohammadArman – Zeno Raiser Mar 23 '18 at 9:23
  • @ZenoRaiser, at first open the ruint.postinst file. Did you find the mentioned file? You will find it in /var/lib/dpkg/info/ directory. Open the file (runit.postinst) and comment out 3 lines by adding # in the beginning. As mentioned in the answer's "After" section. Make sense? – Mohammad Arman Mar 23 '18 at 16:53
5

Just purge upstart, it's broken anyway.

UPD: runit seems to be incompatible with systemd on ubuntu, that could be a surprise after reboot, runit will just fail saying it's not pid 1:

- runit: fatal: must be run as process no 1.

So the other way is to switch to upstart:

sudo aptitude install upstart-sysv
sudo update-initramfs -u
sudo reboot
  • Well, currently I'm back to Ubuntu 14.04.4 LTS, there seems to be NO package named "upstart-sysv", but ONLY "upstart"? – Pei JIA Mar 24 '16 at 17:15
  • Well, the upstart-sysv is for ubuntu systems that moved to systemd: wiki.ubuntu.com/SystemdForUpstartUsers And runit seem to be broken in 16.04 with both upstart and systemd. – hryamzik Mar 27 '16 at 13:50
  • Oh my you saved me with this. I thought I was going to have to wipe the whole server and start over. Much, much appreciated. – Carl Aug 3 '17 at 21:53

Not the answer you're looking for? Browse other questions tagged or ask your own question.