How to fix Bluetooth connection issues on Ubuntu 22.04

If you’ve landed here, chances are you’re experiencing some Bluetooth issues on Ubuntu 22.04. It can be frustrating when devices won’t pair, connections keep dropping, or Bluetooth just refuses to cooperate.

In this guide, I’ll guide you through the common troubleshooting steps I’ve used to get Bluetooth working smoothly on Ubuntu systems.

We’ll cover everything from basic service checks and enabling Bluetooth correctly, to diving a bit deeper into kernel modules and configuration files. Let’s get your Bluetooth devices back online.

The Bluetooth troubleshooting steps will be covered in this article.

Read: How to Fix WIFI not working on Ubuntu 22.04

Checking and Enabling the Bluetooth Service

First things first, let’s ensure the core Bluetooth service, which handles all background processing, is running. Ubuntu uses `systemd` to manage services, so we can use the `systemctl` command for this.

Open your terminal and check the status:

sudo systemctl status bluetooth.service

If you see something like “inactive (dead)” as shown above, that’s our first problem! The service isn’t running. It might also be disabled, meaning it won’t start automatically when you boot your computer. Let’s fix that. First, enable the service so it starts on boot:

sudo systemctl enable bluetooth.service

Now that it’s set to start automatically in the future, let’s kickstart it for the current session:

sudo systemctl start bluetooth.service

After running these, you can check the status again using the first command. Hopefully, it now shows “active (running)”.

Read: Troubleshooting Audio Issues (Crackling, No Sound) on Ubuntu 24.04 with PipeWire

Restarting Bluetooth and Managing Kernel Modules

Sometimes, even if the service is running, it might get stuck or encounter an internal error. A quick restart can often clear things up.

Try restarting the Bluetooth service directly:

sudo service bluetooth restart

If restarting the service doesn’t solve the connection woes, the issue might lie deeper, potentially with the kernel module responsible for handling your Bluetooth hardware (often USB-based adapters). The primary module for this is usually btusb. We might need to reload it.

Let’s try removing the module first (this unloads the driver):

sudo rmmod btusb

Sometimes, you might hit an error like: modprobe: ERROR: could not insert 'btusb': Exec format error. This usually means the currently loaded module might be corrupt or incompatible (perhaps after a kernel update). Fixing this involves rebuilding the module from the kernel headers.

Here’s a step-by-step process I’ve used to resolve this:

  1. Identify your kernel version’s module directory. The path depends on your specific kernel. You can find your kernel version with uname -r.
  2. For example, if it’s `5.19.0-32-generic`, the relevant directory might be inside `/lib/modules/5.19.0-32-generic/kernel/drivers/bluetooth`. You’ll need to navigate to this specific `bluetooth` directory in your terminal. Let’s assume you are in the correct parent directory (`/lib/modules/$(uname -r)/kernel/drivers/`). Change into the `bluetooth` directory:
    cd bluetooth

    (Note: You might need `sudo` or root privileges to navigate and modify files here).

  3. Clean the previous build environment (run this command from *within* the `bluetooth` directory identified above):
    sudo make -C /lib/modules/$(uname -r)/build M=$(pwd) clean
  4. Copy necessary configuration files from your kernel headers source:
    sudo cp /usr/src/linux-headers-$(uname -r)/.config ./
    sudo cp /usr/src/linux-headers-$(uname -r)/Module.symvers Module.symvers
  5. Build the kernel modules for the current directory:
    sudo make -C /lib/modules/$(uname -r)/build M=$(pwd) modules
  6. Copy the newly built `btusb.ko` file to the correct kernel module location:
    sudo cp btusb.ko /lib/modules/$(uname -r)/kernel/drivers/bluetooth
  7. Now, try unloading and reloading the module again:
    sudo modprobe -r btusb  # Remove the (potentially old/bad) module
    sudo modprobe -v btusb  # Load the newly compiled module verbosely

After successfully completing these steps (especially steps 6), try running the removal command again just to confirm it works without error (though you just reloaded it, so this isn’t strictly necessary unless you were testing the fix):

sudo rmmod btusb

And then make sure it’s loaded for use:

sudo modprobe -v btusb

Finally, double-check that the main Bluetooth service is running:

