Wifi is not working

I’m new to linux. I’ve just migrated from win 8.1 yesterday. I’m using a HP 240 G5 Notebook laptop. I’m using Fedora 34 and i noticed that my wifi is not working. It says “No WiFi adaptor found” in the settings. Plz help!!

Was WiFi working in live mode? It’s always recommended to test WiFi in live mode (since it doesn’t require an installation) so you shouldn’t remove your current operating system unless you’ve already tested hardware compatibility.

However, since you’re beyond that now, that error generally means that the WiFi card isn’t supported. You could try an Ubuntu live session by booting off an Ubuntu USB. I’m not saying you should replace Fedora, but sometimes it helps to compare distros and you can test Ubuntu in live mode without installing it. Test Ubuntu 21.04 and see if WiFi works. If it does work in Ubuntu, then that would tell me that it’s a driver issue for sure.

But also, the output of the lspci command will tell us which WiFi card you have, and without knowing that, there’s not a lot of advice that can be given at the moment. So I recommend comparing Ubuntu, and also providing the output of lspci.

2 Likes

My problem solved. I should have watch the video series you have made on YouTube ( Linux for noobs ) before Installing Fedora, then I never come across this issue atleast. Anyways i learnt a new thing😊, Thanks for helping!!

@jay I’ve been finding a similar problem on Debian after installing it. I’ve installed a non-free version of Debian as advised by you in one of the videos. I’m finding it hard to set up WiFi. It was similar in the live mode too.

The result of the ‘lspci’ command is as follows:

00:00.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Raven/Raven2 Root Complex
00:00.2 IOMMU: Advanced Micro Devices, Inc. [AMD] Raven/Raven2 IOMMU
00:01.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-1fh) PCIe Dummy Host Bridge
00:01.1 PCI bridge: Advanced Micro Devices, Inc. [AMD] Raven/Raven2 PCIe GPP Bridge [6:0]
00:01.2 PCI bridge: Advanced Micro Devices, Inc. [AMD] Raven/Raven2 PCIe GPP Bridge [6:0]
00:01.3 PCI bridge: Advanced Micro Devices, Inc. [AMD] Raven/Raven2 PCIe GPP Bridge [6:0]
00:08.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-1fh) PCIe Dummy Host Bridge
00:08.1 PCI bridge: Advanced Micro Devices, Inc. [AMD] Raven/Raven2 Internal PCIe GPP Bridge 0 to Bus A
00:08.2 PCI bridge: Advanced Micro Devices, Inc. [AMD] Raven/Raven2 Internal PCIe GPP Bridge 0 to Bus B
00:14.0 SMBus: Advanced Micro Devices, Inc. [AMD] FCH SMBus Controller (rev 61)
00:14.3 ISA bridge: Advanced Micro Devices, Inc. [AMD] FCH LPC Bridge (rev 51)
00:18.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Raven/Raven2 Device 24: Function 0
00:18.1 Host bridge: Advanced Micro Devices, Inc. [AMD] Raven/Raven2 Device 24: Function 1
00:18.2 Host bridge: Advanced Micro Devices, Inc. [AMD] Raven/Raven2 Device 24: Function 2
00:18.3 Host bridge: Advanced Micro Devices, Inc. [AMD] Raven/Raven2 Device 24: Function 3
00:18.4 Host bridge: Advanced Micro Devices, Inc. [AMD] Raven/Raven2 Device 24: Function 4
00:18.5 Host bridge: Advanced Micro Devices, Inc. [AMD] Raven/Raven2 Device 24: Function 5
00:18.6 Host bridge: Advanced Micro Devices, Inc. [AMD] Raven/Raven2 Device 24: Function 6
00:18.7 Host bridge: Advanced Micro Devices, Inc. [AMD] Raven/Raven2 Device 24: Function 7
02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 15)
03:00.0 Network controller: Realtek Semiconductor Co., Ltd. RTL8821CE 802.11ac PCIe Wireless Network Adapter
04:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Picasso (rev c2)
04:00.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Raven/Raven2/Fenghuang HDMI/DP Audio Controller
04:00.2 Encryption controller: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 10h-1fh) Platform Security Processor
04:00.3 USB controller: Advanced Micro Devices, Inc. [AMD] Raven USB 3.1
04:00.4 USB controller: Advanced Micro Devices, Inc. [AMD] Raven USB 3.1
04:00.5 Multimedia controller: Advanced Micro Devices, Inc. [AMD] Raven/Raven2/FireFlight/Renoir Audio Processor
04:00.6 Audio device: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 10h-1fh) HD Audio Controller
04:00.7 Non-VGA unclassified device: Advanced Micro Devices, Inc. [AMD] Raven/Raven2/Renoir Non-Sensor Fusion Hub KMDF driver
05:00.0 SATA controller: Advanced Micro Devices, Inc. [AMD] FCH SATA Controller [AHCI mode] (rev 61)

