16

Whenever I turn my bluetooth off from the settings menu, it's back on after reboot. I know this has already been asked but I've tried all answers that have been provided and nothing seems to work.

The most popular suggestion is: Run sudoedit /etc/rc.local and add this before line with exit 0:

rfkill block bluetooth

When I do this, an empty file opens up and it's not even rc.local if I'm correct. (see screenshot). I'm running Ubuntu 18.04 LTS.

Screenshot

If I run ls -l /etc/rc.local this comes up:

Screenshot2

If I run: sudo rfkill list all:

Screenshot3

I've tried everything in this link except installing BUM: How can I deactivate Bluetooth on system startup?

Lucy C
  • 455

7 Answers7

19

I've tested this and it's persistent across reboots.

Click the bluetooth logo between the keyboard and battery icons on the system tray. Then click the "Bluetooth ON" selection and it changes to "Bluetooth OFF":

bluetooth off.gif


After comments I discovered that Ubuntu 18.04 with Gnome interface doesn't work like Ubuntu 16.04 with Unity interface.

The solution is to edit /etc/default/tlp and find:

# Radio devices to disable on startup: bluetooth, wifi, wwan.
# Separate multiple devices with spaces.
#DEVICES_TO_DISABLE_ON_STARTUP="bluetooth wifi wwan"

Edit the last line to read:

DEVICES_TO_DISABLE_ON_STARTUP="bluetooth"
  • 3
    I'm gonna assume you really did think I haven't tried the most basic solution. When I do this, the bluetooth is back on after reboot. – Lucy C Jun 17 '18 at 22:53
  • @LucyC I just noticed from your screenshots you don't even have the bluetooth icon in systray. Furthermore you are using Gnome interface and not Unity 16.04 interface like me. Are you using Ubuntu 18.04? – WinEunuuchs2Unix Jun 17 '18 at 23:04
  • I'm running Ubuntu 18.04 LTS. My bluetooth icon can be found in the dropdown settings menu as shown here: [https://ibb.co/h5pmaJ] – Lucy C Jun 17 '18 at 23:09
  • @LucyC I'll reboot using Ubuntu 18.04 LTS with default Gnome interface and check it out. – WinEunuuchs2Unix Jun 17 '18 at 23:10
  • @LucyC After rebooting into Ubuntu 18.40 I was shocked to learn under the Gnome interface the setting isn't retained. On searching for a solution I found a duplicate question with an accepted answer so voted to close your question as a duplicate. So now I'll boot back into 16.04 which just works :) – WinEunuuchs2Unix Jun 17 '18 at 23:20
  • As I stated in my question, I've tried all other solutions given in other posts and they won't work for me- That's why I decided to create my own post :/ – Lucy C Jun 17 '18 at 23:26
  • Try this solution to remove bluetooth applet from startup applications. I just started the Sherlock Holmes movie and don't feel like rebooting into Ubuntu 18.40 hell again :p https://ubuntu-mate.community/t/turn-off-bluetooth-by-default/12979 – WinEunuuchs2Unix Jun 17 '18 at 23:32
  • I took me a while to realize I hadn't edited the tlp configurations files correctly. I had written #DEVICES_TO_DISABLE_ON_STARTUP="bluetooth". Removing the # did the trick. THANK YOU! btw, why "ubuntu 18.04 hell". I'm a beginner to this so may be, if you could explain to me why I shouldn't be running it, it would be awesome. Can we chat? – Lucy C Jun 17 '18 at 23:41
  • This does not work on Ubuntu 19.10 on a Thinkpad. – Lexible Feb 10 '20 at 03:24
  • In 2023, this file is /etc/tlp.conf OS: Devuan 5 – vrgovinda Nov 30 '23 at 21:05
  • @vrgovinda "Version 5 of systemd-free Debian remix Devuan" is severely off-topic here in *Ask Ubuntu*. That said, I hope it serves you well. – WinEunuuchs2Unix Dec 02 '23 at 02:38
  • @WinEunuuchs2Unix I agree with you. Isn't it the same in Ubuntu as well? – vrgovinda Dec 03 '23 at 16:32
  • @vrgovinda I don't know. I believe Ubuntu is exclusively systemd these days and the old init days are history. Either way only a software engineered that scoured source code and compared the OS could tell you if they are the same. – WinEunuuchs2Unix Dec 03 '23 at 23:29
