dbus install fails if messagebus exists

Von in allgemein

The last time I did an apt-​get upgrade, my Ubun­tu 12.04 ser­ver ran into a nas­ty fail­u­re. During the update pro­cess of the ser­vices dbus and dbus-​x11 the con­so­le repor­ted “addu­ser: The user ‘mess­a­ge­bus’ alrea­dy exists. Exi­t­ing.” fol­lo­wed by some depen­den­cy pro­blems and con­fi­gu­ra­ti­on errors. Some inves­ti­ga­ti­ons later I found the fol­lo­wing working solu­ti­on I want to publish. Plea­se be war­ned that the fol­lo­wing steps might lead to an inac­ces­si­ble and unre­ach­a­ble sys­tem and that you are acting on your own respon­si­bi­li­ty.

First we need to remo­ve the user mess­a­ge­bus, sin­ce the update pro­cess is com­p­lai­ning about an exis­ting one. This will fail, becau­se the user mess­a­ge­bus is in use by the ser­vice dbus. So the first step is to shut down this ser­vice:

user@pc:sudo /etc/init.d/dbus stop

Now we can remo­ve the user:

user@pc:sudo userdel messagebus

As the last step we let the linux sys­tem heal its­elf:

user@pc:sudo dpkg --configure -a

This might show ano­t­her error which can be igno­red. If you do a

user@pc:sudo cat /etc/shadow

the user mess­a­ge­bus should be listed again and a sudo apt-​get upgrade should pass with no fail.