DEV Community

Jason F
Jason F

Posted on

How I Set Up Wifi In Debian 11

I just made the switch to Debian 11 last night. If you're new to Debian, you may be surprised to see that Wifi doesn't seem to work right out of the box. I'll walk you through the steps that I took to get Wifi up and running. Please note, I am by no means a Linux expert. I'm just a web developer who runs an older laptop and doesn't want to deal with Windows ever again.

If you just installed Debian 11 you may want to run through this article first (it won't help with the wifi, but some of these items are probably necessary/helpful).

Note: Your experience may vary based on your machine

Add non-free and contrib sources to your SourcesList

So...due to Debian's FOSS philosophy, you'll need to add some repo sources to your SourcesList. You can find the sources.list file here: /etc/apt/sources.list.

My sources.list file currently looks like this:



# Line commented out by installer because it failed to verify:
deb http://security.debian.org/debian-security bullseye-security main contrib
# Line commented out by installer because it failed to verify:
deb-src http://security.debian.org/debian-security bullseye-security main contrib

# bullseye-updates, to get updates before a point release is made;
# see https://www.debian.org/doc/manuals/debian-reference/ch02.en.html#_updates_and_backports
# A network mirror was not selected during install.  The following entries
# are provided as examples, but you should amend them as appropriate
# for your mirror of choice.
deb http://deb.debian.org/debian bullseye main contrib non-free
deb-src http://deb.debian.org/debian bullseye main contrib non-free

deb http://deb.debian.org/debian-security/ bullseye-security main contrib non-free
deb-src http://deb.debian.org/debian-security/ bullseye-security main contrib non-free

deb http://deb.debian.org/debian bullseye-updates main contrib non-free
deb-src http://deb.debian.org/debian bullseye-updates main contrib non-free
deb http://deb.debian.org/debian/ bullseye-updates main contrib

deb-src http://deb.debian.org/debian/ bullseye-updates main contrib


Enter fullscreen mode Exit fullscreen mode

Notice that I've added the non-free and contrib repo sources. You'll want to do the same. You can learn more about the SourcesList here.

Note. I'm not sure which of these sources is the one that gave me access to the package I needed to get my wifi up and running, but am pretty sure it's the non-free

Figure out which wifi adapter you have

This is a super important step. You'll need to know which wifi adapter you have in order to know which package to install to use it. I accomplished this by using the lshw command. If you do not have 'lshw' installed you can easily install it by running sudo apt install lswh.

Once you have lshw installed, you can run sudo lshw -html > lshw.html. This will pipe out the results in to a nice html file for you.

Open the HTML file and look for an entry with a description of "network controller" or something similar. My entry looked like this:
Network Controller Entry

I was able to see that I have the Wireless 7265 network controller from Intel. I did a quick internet search for "intel wireless 7265 debian 11" and found this link.
Note: You will need to search for your network controller and pray to your favorite deity that Debian has a package that will enable wifi for you

Install the necessary package

Now that you hopefully found the right package, it just needs to be installed. The iwlwifi page from Debian gave me a couple of command line instructions to run. Once installed, I was able to connect to my wifi. I did have to switch to the root user to run those commands. You can do that by running su - root.

Hope this helps

I hope at least one person out there finds this article helpful. Also, if you're a more experienced Linux user, please feel free to critique my post, give advice, etc..so long as it's helpful and not condescending. Thanks!

Top comments (7)

Collapse
 
dvmierlo profile image
Dennis van Mierlo • Edited

Hi Jason,

Thank you very much for sharing your experience with us. It helped me a lot to activate WiFi for Debian 11 that I installed on my Macbook Pro 17" mid 2010. In my case, I needed to install the brcm80211.

These are my steps I did:
1 - Installed lshw and created an HTML hardware list like you instructed.
2 - Add the following line to my sources.list:

deb http://deb.debian.org/debian/ bullseye main contrib non-free
Enter fullscreen mode Exit fullscreen mode

3 - Installed the Broadcom firmware brcm80211:

sudo apt install firmware-brcm80211
Enter fullscreen mode Exit fullscreen mode

After installing the firmware, my WiFi was immediately active. And it works fine.

With kind regards, Dennis

Collapse
 
juniordevforlife profile image
Jason F

Great to hear, Dennis. Thank you!

Collapse
 
opamlee profile image
TRiGGGERRR

thank you very much for this help!!

Collapse
 
markpreston10 profile image
Mark Preston

Thank you so much Jason F. Very helpful.
I have the same 7265 intel wireless controller
I also had to add my username to the sudo list.
Login as root (su -)
visudo
add the line mark ALL=(ALL) NOPASSWD: ALL
edit the sources list file
sudo mousepad /etc/apt/sources.list
adding contrib non-free to the various repositories
issue the command modprobe -r iwlwifi ; modprobe iwlwifi
Connect the laptop to the internet using an ethernet cable
As root: apt install iwd
apt update && apt install firmware-iwlwifi
And now it is working fine on this 32 bit Thinkpad

Collapse
 
tobecci profile image
Tochukwu Ojinaka

After doing the steps you mentioned, i had to do

sudo apt install firmware-iwlwifi

thanks.

Collapse
 
todwulff profile image
TodWulff

I found it helpful. Thank you.

Collapse
 
xexusus profile image
XexusUS • Edited

Just a friendly heads up: the command to install lswh shoud be:
sudo apt install lshw
(a typo in the original posting)