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


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)
share improve this question
 
 
Please post the content of /var/lib/dpkg/info/‌​runit.postrm –  kos  Jul 31 '15 at 8:59 
 

2 Answers

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

share improve this answer
 
 
This answer is easier to follow than the one in the post that this is a duplicate of. –  jlovegren  Jan 21 at 18:34
 
I had this very same issue on Ubuntu 15.10 (Wily), and this answer fixed the problem! Thanks @jlovegren! –  Seann  Feb 7 at 20:13 

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:

aptitude install upstart-sysv
update-initramfs -u
reboot
share improve this answer
 
 
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 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 at 13:50 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值