Register now for better personalized quote!

When Bluetooth on Linux fails, this command can come to the rescue. Here's how to set it up

Dec, 05, 2023 Hi-network.com
Kelly Cheng Travel Photography/Getty Images

I recently received a pair of speakers to review that promised to be quite good (they are impressive and the review is coming soon). However, fairly soon into the setup, the headphones posed a problem.

Before I continue, let me first explain that I have a complex setup. Being an audiophile, I listen to a lot of vinyl. I also listen to a good amount of music via streaming services. Mostly, I use Spotify to find new artists, and I will then purchase vinyl albums of the music. Also, given how much time I spend in my office and at my desk, the system I use to listen to music isn't 100% audiophile-grade. That issue is partly due to the makeup of my office and also the presence of cats, who would happily murder floor-standing speakers.

Also: How to vastly improve sound on Linux with EasyEffects

My old speakers had both AUX and line-in inputs, which allowed me to plug my turntable into AUX and my PC into line-in. Those two inputs served me well. However, the new speakers had an RCA line-in and a 3.5mm line-in. Obviously, I couldn't use both inputs and expect the system to work. Out of curiosity, I tried -- and the RCA input was always hijacked by the 3.5mm input, so that was a no-go.

Fortunately, the new speakers included Bluetooth support. It's, therefore, a good thing my System76 Thelio desktop computer included Bluetooth, which meant everything should have been a simple matter of connecting the speakers via Bluetooth and using that connection as a means to listen to digital audio from the computer.

Also: How to improve the quality of Spotify streaming audio

However, I immediately ran into a problem. When I opened Bluetooth Settings and switched the speakers on, Ubuntu Budgie couldn't find any devices to connect with. Bluetooth was seemingly broken.

The good news is I'm using Linux -- and there's always a fix at the ready. This time around, the fix came by way of thebluetoothctlcommand. I'm going to show you how this tool works.

How to install bluez

What you'll need:To make this feature work, you'll need a machine that includes a Bluetooth option and a user with sudo privileges (for the installation of bluez, which provides thebluetoothctlcommand).

1. Open a terminal window

The first thing to do is open a terminal window, so you can install Bluez. You should find the terminal window app in your desktop menu.

2. Install Bluez

How you install Bluez will depend on the distribution you use. Here's a quick list of the commands for various distributions:

Debian/Ubuntu - sudo apt-get install bluez -yFeodra - sudo dnf install bluez -yArch Linux - sudo pacman -S bluez-utils

Using bluetoothctl

1. Start and enable bluetoothctl

Before you can use thebluetoothctlcommand, you must start and enable it with:

sudo systemctl enable --now bluetoothctl

2. Scan for nearby devices

Next, we're going to use thebluetoothctlcommand to scan for nearby devices. That command is:

bluetoothctl scan on

At this point, you should be able to go back to your distribution's Bluetooth GUI tool and see that it's finally discovered all available devices. You can then select the device you want to connect to via the GUI -- and everything should just work.

Also: Love listening to records? This simple, sound-enhancing gadget is a must-have

This workaround isn't the ideal solution, but when you find Bluetooth is being a bit problematic, it's one way I've found that rarely fails me.

Linux

The best Linux laptops for consumers and developersWant to save your aging computer? Try these 5 Linux distributionsThe best distros for beginnersHow to enable Linux on your Chromebook (and why you should)
  • The best Linux laptops for consumers and developers
  • Want to save your aging computer? Try these 5 Linux distributions
  • The best distros for beginners
  • How to enable Linux on your Chromebook (and why you should)

tag-icon Hot Tags : Tech Services & Software Operating Systems

Copyright © 2014-2024 Hi-Network.com | HAILIAN TECHNOLOGY CO., LIMITED | All Rights Reserved.