用 bluetoothctl 配对并连接蓝牙耳机

在终端用 bluetoothctl 扫描、配对、信任并连接蓝牙耳机或音箱,音频由 PulseAudio 或 PipeWire 自动接管。

Linux硬件音频蓝牙低风险
运行 `bluetoothctl scan on` 找到耳机 MAC 地址,然后 `bluetoothctl pair XX:...:XX && bluetoothctl trust XX:...:XX && bluetoothctl connect XX:...:XX`。

01命令

命令
$ bluetoothctl power on && bluetoothctl scan on && bluetoothctl devices && bluetoothctl connect XX:XX:XX:XX:XX:XX

02作用说明

扫描会一直进行,输入 `scan off` 停止;耳机需处于配对模式才会出现在列表中。`trust` 让耳机下次自动回连,连接成功后 PulseAudio/PipeWire 会自动把声音输出切到耳机。这些命令可以在交互界面里逐条执行,也可以用 && 串起来写成脚本。

03风险

风险低风险
使用条件bluez (bluetoothctl, preinstalled on most desktop distros), a Bluetooth adapter, and bluetoothd running. Pairing for a new device is interactive: `bluetoothctl pair XX:XX:XX:XX:XX:XX`.
!注意: 连接反复失败时,耳机可能正被手机占用,先在手机上断开。使用 LDAC/aptX 编解码的耳机需要 PipeWire 或相应的 PulseAudio 模块才会作为音频输出出现。

04撤销

撤销
$ bluetoothctl disconnect XX:XX:XX:XX:XX:XX

05来源

  • Bluetooth headset - ArchWiki
    Arch Linux Wiki · technical · 2026-09-17
    依据: Shows the bluetoothctl pairing workflow for headsets: scan, pair, trust and connect, and mentions audio profile requirements.
  • bluetoothctl(1) — Arch manual page
    Arch Linux · technical · 2026-09-17
    依据: bluetoothctl is the interactive control utility of bluez, supporting power on, scan on, pair, trust, connect and disconnect commands for Bluetooth devices.

最后验证: 2026-09-18 · 分类: 系统与设置

06相关方案