您的位置:首页 > 大数据 > 人工智能

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

2016-08-17 11:02 1276 查看



up
vote2down
votefavorite
1

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)


15.04 dpkg upstart runit
shareimprove
this question
edited Jul
31 '15 at 9:35





Ron
8,11131937

asked Jul 31 '15 at 8:15





Pei JIA
1615

 
 
Please post the content of 
/var/lib/dpkg/info/‌​runit.postrm
 – kos Jul
31 '15 at 8:59 
 
possible duplicate of vivid
- failed to connect to upstart: connection refused – Ron Jul
31 '15 at 9:15
add
a comment


2 Answers

activeoldestvotes

up vote5down
vote
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


shareimprove
this answer
answered Aug 25 '15 at 18:06





Kevin Hunter Kesling
511

 
 
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 
add
a comment
up vote0down
vote
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


shareimprove
this answer
edited Mar
21 at 20:12

answered Mar 21 at 17:57





hryamzik
62

 
 
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 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