问题描述
我无法想象改变我的蓝牙设备名称的方法。
有什么命令吗?
最佳解决办法
您不能在ubuntu中的控制面板中更改蓝牙设备名称。这里是bug report,它提供了这个解决方法:
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
之后,重新启动蓝牙服务:
sudo service bluetooth restart
或重新启动。
次佳解决办法
看起来这个选项已从蓝牙控制面板中删除,但您仍然可以通过命令行更改名称:
sudo hciconfig hci0 name 'Device Name'
一旦运行该命令,您应该能够通过重新启动蓝牙控制面板并检查设备名称来验证更改。
第三种解决办法
我做了什么(12.04):
设备名称存储在/var/lib/bluetooth/XX:XX:XX:XX:XX:XX/config中
删除它
重新启动(~# service bluetooth restart)
设备名称在配置中被重写(根据/etc/bluetooth/main.conf?)
第四种办法
我正在使用Blueman蓝牙管理器。有一个选项可以在以下位置更改计算机的BT名称:
适配器→参数
第五种办法
要在Ubuntu 14.04或更高版本上永久更改蓝牙主机名,请执行以下操作:
使用CTRL打开终端 – ALT – T
用你想要的计算机名称编辑/etc/bluetooth/main.conf来替换”%h”。出于某种原因,”%h”似乎总是代表我的系统上的”ubuntu”。 gksudo gedit /etc/bluetooth/main.conf例如,将Name = %h-%d更改为Name = gruber-%d`
删除/var /lib /bluetooth /xx:xx:xx:xx:xx:xx /config使您的系统忘记旧名称。 xx:xx:xx:xx:xx:xx具有您的蓝牙硬件独有的十六进制值。 sudo rm /var/lib/bluetooth/xx:xx:xx:xx:xx:xx/config
重新启动蓝牙服务sudo service bluetooth restart(15.04以下:) sudo systemctl restart bluetooth.service
您可以通过打开蓝牙设置来检查新名称。最后两步来自马克思的答案。
第六种办法
您可以通过以下方式更改PC的蓝牙:
打开终端类型:
sudo gedit /var/lib/bluetooth/XX:XX:XX:XX:XX:XX/config
如果要求输入密码,请输入密码(您不会看到)
gedit将会打开该文件。
以”name”开头的行替换名称本身。它不会是瞬间的!您必须重新启动服务(或PC)。通过键入:
sudo service bluetooth restart
它为我工作。
参考资料