Skip to content

Instantly share code, notes, and snippets.

@jrichardsz
Last active January 14, 2026 19:55
Show Gist options
  • Select an option

  • Save jrichardsz/d0577799438886205f6a1688035570d1 to your computer and use it in GitHub Desktop.

Select an option

Save jrichardsz/d0577799438886205f6a1688035570d1 to your computer and use it in GitHub Desktop.
bluetooth
bluetoothctl
power on
default-agent
scan on

pair XX:XX:XX:XX:XX:XX

Once paired, type 
connect XX:XX:XX:XX:XX:XX

sudo apt update
sudo apt install blueman

connect error: br-connection-profile-unavailable 

sudo apt update
sudo apt install libspa-0.2-bluetooth pipewire-audio-client-libraries
sudo apt install pulseaudio-module-bluetooth
pulseaudio -k
pulseaudio --start

## after

close all
sudo systemctl restart bluetooth
sudo modprobe -r btusb
sudo modprobe btusb


Since you are on Ubuntu, the issue is often that the default Bluetooth settings window doesn't trigger the "scan" correctly, or the Bluetooth service itself is sleeping.

Here is the Linux-specific troubleshooting guide, ranked from "Quick Fix" to "Deep Dive."

1. The "Terminal" Method (Most Reliable)

The graphical interface in Ubuntu can be buggy. The terminal gives you direct control over the radio.

  1. Open your terminal (Ctrl + Alt + T).
  2. Type bluetoothctl and hit Enter. You will enter a special Bluetooth prompt (e.g., [bluetooth]#).
  3. Run these commands in order:
power on
default-agent
scan on

Now, look at your phone. Make sure it is on the Bluetooth settings screen (visible).

  • If you see your phone appear in the terminal:
  • Look for the MAC address (e.g., XX:XX:XX:XX:XX:XX).
  • Type pair XX:XX:XX:XX:XX:XX (replace with your phone's address).
  • Follow the prompts on both screens to confirm the code.
  • Once paired, type connect XX:XX:XX:XX:XX:XX.

2. Check for "Blocks" (RFKill)

Sometimes Ubuntu "soft blocks" Bluetooth to save power, and the GUI switch doesn't actually unblock it.

  1. Run this command:
rfkill list
  1. Look at the section for Bluetooth.
  • If it says Soft blocked: yes, type:
sudo rfkill unblock bluetooth
  • If it says Hard blocked: yes, this means a physical switch or a keyboard key (like Fn + F2 or F12) has turned off the radio. Toggle that key.

3. Restart the Bluetooth Service

If the driver has crashed (common after waking from sleep), restarting the background service fixes it without a reboot.

Run this command:

sudo systemctl restart bluetooth

Wait 5 seconds, then try searching for your phone again.

4. Install a Better Manager (Blueman)

The default GNOME/Ubuntu Bluetooth manager is sometimes too simple and hides errors. Blueman is a more advanced tool that many Ubuntu users prefer.

  1. Install it:
sudo apt update
sudo apt install blueman
  1. Open your app menu and launch "Bluetooth Manager" (not Settings).
  2. Click Search in the toolbar. This tool often finds devices the default settings menu misses.

5. Is the Adapter even detected?

If none of the above works, Ubuntu might not be seeing your Bluetooth hardware at all (common with newer Realtek or Mediatek WiFi cards).

Run this:

lsusb

Look for a line that mentions "Bluetooth," "Realtek," "Intel," or "Qualcomm."

  • If you see it: The hardware is there; it's likely a driver/firmware issue.
  • If you don't see it: Your Bluetooth hardware might be turned off in the computer's BIOS settings.

Next Step: Could you paste the output of rfkill list here? That will tell me immediately if your Bluetooth is blocked or if the system sees it at all.

The error br-connection-profile-unavailable means your laptop and phone have found each other, but your laptop doesn't know what to do with the connection.

Usually, when you connect a phone, the laptop tries to act as a Bluetooth Speaker (Audio Sink) for the phone. If the software that handles Bluetooth Audio isn't installed or running, the connection is instantly rejected with "Profile Unavailable."

Here is how to fix it on Ubuntu.

Step 1: Install the Missing Audio Modules

Ubuntu needs a specific package to handle Bluetooth audio. Open your terminal and run the command that matches your Ubuntu version.

If you are on Ubuntu 23.04, 23.10, or 24.04 (Newer): These versions use PipeWire. Run this command:

sudo apt update
sudo apt install libspa-0.2-bluetooth pipewire-audio-client-libraries

After installing, restart the audio service:

systemctl --user restart wireplumber pipewire pipewire-pulse

If you are on Ubuntu 20.04 or 22.04 (Older): These versions use PulseAudio. Run this command:

sudo apt update
sudo apt install pulseaudio-module-bluetooth

After installing, restart PulseAudio:

pulseaudio -k
pulseaudio --start

Step 2: "Trust" the Device First

Even with the drivers installed, Ubuntu often rejects connections from devices it doesn't "Trust" yet.

Go back to your bluetoothctl terminal and run these commands in this exact order. Replace 1C:64... with your phone's actual address.

  1. Trust the phone:
trust 1C:64:F0:2A:83:AA
  1. Pair (again, just to be safe):
pair 1C:64:F0:2A:83:AA

(Check your phone screen to confirm the code if asked) 3. Connect:

connect 1C:64:F0:2A:83:AA

Step 3: What if it still fails?

If you still see the error, it is likely because your phone is confused.

  1. Forget the device: On your Phone's Bluetooth settings, find your laptop ("Ubuntu") and tap "Forget" or "Unpair."
  2. Remove from laptop: In the terminal, type:
remove 1C:64:F0:2A:83:AA
  1. Restart Bluetooth:
sudo systemctl restart bluetooth
  1. Start fresh: Run scan on and try to pair from the beginning.

One Quick Question: Are you trying to connect the phone to send files, or to play music through your laptop speakers? If you just want to send files, you don't need connect—you can usually just use the "Send File" option in your Bluetooth menu once paired.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment