Although Ubuntu Linux is a stable and robust operating system, sometimes Bluetooth connections with external devices do not work properly.

If you have been using Bluetooth devices on your computer, you might have noticed that you need to reconnect your Bluetooth devices whenever the computer wakes up from sleep or hibernation. And that's just one problem to speak of.

This guide will show you how to fix common Bluetooth connectivity issues on Ubuntu Linux so that you do not have to reconnect Bluetooth devices whenever you want to work on your PC.

Enabling the Bluetooth Service

In Ubuntu Linux, there is a Bluetooth service that runs in the background to ensure that your Bluetooth system works perfectly. Here is how you can check whether the Bluetooth service is running.

        sudo systemctl status bluetooth.service
    
checking bluetooth service status

The output above shows that the Bluetooth service is active. But if the Bluetooth status is inactive, for some reason, make sure to enable it so that it starts automatically whenever the system boots. You can do the same using the command below.

        sudo systemctl enable bluetooth.service
    

After enabling the Bluetooth service, start the service again using systemctl.

        sudo systemctl start bluetooth.service
    

Configuring Bluetooth on Ubuntu

On Ubuntu Linux, the /etc/bluetooth/main.conf file stores most of the Bluetooth configurations. There are a few parameters to configure in the file. You can open the configuration file with your favorite text editor. In this guide, we will be using vim.

        sudo vim /etc/bluetooth/main.conf
    

Auto-Enable Bluetooth

Make sure that the AutoEnable configuration at the very bottom of the configuration file is set to true and not commented out. All lines that start with the Pound character (#) are comments. To uncomment a line, you need to delete # from the beginning.

The AutoEnable configuration makes sure that the Bluetooth module is enabled whenever your device restarts. In addition, it allows your Bluetooth adapter to recognize newly connected Bluetooth devices around you.

bluetooth config file showing bluetooth is autoenabled

Enable Reconnect Attempt

You can configure the Bluetooth stack so that it tries to reconnect whenever a Bluetooth device and your computer lose the connection. To do so, just uncomment the line ReconnectAttempts=7 in the configuration file.

Instead of trying to re-connect to devices manually, your Bluetooth service will now try to reconnect to all the Bluetooth devices whose link has been broken.

Enable Fast Connect

Another configuration you should enable is FastConnectable. By setting this value to true you ensure that Bluetooth devices are able to connect to your PC much faster in case of a reboot or hibernation.

bluetooth fast connect

The FastConnectable feature only works if you have kernel 4.1 or newer. The major setback with the fast connectable feature is that it consumes more power on your PC.

If you are using vim, press the Esc key after making all the changes. Then, save the changes and quit the file by typing :wq.

Reinstalling the Bluetooth Stack

As a last resort action, you can reinstall Bluez, the official and default Bluetooth software protocol on Ubuntu Linux and most Linux distros. This guide will use APT for installing the software.

        sudo apt install bluez
    

After re-installing the Bluetooth stack, make sure you enable and start the Bluetooth service using the commands below.

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

Related: How to Use APT and Say Goodbye to APT-GET in Ubuntu

Adding Bluetooth to Your Linux PC

If you're facing connectivity issues on your Linux machine, you might have to make some changes to the Bluetooth service. More people are now using Bluetooth devices such as keyboards, mice, and headphones on their PC.

If you have a computer that does not have Bluetooth built-in, there are a few workarounds that you can implement to connect Bluetooth devices to your system.