How do I fix this?

03:00.0 Network controller: Realtek Semiconductor Co., Ltd. RTL8821CE 802.11ac PCIe Wireless Network Adapter

That line above is probably your WiFi card. If it is not working in your system, then it’s more than likely the Linux kernel (the heart of the computer that bridges between user interface and the hardware) will need a binary blob. A binary blob is a device driver that the kernel can talk to in order for the binary blob to talk to your WiFi card. Think of it as a “module” that is added to the Linux kernel. You will need to use a terminal in order to perform administrative tasks.

As an administrator (root), open the text editor for /etc/apt/sources.list. If you want to use nano, then open nano as follows:

# nano /etc/apt/sources.list

Or…

$ sudo nano /etc/apt/sources.list

The sudo command will prompt you for your user password. The $ symbol denotes running commands as a user, whereas the # symbol denotes running as root. Enter your password that you logged into your system, not as root. If you get something as follows:

(username) is not in the sudoers file.  This incident will be reported.

Then you need to add sudo to your secondary group. If you know your root password, use the su command to elevate as root, add the sudo group to the secondary group (command below), and then exit out of su prompt.

su
usermod -a -G sudo (username)
exit

(username) is your username. Type in whoami in the terminal and you should see your username.

Also, you might want to use the visudo command to make sure the %sudo line is uncommented. In any configuration files, the comment line begins with #. Look for something that looks like this:

# %sudo   ALL=(ALL:ALL) ALL

If you see a # to the left of %sudo line, remove the # and it should not looks as follows:

%sudo   ALL=(ALL:ALL) ALL

Make sure there’s no leading spaces to the beginning of the line. visudo creates a separate temporary file when you save changes, checks for syntax, and if everything goes well, it will save to /etc/sudoers file. Don’t edit the file by hand; otherwise, you risk getting locked out of using the sudo command when executing commands as root. visudo requires root privileges in order to make changes to /etc/sudoers. I must repeat as a warning. Use visudo instead of editing /etc/sudoers file by hand.

Do:

su # enter root password
visudo # uncomment the %sudo line.
exit # return to normal user mode. Note that "#" as root changes to "$" as a user after you type "exit."

Don’t:

su
nano /etc/sudoers # Don't edit the file by hand. I hope I do not have to repeat this again.
exit

Speaking of checking the syntax, let’s say you have something like mine:

%Administrators ALL=ALL:ALL ALL

You save your changes, exit nano, and now you get something like this:

/etc/sudoers:24:29: syntax error
%Administrators ALL=ALL:ALL ALL
                            ^~~
What now?

Hit ENTER and you will get the list of options:

/etc/sudoers:24:29: syntax error
%Administrators ALL=ALL:ALL ALL
                            ^~~
What now? 
Options are:
  (e)dit sudoers file again
  e(x)it without saving changes to sudoers file
  (Q)uit and save changes to sudoers file (DANGER!)

