×


Restart Bluetooth in Ubuntu 20.04 - How to do it ?

Sometimes, Linux users might need to use the Bluetooth headset to view Netflix and YouTube clips whilst running Ubuntu Linux. Bluetooth is enabled via the interplay of several packages including Bluez, drivers, the Linux kernel as well as client programs. When terminating the entire system, one could have issues with Bluetooth communication. You might believe that the only way to get the Bluetooth connection to function is to reboot the complete system. You will not be able to use these techniques with Ubuntu. 

Here at Ibmi Media, as part of our Server Management Services, we regularly help our Customers to perform related Linux System related queries.

In this context, we shall look into ways to restart Bluetooth in Ubuntu.


How to Install Bluetooth Tools and Packages ?

To begin, ensure you have Bluetooth service configured within the Ubuntu 20.04 system. If you don't have it, try to install it with the "bluez" package. So, we have been using the apt package to install Bluetooth all tools in a single command as below. Add the password upon request and press "Enter":

$ sudo apt-get install bluez*

You will prompted a question from a user if they want to configure Bluetooth on their machine or not. As we want to install it, hence we will tap "y", otherwise will proceed with tapping "n" to quit it.

Once the installation of Blueetooth is completed, you need to activate and configure it. Next thing is to add the sudo user passcode to configure it upon required:

$ sudo modprobe btusb 


How to Enable Bluetooth Service ?

Now the Bluetooth has been successfully installed and configured, you need to check the status of the Bluetooth service first within the Ubuntu system. For that purpose, we will be using the very familiar "systemctl" command in shell with sudo rights utilizing the keyword "status" along with the name of service e.g. Bluetooth. We have found that the service is currently disabled and inactive as per the below snap:

$ sudo systemctl status bluetooth.service

To enable the service in our system, we will be replacing the above query with the keyword "enable" instead of "status" and executed in our shell. It will synchronize the configured Bluetooth service on our system with system script files:

$ sudo systemctl enable bluetooth.service

To make the enabled service start in our system, we have been using the same instruction while replacing the keyword "enable" with "restart". This will restart make it active:

$ sudo systemctl restart bluetooth.service

Whenever we check the status of the Bluetooth service once again, we found that it is now active and running properly without an error as per the below snapshot:

$ sudo systemctl status bluetooth.service


How to Restart Bluetooth Service ?

To make the Bluetooth service restart, we need to first stop this service. For that, we will be using the same syntax of the systemctl command while using the "stop" keyword at the place of "status":

$ sudo systemctl stop bluetooth.service

To restart the Bluetooth service, we need to enable it first as we did before. Hence, we have been using the same systemctl command with a one word change e.g. enable:

$ sudo systemctl enable bluetooth.service

When you check the status of a Bluetooth service, you will find it inactive because we haven't restarted the service yet:

$ sudo systemctl status bluetooth.service

So, one needs to restart the Bluetooth service to make it active and running. So we have executed the query below:

$ sudo systemctl restart bluetooth.service

After this command, when we have checked the status of the Bluetooth service, we found it active and running:

$ sudo systemctl status bluetooth.service


[Need help in Installing Software on Ubuntu Linux System ? We can help you. ]


Conclusion

This article covers methods to install, configure, enable and then restart the Bluetooth service in the Ubuntu system. From time to time when you are using Ubuntu Linux and you want to use your Bluetooth headset to watch Netflix or YouTube videos you may experience some problems with the Bluetooth connection on Linux.


How to fix the issue "Bluetooth isn't available" when you wake up the system ?

When you put your system to sleep, there are chances Bluetooth won’t be available when you wake it up. In order to make everything work fine as before in most cases you will need to restart the system.

In order to fix this issue, we need to launch the Terminal and check whether we have the 4.48 version of Bluez. You can easily do that with this command:

$ dpkg --status bluez | grep '^Version:'

When you see the results, use the following commands to update to the latest version:

$ sudo add-apt-repository ppa:bluetooth/bluez
$ sudo apt-get update

After these commands, you will be able to update the Buez using:

$ sudo apt upgrade


How to fix the issue "Bluetooth headset won't play in A2DP (High Fidelity)" ?

In order to fix this issue, you will need to make your system detect the right type of Bluetooth device by adding a simple configuration file.

1. First, let's check whether we have all the dependencies installed:

$ sudo apt install pulseaudio pulseaudio-utils pavucontrol pulseaudio-module-bluetooth

2. When we verify it, we need to create or edit this audio config file:

$ sudo gedit /etc/bluetooth/audio.conf

Then, Include the next lines:

This section contains general options
[General]
Enable=Source,Sink,Media,Socket

3. Finally, save the file and start the Bluetooth service again:

$ sudo service bluetooth restart