Deactivate Bluetooth at Boot on Ubuntu Laptop

Posted on the 22 May 2010 by Hostingnuggets @hostingnuggets

If you are like me and have a nice netbook or laptop and never use bluetooth simply because you don't have any bluetooth devices, you might just want to turn it off when booting under Linux. My netbook, a wonderful and new Acer Aspire One, unfortunately doesn't have an option to deactivate bluetooth through its BIOS. This means that when the operating system has booted, in my case Ubuntu 10.04 (code name Lucid), you are left with bluetooth turned ON and of course consuming power for nothing... So I always end up manually turning OFF bluetooth either using the hardware switch (which doesn't remember its status after turning off the computer) or deactivating bluetooth through the OS. I tried in vain deactivating the bluetooth service or even blacklisting the bluetooth module but that wouldn't help, bluetooth was still ON.
Luckily, there is a command named rfkill, which nicely let's you control via software all your radio frequency (and hence the rf in rfkill) devices. For example the following command will turn off bluetooth:
/sbin/rfkill block bluetooth

Watch your bluetooth led, it will really turn off. So now, all you need to do in order to get bluetooth deactivated every time you boot, is to run this command automatically. Ubuntu has a file for this purpose and it will be executed at the last stage of its boot process. This file is called:
/etc/rc.local

Simply add the rfkill command mentioned above before the "exit 0", save it, reboot and you will never be bothered again with turning OFF manually your bluetooth device. Of course, this should also work with other Linux distributions but the file to run the command might be named differently or located somewhere else. As Ubuntu is derived from Debian, this will also work for Debian (or any other Debian derivate distribution).