88

I just can't figure a way to change my Bluetooth device name.

Is there any command?

Daniel
  • 1,288
Newbi
  • 2,219

12 Answers12

89

It seems the option was removed from the Bluetooth control panel, but you should still be able to change the name via the command line:

sudo hciconfig hci0 name 'Device Name'

Once you run the command, you should be able to verify the change by bringing up the Bluetooth control panel again and checking the device name.

74

You can't change bluetooth device name from control panel in ubuntu yet. Here is the bug report, which provides this workaround:

If you want to change the bluetooth device name permanently, you have to create a file called /etc/machine-info which should have the following content:

PRETTY_HOSTNAME=device-name

After this, restart the Bluetooth service:

sudo service bluetooth restart

Or reboot.

Daniel
  • 1,288
subhajit
  • 1,006
  • 8
  • 10
23

What I did (on 12.04):

  1. device name is stored in /var/lib/bluetooth/XX:XX:XX:XX:XX:XX/config
  2. delete it
  3. restart (~# service bluetooth restart)
  4. device name is rewritten in config (according to /etc/bluetooth/main.conf ?)
Marx
  • 231
  • 2
  • 2
7

I am using Blueman Bluetooth Manager. There is an option to change a computer's BT name in:

Adapter → Parameters

user.dz
  • 49,176
6

To change the bluetooth host name permanently, on Ubuntu 14.04 or later:

Open a terminal with CTRL-ALT-T

  1. Edit /etc/bluetooth/main.conf replacing "%h" with the computer name you want. "%h" always seems to represent "ubuntu" on my systems for some reason.

    gksudo gedit /etc/bluetooth/main.conf

    For example change Name = %h-%d to Name = gruber-%d `

  2. Remove /var/lib/bluetooth/xx:xx:xx:xx:xx:xx/config to make your system forget the old name. The xx:xx:xx:xx:xx:xx has a hexadecimal value unique to your bluetooth hardware.

    sudo rm /var/lib/bluetooth/xx:xx:xx:xx:xx:xx/config

  3. Restart the bluetooth service

    sudo service bluetooth restart

    (Under 15.04 or later:)

    sudo systemctl restart bluetooth.service

You can check the new name by opening the Bluetooth settings. The last two steps are from Marx's answer.

John S Gruber
  • 13,436
3

The default Bluetooth package (bluez) comes with a command-line utility bluetoothctl that can set/reset the broadcast name (the "controller alias").

To change the broadcast name to new-name:

bluetoothctl system-alias new-name

To remove the alias, setting the broadcast name back to your computer's name:

bluetoothctl reset-alias

This will modify the appropriate settings in /var/lib/bluetooth automatically. MakeUseOf has a nice introduction on what you can do with bluetoothctl.

2

You can change the name of a bluetooth remote device on your PC :

  1. check the MAC adress of the device in the bluetooth settings. It looks:

    XX:XX:XX:XX:XX:XX
    
  2. open the Terminal and type:

    sudo gedit /var/lib/bluetooth/XX:XX:XX:XX:XX:XX/config/info
    
  3. if it asks for the password, type it (you won't see it)

  4. the gedit will open up with that file.
  5. modify (only) the value corresponding to 'Name'

    Name=modified_name_as_you_like_it
    

The change will not be instantaneous !

  1. Restart the service (or the PC), using the command:

    sudo service bluetooth restart
    
1

On Ubuntu 20.04 you can do this from the settings.

Settings > About > Device Name

Reboot your computer for the changes to take effect.

1

On Ubuntu 24.04. See this answer: Changing bluetooth device name

In summary:

bluetoothctl has a prompt that is accessed simply by running the command.
Its commands can also be used without accessing the prompt, but that way there is no autocompletion.

There is a distinction between external devices (mouse, keyboard, gamepad, etc.), and the host controllers (built-in BT card, external USB BT adapter, etc.).

With bluetoothctl is possible to change both device and controller alias, the process can be summed up in 3 steps:

  • list the available controller/devices
  • select the controller/device to modify
  • modify the controller/device

The commands are:

Controller

  • run bluetoothctl to access its prompt
  • run list to list the available controllers
    • in my case I only have 1 controller, my laptop's BT card
  • run select 00:11:22:33:44:55 to select the controller to modify
    • the address can be autocompleted with TAB, in my case is the only 1 address available
  • run system-alias "new alias for my BT controller" to modify the controller alias

Device

  • run bluetoothctl to access its prompt
  • run devices to list the available devices
    • the output can be filtered by using optional properties, for example devices Connected
  • run connect AA:BB:CC:DD:EE:FF to select the devices to modify
    • the address can be autocompleted with TAB
  • run set-alias "new alias for my BT device" to modify the device alias
stenix
  • 371
0

In Ubuntu 20.10 look at

sudo grep Alias /var/lib/bluetooth/*/settings

edit the value Alias with

sudo gedit /var/lib/bluetooth/*/settings

For example call it NewDeviceName@yourdomain.net

Then call

sudo hciconfig hci0 name 'NewDeviceName@yourdomain.net'`

No need for reboot or bluetooth restart.

Alternatively you can do this from the settings:

Settings -> Info -> Gerätename

I guess in english it is:

Settings -> About -> Device Name
rubo77
  • 34,024
  • 52
  • 172
  • 299
0

In Ubuntu 22.04, the following GUI option allows renaming in the Bluetooth Manager:

  1. Bluetooth Manager
  2. Right click on BT device
  3. Rename device
  4. Enter new name
moo
  • 966
dbt
  • 21
0
sudo apt-get update; sudo apt-get install -y nano
sudo nano /var/lib/bluetooth/*/config
sudo service bluetooth restart

Update the value for “name”. In my case, it was: Ubuntu-0