无法在 Ubuntu 22.04 上激活蓝牙

无法在 Ubuntu 22.04 上激活蓝牙

我已按照在线说明安装了 Bluez,以便与 Cambridge Silicon Radio, Ltd 蓝牙适配器(HCI 模式)配合使用。我知道适配器可以正常工作,因为它非常适合我的 Windows 设备。

当我跑步时,lsusb我可以看到我的蓝牙适配器。

Bus 001 Device 003: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)

当我跑步时systemctl start bluetooth

Failed to start bluetooth.service: Unit bluetooth.service failed to load properly, please adjust/correct and reload service manager: File exists
See system logs and 'systemctl status bluetooth.service' for details.

当我跑步时systemctl status bluetooth.service

○ bluetooth.service - Bluetooth service
     Loaded: error (Reason: Unit bluetooth.service failed to load properly, please adjust/correct and reload service manager: File exists)
     Active: inactive (dead)
       Docs: man:bluetoothd(8)
bluetooth.service: Two services allocated for the same bus name org.bluez, refusing operation.

我尝试使用以下方法删除 BlueZ,但没有成功sudo apt remove bluez pulseaudio-module-bluetooth blueman

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package 'blueman' is not installed, so not removed
Package 'pulseaudio-module-bluetooth' is not installed, so not removed
The following packages will be REMOVED:
  bluez
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 3,759 kB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 1257563 files and directories currently installed.)
Removing bluez (5.64-0ubuntu1) ...
Failed to stop bluetooth.service: Unit bluetooth.service not loaded.
invoke-rc.d: initscript bluetooth, action "stop" failed.
dpkg: error processing package bluez (--remove):
 installed bluez package pre-removal script subprocess returned error exit status 1
dpkg: too many errors, stopping
Failed to start bluetooth.service: Unit bluetooth.service failed to load properly, please adjust/correct and reload service manager: File exists
See system logs and 'systemctl status bluetooth.service' for details.
invoke-rc.d: initscript bluetooth, action "start" failed.
○ bluetooth.service - Bluetooth service
     Loaded: error (Reason: Unit bluetooth.service failed to load properly, please adjust/correct and reload service manager: File exists)
     Active: inactive (dead)
       Docs: man:bluetoothd(8)

bluetooth.service: Two services allocated for the same bus name org.bluez, refusing operation.

sudo dpkg -r --force-all bluez

(Reading database ... 1257563 files and directories currently installed.)
Removing bluez (5.64-0ubuntu1) ...
Failed to stop bluetooth.service: Unit bluetooth.service not loaded.
invoke-rc.d: initscript bluetooth, action "stop" failed.
dpkg: error processing package bluez (--remove):
 installed bluez package pre-removal script subprocess returned error exit status 1
Failed to start bluetooth.service: Unit bluetooth.service failed to load properly, please adjust/correct and reload service manager: File exists
See system logs and 'systemctl status bluetooth.service' for details.
invoke-rc.d: initscript bluetooth, action "start" failed.
○ bluetooth.service - Bluetooth service
     Loaded: error (Reason: Unit bluetooth.service failed to load properly, please adjust/correct and reload service manager: File exists)
     Active: inactive (dead)
       Docs: man:bluetoothd(8)

bluetooth.service: Two services allocated for the same bus name org.bluez, refusing operation.
dpkg: error while cleaning up:
 installed bluez package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 bluez

最后systemctl restart bluetooth.service也没起作用

Failed to restart bluetooth.service: Unit bluetooth.service failed to load properly, please adjust/correct and reload service manager: File exists
See system logs and 'systemctl status bluetooth.service' for details.

我总体来说非常困惑。

答案1

  1. 重启蓝牙服务:
sudo systemctl restart bluetooth
  1. 安装蓝牙管理器(可选):
sudo apt-get install blueman
  1. 更新您的系统:
sudo apt-get update

sudo apt-get upgrade
  1. 检查蓝牙状态:
rfkill list
  1. 重置蓝牙设置:
sudo rm -r /var/lib/bluetooth/
sudo systemctl restart bluetooth
  1. 验证蓝牙模块:
lsmod | grep bluetooth
  1. 检查日志中的错误:
journalctl | grep -i bluetooth

笔记:如果这些步骤都不能解决问题,则可能存在硬件兼容性问题,或者您的系统可能存在更具体的问题。

答案2

snapbluez使用相同的 DBus 名称。如果与 Debian 软件包同时安装,bluez则会引起此类冲突。

检查 snap 是否已经安装:

snap list bluez

如果是,则删除它:

sudo snap remove bluez

然后启动失败的蓝牙服务:

sudo systemctl restart bluetooth

相关内容