2

When I run sudo apt upgrade on my Ubuntu MATE 20.04, I get the following:

[various stuff]
Do you want to continue? [Y/n] y
Setting up bluez (5.53-0ubuntu3.7) ...
Failed to restart bluetooth.service: Unit bluetooth.service failed to load properly: File exists.
See system logs and 'systemctl status bluetooth.service' for details.
invoke-rc.d: initscript bluetooth, action "restart" failed.
● bluetooth.service - Bluetooth service
     Loaded: error (Reason: Unit bluetooth.service failed to load properly: File exists.)
     Active: inactive (dead)
       Docs: man:bluetoothd(8)
Dec 20 14:30:21 ada systemd[1]: bluetooth.service: Two services allocated for the same bus name org.bluez, refusing operation.
[Above error appears 9 more times]
dpkg: error processing package bluez (--configure):
 installed bluez package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 bluez
E: Sub-process /usr/bin/dpkg returned an error code (1)
karel
  • 122,292
  • 133
  • 301
  • 332

2 Answers2

2

I could solve this by moving the snap.bluez file asociated with the bus name.

sudo mv /etc/systemd/system/snap.bluez.bluez.service ~/Desktop/

and then:

sudo reboot

how did I arrive to this solucion? just check the content for the files

/etc/systemd/system/snap.bluez.bluez.service

and

/etc/systemd/system/dbus-org.bluez.service

in the section "[Service]" you can find the "BusName" property with the value "org.bluez" in both files.

0

I had the same error logged as in the title "Two services...org.bluez", found using the following commands, when trying to enable bluetooth that I had disabled in the GUI to save laptop battery power:

$ systemctl status bluetooth.service  
$ journalctl | grep -i bluetooth

Having tried advice from other threads about bluetooth not starting (it would try to turn on, but go back to being inactive with $systemctl enable/restart bluetooth and rfkill block/unblock bluetooth etc.

Solution:

 sudo apt remove bluetooth blueman bluez // remove what might be doubled up
 systemctl status bluetooth.service // check status
 sudo systemctl daemon-reload // 
 journalctl | grep -i bluetooth // check the log again
 sudo systemctl enable bluetooth //
 sudo apt install blueman // see note [1]

Noticably did not re-install the bluetooth package, it is already there, which is why the error "Two services allocated for the same bus name org.bluez".

I hope this works for someone else it wasn't among any of the solutions I found already in forums, this worked for me through trial and error.

  1. blueman is just a UI, bluetooth can be enabled without it, but you want to install it to have f.eg a taskbar widget.