sudo systemctl status bluetooth.service

Read: How to fix high memory usage in Ubuntu

If it stopped during the module reload, start it again:

sudo systemctl start bluetooth.service

Fine-Tuning Ubuntu 22.04 Bluetooth Settings 

Ubuntu’s Bluetooth behavior can be tweaked through a configuration file located at /etc/bluetooth/main.conf. You might want to adjust a few settings here for better usability. You’ll need root privileges to edit it. I usually use `nano`:

sudo nano /etc/bluetooth/main.conf

This command opens the configuration file in the nano text editor.

Ensuring Bluetooth Starts Automatically

Scroll towards the end of the main.conf file.

Look for the AutoEnable parameter. Make sure this line is set to true and is not commented out (meaning it shouldn’t start with a # symbol).

# Ensure this line looks like this:
AutoEnable=true

Setting AutoEnable=true tells your system to switch on the Bluetooth adapter automatically every time you start Ubuntu. This also helps your system be discoverable or connect to known devices upon boot.

Enable Faster Connections (Optional)

If you find reconnecting devices after waking your computer from sleep or hibernation is slow, you can try enabling the FastConnectable option. Change its setting to true:

# Change this line:
FastConnectable = true

Note: This feature generally requires Linux kernel version 4.1 or newer (which Ubuntu 22.04 easily meets). Be aware that enabling this might slightly increase power consumption, as the adapter may remain more active.

Enable Automatic Reconnection Attempts

To avoid manually reconnecting devices every time the link drops momentarily, you can instruct the Bluetooth service to automatically try reconnecting. Find the line #ReconnectAttempts=7. Uncomment it by removing the #:

# Uncomment and optionally adjust the number of attempts:
ReconnectAttempts=7

With this enabled, your system will try (by default, 7 times) to re-establish connections with paired devices that disconnect unexpectedly.

After making any changes to main.conf, save the file (Ctrl+O in nano, then Enter) and exit (Ctrl+X). For the changes to take effect, it’s best to restart the Bluetooth service:

sudo systemctl restart bluetooth.service

When All Else Fails: Reinstalling the Bluetooth Stack

If you’ve tried everything above and Bluetooth is still acting up, sometimes the core Bluetooth software package itself, known as Bluez, might be corrupted or experiencing issues. Bluez is the official Linux Bluetooth protocol stack used not just in Ubuntu, but also in distributions like Debian and Kali Linux.

You can try reinstalling it using `apt`. This will fetch the latest version available in your configured repositories and set it up again.

sudo apt update  # Optional, but good practice to update package lists first
sudo apt install --reinstall bluez

Alternatively, just `sudo apt install bluez` often works to ensure the latest version is installed correctly.

Read: How to Display Your Graphics Card Information on Ubuntu 24.04

Final Checks After Reinstallation or Major Changes

After reinstalling Bluez or making significant changes like rebuilding kernel modules, it’s crucial to ensure the service is enabled and started correctly:

sudo systemctl enable bluetooth.service
sudo systemctl start bluetooth.service

And one last tip: If persistent problems remain, especially after system updates, make sure your entire system is up-to-date. Sometimes fixes for hardware drivers or related packages come through standard system updates.

sudo apt update && sudo apt upgrade -y

A system reboot after major changes or updates is also often a good idea.

Conclusion

Dealing with Bluetooth connectivity issues on Ubuntu 22.04 can test your patience, but as we’ve seen, there are several reliable methods to tackle these problems. From ensuring the service is running and configured correctly to reloading kernel modules or even reinstalling the Bluez stack, these steps should help you overcome most common obstacles.

Remember, keeping your system updated is key to avoiding compatibility issues down the line. Hopefully, the tips shared here help you achieve stable and seamless Bluetooth connections on your Ubuntu machine.


If you like the content, we would appreciate your support by buying us a coffee. Thank you so much for your visit and support.

 

Ziad AlNahdy

Ziad holds a degree in software development and has a strong passion for all things tech-related, especially gadgets with screens. Though he is nostalgic for older phone models, he's a retired gamer and continues to enjoy programming in open-source environments. Additionally, Ziad enjoys writing about Linux, macOS and Windows and has experience designing web pages.

Leave a Reply