故障排除：在 Arch Linux 上启用蓝牙
蓝牙
![](/data/attachment/album/202311/21/201358dz5gex5xu9689kkx.png)



> 
> Arch Linux 上的蓝牙无法工作？以下是对我有用的方法，以及解决 Arch 上蓝牙问题的其它技巧。
> 
> 
> 


[我很轻松地安装了 Arch Linux](https://www.youtube.com/watch?v=WksxVLrALhg)，这要归功于 archinstall 脚本。


在我开始使用它并探索之后，我尝试使用我的蓝牙耳机，却发现蓝牙无法工作。


我可以看到蓝牙选项，但无法启用它。单击开关会只会切换回禁用状态。


下面是我所做的以及有作用的事情。


### 确保蓝牙服务正在运行


如果该服务未运行，蓝牙将不会打开，你将无法连接到它。


检查蓝牙服务的状态并查看其是否正在运行。



```
systemctl status bluetooth

```

它给了我以下输出：



```
[abhishek@itsfoss ~]$ systemctl status bluetooth
○ bluetooth.service - Bluetooth service
        Loaded: loaded (/usr/lib/systemd/system/bluetooth.service; disabled; preset: disabled)
        Active: inactive (dead)
        Docs: man:bluetoothd(8)

```

如你所见，`bluetooth` 服务处于非活动状态。它没有运行。并且状态被禁用。


这意味着蓝牙守护程序当前未运行，也未设置为每次启动时自动启动。


这让事情变得更容易了。我在第一次尝试中就找出了根本原因。在 Arch Linux 中这种情况并不常见。


使用以下命令启动蓝牙守护进程：



```
sudo systemctl start bluetooth

```

让蓝牙服务在系统启动时自动运行：



```
systemctl enable bluetooth

```

它应该显示以下输出：



```
[abhishek@itsfoss ~]$ systemctl enable bluetooth
Created symlink /etc/systemd/system/dbus-org.bluez.service → /usr/lib/systemd/system/bluetooth.service.
Created symlink /etc/systemd/system/bluetooth.target.wants/bluetooth.service → /usr/lib/systemd/system/bluetooth.service.

```

现在，蓝牙已启用，并且在系统设置中很明显：


![](/data/attachment/album/202311/21/201614u6bobweblwb7brlz.png)


### 连接蓝牙设备的提示


你可能已经知道应该首先将蓝牙设备置于配对模式。这很关键。


之后，你可以尝试关闭然后再次打开蓝牙按钮，以便它搜索可用的设备。


如果它没有立即显示，你可以单击其他一些系统设置并再次返回蓝牙。过去它对我有用过几次，不要问为什么。


### 其他故障排除提示


以下是修复 Arch Linux 中蓝牙连接问题的更多提示：


#### 确保未被阻止


确保蓝牙未被阻止：



```
rfkill list

```

检查输出：



```
[abhishek@itsfoss ~]$ rfkill list
0: hci0: Bluetooth
    Soft blocked: no
    Hard blocked: no
1: phy0: Wireless LAN
    Soft blocked: no
    Hard blocked: no

```

如果你发现蓝牙被阻止，请使用以下命令取消阻止：



```
rfkill unblock bluetooth

```

#### Pipewire 与 Pulseaudio


在某些情况下，如果你过去尝试过 Pipewire 和 Pulseaudio，它们可能会破坏工作。


如果你使用 Pipewire，请确保安装了 pipewire-pulse：



```
sudo pacman -Syu pipewire-pulse

```

如果你使用 Pulseaudio，`bluez` 和 `pulseaudio-bluetooth` 可以帮助你。


查看 Arch Wiki 页面以获取更多信息。



> 
> **[蓝牙耳机 - Arch 维基](https://wiki.archlinux.org/favicon.ico)**
> 
> 
> 


### 这对你有用吗？


硬件兼容性问题是任何操作系统都会遇到的问题，Linux 也不例外。


事情没有单一的解决方案。你的系统可能存在与我的系统不同的问题，此处提到的建议可能适合你，也可能不适用于你。


完善的 Arch 维基提供的建议比我所能提供的要多得多。如果你仍然无法解决蓝牙问题，请执行此操作。


现在看你的了。对你有用吗？如果有，是哪种方法？如果没有，你遇到了什么样的问题，以及到目前为止你尝试过哪些故障排除方法？


*（题图：MJ/60bd220b-bb4f-4d51-9c41-162c8c4714b3）*




---


via: <https://itsfoss.com/bluetooth-arch-linux/>


作者：[Abhishek Prakash](https://itsfoss.com/author/abhishek/) 选题：[lujun9972](https://github.com/lujun9972) 译者：[geekpi](https://github.com/geekpi) 校对：[wxy](https://github.com/wxy)


本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译，[Linux中国](https://linux.cn/) 荣誉推出


OK
![Warp Terminal](/assets/images/warp-terminal.webp)


![Warp Terminal](/assets/images/warp-terminal.webp)

So, [I installed Arch Linux quite easily](https://www.youtube.com/watch?v=WksxVLrALhg) thanks to the archinstall script.

After I started using it and exploring it, I tried using my Bluetooth headphones only to notice that the Bluetooth was not working.

I could see the Bluetooth option but I just could not enable it. Clicking the toggle button kept on switching back to disabled.

Bluetooth turn on button not working

Here's what I did and what worked for me.

## Ensure that Bluetooth service is running

If the service is not running, Bluetooth won't be turned on and you won't be able to connect to it.

Check the status of the Bluetooth service and see if it is running or not.

`systemctl status bluetooth`


It gave me the following output:

```
[abhishek@itsfoss ~]$ systemctl status bluetooth
○ bluetooth.service - Bluetooth service
Loaded: loaded (/usr/lib/systemd/system/bluetooth.service; disabled; preset: disabled)
Active: inactive (dead)
Docs: man:bluetoothd(8)
```


As you can see, the `bluetooth`

service is inactive. It is not running. And the state is disabled.

It means that Bluetooth daemon is not running at present and it is also not set to start automatically on each boot.

That made things easier for me. I have identified the root cause in the first attempt. That doesn't happen frequently with Arch Linux.

Start the Bluetooth daemon with:

`sudo systemctl start bluetooth`


Make the Bluetooth service run automatically when the system starts:

`systemctl enable bluetooth`


It should show the following output:

```
[abhishek@itsfoss ~]$ systemctl enable bluetooth
Created symlink /etc/systemd/system/dbus-org.bluez.service → /usr/lib/systemd/system/bluetooth.service.
Created symlink /etc/systemd/system/bluetooth.target.wants/bluetooth.service → /usr/lib/systemd/system/bluetooth.service.
```


Now, the Bluetooth was enabled and it was evident in the system settings:

![Bluetooth working in Arch Linux](https://itsfoss.com/content/images/2023/11/bluetooth-working-arch-linux.png)

## Tip on connecting to a Bluetooth device

You probably already know that you should put your Bluetooth device in pairing mode first. That's critical.

Afterward, you can try toggling the Bluetooth button off and on again so that it searches for available devices.

If it immediately doesn't show, you may click on some other system settings and come back to Bluetooth again. It worked for me several times in the past, don't ask why.

## Other troubleshooting tips

Here are a few more tips on fixing the Bluetooth connection issue in Arch Linux:

### Ensure no blockage

Ensure that Bluetooth is not being blocked:

`rfkill list`


Check the output:

```
[abhishek@itsfoss ~]$ rfkill list
0: hci0: Bluetooth
Soft blocked: no
Hard blocked: no
1: phy0: Wireless LAN
Soft blocked: no
Hard blocked: no
```


If you see Bluetooth being blocked, unblock it with:

`rfkill unblock bluetooth`


### Pipewire vs Pulseaudio

In some cases, Pipewire and Pulseaudio can spoil the game if you experimented with them in the past.

If you are using Pipewire, ensure that you have pipewire-pulse installed:

` sudo pacman -Syu pipewire-pulse`


If you are using Pulseaudio, `bluez`

and `pulseaudio-bluetooth`

could help you.

Check out the Arch Wiki page for more information.

[Bluetooth headset - ArchWiki](https://wiki.archlinux.org/title/bluetooth_headset)![](https://wiki.archlinux.org/images/7/77/Merge-arrows-2.svg)


## Did it work for you?

Hardware compatibility issue is a problem with any operating system and Linux is no exception.

Another thing is that there is no single solution. Your system may have a different problem than mine, and the suggestions mentioned here may or may not work for you.

The magnificent Arch Wiki has a lot more suggestions than what I can offer. Do go through it if you still have not managed to fix your Bluetooth problem.

[Bluetooth - ArchWiki](https://wiki.archlinux.org/title/Bluetooth)![](https://wiki.archlinux.org/images/1/19/Tango-view-fullscreen.svg)


Over to you now. Did it work for you? If yes, which method was it? If not, what kind of problem are you facing and what troubleshooting methods have you tried so far?