What now?

Do not hit the “Q” key!!! Any users that are in the sudo/Administrators group (an “Adminstrators” group is from LDAP server, or Lightweight Directory Access Protocol that contains a list of users and groups) that try to authenticate and execute as root temporarily will get locked out of entering sudo commands. Don’t do it. If you want to abort changes, use the X key to exit out and discard changes. Instead, let’s fix it by putting paranthesis as follows. Press the E key to edit the sudoers file again.

%Administrators ALL=(ALL:ALL) ALL

That should work fine, so save your changes and exit. If all goes well, visudo will not complain and return you to the terminal without any harm.

Do remember that anything after # is a command. BASH (Bourne-Again Shell) ignores anything after #.

Once you are done with adding sudo privileges to your user, log out of your desktop environment and log back in. Your changes will take effect the next time you log into your desktop.

By the way, the ALL=(ALL:ALL) ALL determines administrative privileges for the specific user/group; however, I need to get back to within the scope of the thread regarding installing wireless drivers. For more information regarding root privileges, see the following article below:

Now, back to the topic at hand…

Once you have sudo privileges, open the /etc/apt/sources.list file that I mentioned earlier.

Find the line that looks something like this:

deb http://debian.gtisc.gatech.edu/debian/ stable main contrib

Add ‘non-free’ to the end of the line. Here’s an example:

deb http://debian.gtisc.gatech.edu/debian/ stable main contrib non-free

Save your changes and return to the terminal. That’s CTRL+O, ENTER, and CTRL+X.

Then, update the repository list and install the firmware-realtek package. This should contain the Realtek WiFi drivers for your wireless card.

sudo apt update
sudo apt install firmware-realtek

Then, reboot your computer.

You should be able to see your list of WiFi networks if everything is working.

One thing to note is the firmware-realtek is in the non-free repository, so if you do a search for the package, you will see this:

$ apt search firmware-realtek
Sorting... Done
Full Text Search... Done
firmware-realtek/unstable,now 20210818-1 all [installed]
  Binary firmware for Realtek wired/wifi/BT adapters

Remove the non-free line in /etc/apt/sources.list, update the list of repositories, and if you do a search for the package again, you’ll see this:

$ apt search firmware-realtek
Sorting... Done
Full Text Search... Done
firmware-realtek/now 20210818-1 all [installed,local]
  Binary firmware for Realtek wired/wifi/BT adapters

Note: There’s no need to be root when searching for packages. You need to be root in order to install/uninstall packages.

local denotes that the package is “locally” installed if you download a deb package from the Internet or if you have removed the non-free repository from the /etc/apt/sources.list file. Keep non-free at the end of the deb http://... line. There might be updated drivers for your wireless card.

If you have an NVIDIA GPU, you might also need non-free in order to install proprietary GPU drivers.

Anyway, let me know how it went. I tried my best to be as comprehensive as much as I can, so that those who are new to Linux can get acquainted to the Linux terminal. Sure, the Linux terminal can be tricky to work with, but once you get the wireless drivers installed, it should work. If not, then what I could suggest you do is go to Realtek’s website and look for wireless drivers. Note the model number in lispci command. According to lspci, it’s RTL8821CE. I took the liberty of searching for the wireless drivers and I found one here:

https://www.realtek.com/en/component/zoo/category/rtl8821ce-software

However, the two links below the “Software” section looks like it’s for Windows, so if you can’t get your wireless card to work, then I’m out of ideas on how to proceed. There is a topic regarding NdisWrapper in Debian’s Wiki page; however, I won’t be able to help anyone from this point on. Again, installing firmware-realtek from the non-free repository should work. If not, here’s the link:

https://wiki.debian.org/NdisWrapper

I hope I can be as much help as I can.

And man I’m going to have to write a blog article about how to install proprietary wireless drivers in Linux! What a write-up! :slight_smile:

1 Like