Ubuntu – Re-enable wifi module after reinstall of linux-modules packages

kernel

When I uninstalled unused old kernels, I accidentally uninstalled those packages:

linux-modules-4.15.0-23-generic linux-modules-extra-4.15.0-23-generic     

which disabled my wifi adapter.

Now after reinstalling there is stil no Wifi Adapter found in system settings

My Laptop has no WiFi-button and I am lost, how to look for the right module to re-enable.

I checked this QA:

$ lspci -nnk | grep 0280 -A2
02:00.0 Network controller [0280]: Intel Corporation Wireless 8265 / 8275 [8086:24fd] (rev 78)
        Subsystem: Intel Corporation Wireless 8265 / 8275 [8086:1010]
        Kernel modules: iwlwifi

$ rfkill list all
0: ideapad_bluetooth: Bluetooth
        Soft blocked: no
        Hard blocked: no
1: hci0: Bluetooth
        Soft blocked: no
        Hard blocked: no

$ dmesg | grep iwl
[    4.670669] iwlwifi 0000:02:00.0: Direct firmware load for iwlwifi-8265-34.ucode failed with error -2
...
[    4.674111] iwlwifi 0000:02:00.0: Direct firmware load for iwlwifi-8265-22.ucode failed with error -2
[    4.674113] iwlwifi 0000:02:00.0: no suitable firmware found!
[    4.675206] iwlwifi 0000:02:00.0: minimum version required: iwlwifi-8265-22
[    4.676197] iwlwifi 0000:02:00.0: maximum version supported: iwlwifi-8265-34
[    4.677331] iwlwifi 0000:02:00.0: check git://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git

$ lsmod|grep iw
iwlwifi               282624  0
cfg80211              622592  1 iwlwifi

How do I re-enable the module on my Lenovo Yoga 720-15IKb?

Best Answer

It seems like the package linux-firmware is missing:

$ apt-file find iwlwifi-8265-34.ucode
linux-firmware: /lib/firmware/iwlwifi-8265-34.ucode

$ LANG=c dpkg -s linux-firmware
dpkg-query: package 'linux-firmware' is not installed

try

apt install linux-firmware

and reboot.

This worked for me!