Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save UbuntuEvangelist/e36f6a1a9ef7cb0a0b24e592eb925b68 to your computer and use it in GitHub Desktop.
Save UbuntuEvangelist/e36f6a1a9ef7cb0a0b24e592eb925b68 to your computer and use it in GitHub Desktop.
Fix WiFi Issues on Ubuntu 24.04 LTS Desktop
# Follow Things To Do After Installing Ubuntu 24.04 LTS
$ apt update -y
$ apt upgrade -y
$ apt update -y
$ apt install build-essential checkinstall
$ apt install ubuntu-restricted-extras
$ apt install software-properties-common
$ apt install apt-show-versions
$ apt upgrade -o APT::Get::Show-Upgraded=true
$ apt-show-versions | grep upgradeable
$ apt install git
$ apt -f install
$ apt autoremove
$ apt -y autoclean
$ apt -y clean
$ apt update -y
$ apt upgrade -y
$ apt update -y
# Ensure the Wi-Fi Adapter is Recognized
$ lspci | grep -i network
# Check for Wireless Drivers
$ lshw -C network
# Install Missing Drivers
$ sudo apt update
$ sudo apt install bcmwl-kernel-source
# Verify Network Manager is Running
$ sudo systemctl status NetworkManager
# If it's not running, start it with:
$ sudo systemctl start NetworkManager
# Check for Disabled Wi-Fi. Sometimes Wi-Fi can be soft or hard blocked. Check this with:
$ rfkill list
# If you see "soft blocked" or "hard blocked" for the Wi-Fi adapter, unblock it with:
$ sudo rfkill unblock wifi
# Reboot PC
$ sudo reboot
# Logs and Diagnostics:
$ dmesg | grep -i wifi
$ journalctl -xe | grep NetworkManager
# Example Troubleshooting Commands
$ lspci | grep -i network
$ sudo lshw -C network
$ sudo apt update
$ sudo apt install bcmwl-kernel-source
$ sudo systemctl status NetworkManager
$ rfkill list
$ sudo rfkill unblock wifi
$ dmesg | grep -i wifi
$ journalctl -xe | grep NetworkManager
@LetsCreatProjects
Copy link

Also this helped:

dmesg | grep -i wifi

$ if it is shows this error:
$  ...] iwlwifi ...Direct firmware load for iwlwifi-.....ucode failed with error -2
$ check git://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git
$ connect to internet vie wire
      $ Update the Package List and Firmware
              sudo apt update
              sudo apt install --reinstall linux-firmware
              sudo reboot

$ If didn't helped, Manually Download and Install the Firmware (If Necessary)
      sudo apt install git
      git clone git://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git
      sudo cp -v linux-firmware/iwlwifi-QuZ* /lib/firmware/
      sudo modprobe -r iwlwifi
      sudo modprobe iwlwifi
      sudo reboot

$ And now should work!
 

@ronitsharma03
Copy link

Hey, wouldn't it be dangerous to manually install firmware.
Well, was curious if it would work for the realtek rtl8852be pcie?
Because i am unable to find any compatible driver to work for ubuntu 24.04 lts the usual hp driver problem with reqlted nic.
Laptop's wifi works normally after powering the laptop but as the time goes the wifi gets disconnected and shows no wifi adapter found after sometime and mostly when connected with a power source !

@jcmcobra
Copy link

Greetings,

Recently upgraded to 24.04.1 and just tried your Things To Do. It helped but did not resolve my unstable wifi issues. Could this be because your instructions are specific to 24.04, not 24.04.1?

@Hosseinzlf
Copy link

Hosseinzlf commented Oct 1, 2024

For the 24.04.01 LTS:

This is my solution:

  1. sudo apt update
  2. dmesg | grep -i wifi
  3. check the message if you see something like this : iwlwifi ...Direct firmware load for iwlwifi-.....ucode failed with error -2
    $ It will mention what is minimum and maximum firmware version. For me it was:
    $$ minimum: iwlwifi-ty-a0-gf-a0-34.ucode
    $$ maximum: iwlwifi-ty-a0-gf-a0-66.ucode
  4. So, now go to this website: https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/plain
    $ search and download relevant firmware for your wifi, for example I found this version that is between min and max:
    iwlwifi-ty-a0-gf-a0-59.ucode
  5. sudo cp -v /Downloads/iwlwifi-ty* /lib/firmware/
  6. sudo modprobe -r iwlwifi
  7. sudo modprobe iwlwifi
  8. sudo reboot

$ Now it should works!

@eduardstan
Copy link

Hi, I have the same problem with the unstable WiFi connection.

$ dmesg | grep -i wifi
dmesg: read kernel buffer failed: Operation not permitted

I've gone through all the "Things to Do"

Here are the logs and diagnostics:
$ dmesg | grep -i wifi
dmesg: read kernel buffer failed: Operation not permitted

$ sudo dmesg | grep -i wifi
$

$ journalctl -xe | grep NetworkManager
Nov 23 07:41:12 valhalla NetworkManager[1024]: [1732344072.6164] agent-manager: agent[576309e86af34f34,:1.82/org.gnome.Shell.NetworkAgent/1000]: agent registered

Can someone help me please?

@UbuntuEvangelist
Copy link
Author

Hi, I have the same problem with the unstable WiFi connection.

$ dmesg | grep -i wifi dmesg: read kernel buffer failed: Operation not permitted

I've gone through all the "Things to Do"

Here are the logs and diagnostics: $ dmesg | grep -i wifi dmesg: read kernel buffer failed: Operation not permitted

$ sudo dmesg | grep -i wifi $

$ journalctl -xe | grep NetworkManager Nov 23 07:41:12 valhalla NetworkManager[1024]: [1732344072.6164] agent-manager: agent[576309e86af34f34,:1.82/org.gnome.Shell.NetworkAgent/1000]: agent registered

Can someone help me please?

The issue you're experiencing with your unstable WiFi connection and the dmesg output being empty can be related to several potential causes. Here's how you can troubleshoot and resolve this issue step by step:

To temporarily bypass this restriction, run:
sudo dmesg | grep -i wifi

To permanently disable the restriction (not recommended for shared systems):
sudo sysctl -w kernel.dmesg_restrict=0

Check Logs for Relevant WiFi Errors:
sudo dmesg | grep -i wlan
sudo dmesg | grep -i net

NetworkManager logs:
journalctl -u NetworkManager -b | grep -i wifi

Verify WiFi interface status:
nmcli dev status

If yo need anything goes Linux support ping me Telegram https://t.me/LinuxCopilot

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment