Loading...
X

How to turn off Bluetooth to disable pairing and any connections

How to permanently disable Bluetooth on Linux

This note shows how to remove the bluetooth completely, as well as exclude any possibility of connecting it.

Start by deactivating and uninstalling the bluetooth service.

Remove from startup and stop the bluetooth service:

sudo systemctl disable bluetooth
sudo systemctl stop bluetooth

Remove the bluez package.

On Debian and derivatives:

sudo apt remove bluez

On Arch Linux and derivatives:

sudo pacman -R bluez

The bluetooth kernel module is included in the kernel, so removing packages like bluez and blueman may not completely solve the problem of disabling Bluetooth – if you remove these packages, you will not have tools and graphical applets for monitoring Bluetooth, but this does not mean that at the kernel level Bluetooth devices (such as a Bluetooth USB dongle) will not connect, or peripherals will not pair.

To disable Bluetooth, we will use disabling the kernel module, which is described in the section “Modules blacklisting”.

See also: Linux kernel modules

As you can see, the blueman applet, and therefore Bluetooth, is working.

To disable bluetooth module create /etc/modprobe.d/blacklist.conf file:

sudo gedit /etc/modprobe.d/blacklist.conf

and copy the following into it:

blacklist bluetooth
install bluetooth /bin/true

Restart your computer for the changes to take effect.

As you can see, Bluetooth is no longer working:

How to turn off Bluetooth until next reboot

To temporarily unload (turn off) the module, run the command:

sudo modprobe -r bluetooth

You may encounter an error:

modprobe: FATAL: Module bluetooth is in use.

If the previous command fails, then try the following alternative:

sudo rmmod bluetooth

Output example:

rmmod: ERROR: Module bluetooth is in use by: btrtl btintel btbcm bnep btusb rfcomm

As you can see, the program failed again, but displayed a list of modules that use the bluetooth kernel module and, therefore, which make it impossible to disable bluetooth.

Let's try to unload all these modules:

sudo rmmod bluetooth btrtl btintel btbcm bnep btusb rfcomm

In my case, executing the command several times in a row unloaded almost all modules and Bluetooth was turned off.

Bluetooth disconnected in this way will work again after reboot.


Leave Your Observation

Your email address will not be published. Required fields are marked *