How to install a missing firmware on Linux Ubuntu or Debian
Sometimes, you would to use an external peripheral device, like a Wi-Fi USB adapter, but you can’t because you have a missing firmware. If it happens, simply do the following steps:
- Connect your peripheral device to your computer.
- Run this command:
sudo dmesg
Normally, it will print some errors in red like that:
[ 8445.450562] usb 7-4: firmware: failed to load rtlwifi/rtl8192cufw_TMSC.bin (-2)
[ 8445.450568] usb 7-4: Direct firmware load for rtlwifi/rtl8192cufw_TMSC.bin failed with error -2
[ 8445.450579] usb 7-4: firmware: failed to load rtlwifi/rtl8192cufw.bin (-2)
[ 8445.450581] usb 7-4: Direct firmware load for rtlwifi/rtl8192cufw.bin failed with error -2
[ 8445.450583] rtlwifi: Loading alternative firmware rtlwifi/rtl8192cufw.bin
Now, we know that our missing firmware is “rtl8192cufw.bin”.
3. Find the package
Missing firmwares are often non-free
, so unless you are sure that it’s not the case, add them in your /etc/apt/sources.list
:
deb http://deb.debian.org/debian stretch main contrib non-free
deb-src http://deb.debian.org/debian stretch main contrib non-free
deb http://security.debian.org/debian-security/ stretch/updates main
deb-src http://security.debian.org/debian-security/ stretch/updates main
deb http://deb.debian.org/debian stretch-updates main
deb-src http://deb.debian.org/debian stretch-updates main
The file of the firmware should be in an package of the Debian repository. So we can find it like that:
$ sudo apt-cache search rtl8192cufw.bin
firmware-realtek - Binary firmware for Realtek wired/wifi/BT adapters
EDIT : apt-cache
doesn’t always find packages containing a file. Now I use apt-file
:
$ sudo apt install apt-file
$ sudo apt-file update # update apt-file database
$ apt-file find rtl8192cufw.bin
firmware-realtek: /lib/firmware/rtlwifi/rtl8192cufw.bin
Sometimes, you don’t find a package like that. When it happens, go to Google and paste your missing firmware followed by “debian”, for example:
rtl8192cufw.bin debian
Then you should find something.
4 . Install it
Now, we can simply install the package like this:
sudo apt-get install firmware-realtek
Note that you maybe have to restart your computer.
That’s all!