6

Well, I have a suggession. I think most of the people will try to make the devices to remember the state of the previous shutdown. Thus if wifi/bluetooth is turned off/on before the previous shutdown, then after rebooting, wifi/bluetooth remains off/on according the previous state.

To do this, go to the file /etc/default/tlp and search for the line

RESTORE_DEVICE_STATE_ON_STARTUP=0

This is set as "0" by default, which means that remembering the state of radio is disabled by default. To make it remember the previous state, replace "0" with "1". If you set this as "1", the lines after that will not be read by the system.

If you specifically wants to set some radio to be on or off at start up, then follow the lines

#DEVICES_TO_DISABLE_ON_STARTUP="bluetooth wifi wwan"

and

#DEVICES_TO_ENABLE_ON_STARTUP="bluetooth wifi wwan"

and remove the '#' to activate any of those line. And you can choose between bluetooth/wifi/wwan or all of them.

Do as you need.

Surajit
  • 101
6

I work under Xubuntu 18.04. Here is a solution that finally worked for me.

  1. First, I edited the file /etc/bluetooth/main.conf (under sudo mode enabled). At the very end of the file, I changed the line AutoEnable=true to AutoEnable=false

  2. Second, I went to the main menu, then picked Settings > Session and Startup. In the Applications autostart section I disabled Blueman applet (see line 2 in the picture below).

Blueman applet disabled in 'Session and Startup'

  1. After reboot, the Blueman applet icon is no longer visible in the system tray but if you enter rfkill list all in the terminal, you see the following:

1: phy0: Wireless LAN Soft blocked: no Hard blocked: no 2: dell-wifi: Wireless LAN Soft blocked: no Hard blocked: no 3: dell-bluetooth: Bluetooth Soft blocked: yes Hard blocked: no 4: hci0: Bluetooth Soft blocked: yes Hard blocked: no

Which means that the Bluetooth is now off. The key to the problem, it seems, is ridiculously simple. Any attempt to switch the Blueman applet on also switches on the Bluetooth no matter what happened before. So, no Blueman applet, no more Bluetooth on boot. At least, for me.

6

With ubuntu 18.04 gnome this worked for me:

sudo systemctl disable bluetooth.service

then after reboot try to check:

sudo systemctl status bluetooth.service

And if you want to enable it again:

sudo systemctl enable bluetooth.service
nicanz
  • 161
1

I have a workaround for your case...

I'm using Ubuntu Mate 18.04, in my case I just click on "MENU/Preferences/Startup Applications". A window called "Startup Applications Preferences" pops up. Find the entry called "Blueman Applet" and remove the tick/tag from it so that it becomes disabled (grayed out). As a result, all the applications related with Bluetooth will not load the next time(s) you boot up your system.

The annoying part is that you will have to reverse this procedure and reboot to get bluetooth back to work in case you need it.

Hope this helps JaMedSyS

JamMedSyS
  • 11
  • 4
1

For ubuntu 18.04. touching files like turn it off if you use blueman as a bluetooth application. For this I go to this location with a file browser executed with superuser permissions:

/usr/bin/

and I edit the file called:

"Blueman-applet"

Within this file there is written a line that says:

self.Plugins.Run(“on_manager_state_changed”, True)

You just have to change true to false and it would stay like this:

self.Plugins.Run ("on_manager_state_changed", False)
0

I'm running Ubuntu 18.04.2 "bionic" with KDE (so kubuntu 18.04.2) and all I did was issue:

sudo rfkill block bluetooth

It does not enable itself after a reboot. To enable, all I do is go into bluetooth settings and tick the checkbox "Enable Bluetooth Integration".

00fruX
  • 1,271
  • 1
  • 16
  • 32