wifi issues in ubuntu 22.04LTS

16,639

Solution 1

UPDATE: latest version of ubuntu 22.04 does not have this problem, just install updates. Original answer follows, then detail of which version fixed it for me.

I think it is likely that you are hitting a bug with the 5.15 kernel (linked below) that is used by Ubuntu 22.04. If so you can only fix the problem today by changing to another kernel version without that bug (this can be done without changing anything else). The fix is already available in the kernel sources for 5.15, but downgrading until it is available in the ubuntu 5.15 packages is a reasonable workaround.

Based on dates and schedule only (the upstream fix was committed 28-Mar, after the previous ubuntu kernel commit deadline but before the start of current cycle), I am hopeful that the next scheduled Ubuntu kernel release on 09-May will fix your problem. Source: https://kernel.ubuntu.com/

My experience

I had exactly the same issue with 22.04 - everything else fine, but I had slow wifi that would regularly silently disconnect. I was dual-booting with an existing Ubuntu 21.10 installation which continued to show no similar problems, so I knew that the problem was specific to the updated OS.

This was with a "TP-LINK TL-WDN4800 N900" PCI-e wireless card, with Qualcomm Atheros driver.

I then saw exactly the same wifi behaviour when using the 5.15 kernel in manjaro. The smoking gun here - in my view - is the exact same BAD WIFI behaviour newly occurring over two linux distributions where pretty much the only thing they had in common was kernel version. I've tested each of these:

  • 5.17.1-3 with manjaro - GOOD
  • 5.15.32-1 with manjaro - BAD WIFI
  • 5.15 with ubuntu 22.04 - BAD WIFI
  • 5.13 with ubuntu 21.10 - GOOD
  • 5.10.109-1 with manjaro - GOOD

I know wifi issues can have many causes, and my answer is not perfect - particularly since I haven't reinstalled ubuntu 22.04 and installed a different kernel to verify the fix, but this setup has been rock-solid over many operating systems over the past few years, and this was the first time I've seen behaviour exactly as you did. Since it took me a while to track down, I thought I'd share. Hope it helps. I'll try 22.04 again after the next kernel update - if you're still interested, let me know and I'll let you know the results.

Update with confirmed fix

Using ubuntu's kernel version numbers, the original was 5.15.0.25.27 with broken wifi. On 13 May, the update to 5.15.0.30.33 also had broken wifi. Now on 20 May an update to 5.15.0.33 was offered and it definitely fixes the wifi problems I was having.

Above version numbers are those reported by "Software Updater". For the first fixed version uname -r reports 5.15.0-33-generic

Links

I believe these are what you are seeing:

  • The kernel bug "ath9k frequent connection problems after kernel upgrade": https://bugzilla.kernel.org/show_bug.cgi?id=215703 - notice "The same change that affects 5.16.15 was also incorporated into the 5.15 tree: 5.15.28 works, whereas 5.15.29 and 5.15.30 don't."
  • Discussion of behaviour on arch forum: https://bugs.archlinux.org/task/74187?project=1 - notice "Last night's push of 5.17.1-arch1-1 clearly fixed all the problems I was having with my Qualcomm Atheros AR93xx Wireless card". Different kernel version (5.17.1) but same module, and the same bug exists in 5.15 as shown in previous link.

Solution 2

Updating to kernel 5.17.5 makes stable wifi on Ubuntu 22.04. Warning: a system may not start after updating kernel when secure boot is on.

So, turn off secure boot in BIOS, download kernel (for example in ~/Downloads) and install it, then reboot, example below.

cd ~/Downloads
wget -c https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.17.5/amd64/linux-headers-5.17.5-051705_5.17.5-051705.202204271406_all.deb
wget -c https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.17.5/amd64/linux-headers-5.17.5-051705-generic_5.17.5-051705.202204271406_amd64.deb
wget -c https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.17.5/amd64/linux-image-unsigned-5.17.5-051705-generic_5.17.5-051705.202204271406_amd64.deb
wget -c https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.17.5/amd64/linux-modules-5.17.5-051705-generic_5.17.5-051705.202204271406_amd64.deb 
sudo dpkg -i *.deb

Solution 3

Because there is a bug in kernel 5.15 as mentioned by @lain haslam, you can use an older version of the kernel by holding the SHIFT button while booting to enter GRUB then go to Advanced options for ubuntu then you can use ubuntu with an older kernel

From My Experience I have downgraded the kernel from 5.15 to 5.13 and it works

Solution 4

since the Ethernet connection is working, you should be able to find a solution from link, however, not recommended to attempt anything that involves disabling network manager. I bricked my machine trying

couple of easily reversible solutions you can try from the link:

1.sudo nano /etc/NetworkManager/conf.d/default-wifi-powersave-on.conf
Then changed the value from 3 to 2, save changes and reboot. if not working, switch back to 3.

2.sudo nano /etc/gai.conf
look for the line with precedence ::ffff:0:0/96 100 and removed the # character that preceded it. save changes and reboot. if not working add # back.

you need to use the ctrl key to save, exit, etc.. from the conf screen if you are not aware. And i just tried these two changes to make sure there are no repercussions.

  1. Selecting proprietary wireless driver, which is the last answer posted in the link. However, looking at the driver info you posted, you probably don't have that option. No harm checking tho.
Share:
16,639
juztcode
Author by

juztcode

Updated on January 04, 2023

Comments

  • juztcode
    juztcode over 1 year

    I just installed ubuntu 22.04LTS since it has been release, and right off the bat, I notice my Wifi is extremely slow, it only downloads at 500Kbps, and I tried to download pycharm ~500mbs, it fails each time.

    I know it's WiFi issue, because, on connecting an ethernet, the wifi speed bumps upto 5mbps for the same file download, I also checked my internet connection if fine using other devices ( downloaded the same file on my mac)

    The output of lspci state:

    .
    .
    .
    01:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL810xE PCI Express Fast Ethernet controller (rev 07)
    02:00.0 Network controller: Qualcomm Atheros QCA9565 / AR9565 Wireless Network Adapter (rev 01)
    .
    .
    .  
    

    which should mean my drivers are installed, right?

    The overall experience of ubuntu is better, but, the wifi is having issue. It turns off intermittently, doesn't let me download large files, streaming is also difficult. Is anyone facing this as well?

    Should I just downgrade the entire OS? Or is there a way to fix this? (e.g. Can I use the part of the system that handles the networking stuff from previous version of the distro?)

    • Admin
      Admin about 2 years
      are you able to use an ethernet connection to check whether the internet speed is only affected by the wifi connection or across the board when using 22.04
    • Admin
      Admin about 2 years
      yes, the wifi speed bumps upto 5mbps with an ethernet connection. (Should had mentioned that, will edit)
    • Admin
      Admin about 2 years
      anything in this reference from ubuntu-help make any sense?
    • Admin
      Admin about 2 years
      @24601 , thanks for your response, but, I think I'm on the green for the list suggested here yet the problem still persists
  • Admin
    Admin about 2 years
    is it possible to use stuff related only to networking from ubuntu 20.04?
  • Admin
    Admin about 2 years
    most of the solutions in the link work across the board for different versions related to wifi issues, hence, i asked whether your ethernet connect is working. If it is solely related to wifi, one of the solutions in the link should fix the bill. At least it did for me when i had slow wifi connect when running two prior versions. But as mentioned NOT recommended to attempt anything related to removing or disable network manager.
  • Admin
    Admin about 2 years
    yeah, but, how am I supposed to know if the files I'm editing belong to the network manager or its components? Only people a bit more knowledgable would know that
  • Admin
    Admin about 2 years
    @juztcode, i've just added three reversible options form the link which you can safely try in my answer.
  • Admin
    Admin about 2 years
    I did try all the answers, except the one with the kernel, but, they all don't seem to work
  • Admin
    Admin about 2 years
    if all those don't work, probably best to report as bug. And it's a good call not to attempt the kernel solution. Sorry the solutions from the link didn't work for you.
  • Admin
    Admin about 2 years
    I really appreciate the response though, thank you
  • Admin
    Admin almost 2 years
    Had the same issue with kernel 5.15. Wifi working just after boot but after several minutes the wifi device disconnects and only a reboot corrects the issue. Upgraded to kernel 5.17.5 but no difference.
  • Admin
    Admin almost 2 years
    If you don't want to have to disable secure boot, these instructions for signing the new kernel were easy to follow: gloveboxes.github.io/Ubuntu-for-Azure-Developers/docs/… Fingers crossed this solves the wifi issue!
  • Admin
    Admin almost 2 years
    How can I download it?
  • Admin
    Admin almost 2 years
    do you mean the kernel?
  • Admin
    Admin almost 2 years
    After I've upgraded to 5.17 kernel I cant find wifi menu on tap bar and setting.
  • Admin
    Admin almost 2 years
    this saved my work day from having to reinstall the OS!
  • Admin
    Admin almost 2 years
    Worked for me. Lenovo G500, Qualcomm Atheros AR9485 Wireless network adapter
  • Admin
    Admin almost 2 years
    My wifi issue was solved by downgrading kernel to 5.13.19-051319-generic.
  • Admin
    Admin almost 2 years
    No wifi issue on kernel 5.13.19-051319-generic.
  • Admin
    Admin almost 2 years
    I'm confused why you say the "2.15" kernel when everything seems to start with 5 and nothing seems to end with anything close to 2.15... Also, I'm seeing an issue with intermittent connectivity after the last update, which was to 5.15.0-39-generic.
  • Admin
    Admin almost 2 years
    I started having intermittent connectivity only after being upgraded to 5.15.0-39!!!
  • Admin
    Admin almost 2 years
    @Michael - I have no idea what made me write 2.15. I definitely meant 5.15, sorry for the mistake. Since the "Update with confirmed fix" above, I've used "5.15.39-051539-generic" (again, as reported by uname -r) and all I can say is that it works perfectly. You may well be seeing a different issue.