Kernel 516 not removed entirely?

Prologue:
Today I updated my daughters PC to the newest Manjaro release via pamac, not realizing that it was still on the 516 kernel version.
After reboot I ended up with a black screen due to an issue with the nonfree nvidia drivers.
I entered TTY, installed the most recent 517 kernel and removed the end-of-life 516 kernel via the mhwd-kernel tool.
Afterwards I reinstalled the nvidia-drivers and was able to reboot to the system normally.

Issue:
The PC uses an external alfa industries usb wifi adapter and the driver is not present in the linux kernel. I had to re-install its driver (using another usb wifi adapter with kernel driver support for download) and had the following output:

Installing WiFi-Driver from AUR:
Überprüfe Schlüsselring...
Integrität wird überprüft...
Paketdateien werden geladen...
Dateikonflikte werden überprüft...
Überprüfe verfügbaren Speicherplatz...
==> dkms remove --no-depmod rtl88xxau/r1181.37e27f9 -k 5.15.41-1-MANJARO
==> dkms remove --no-depmod rtl88xxau/r1181.37e27f9 -k 5.17.9-1-MANJARO
Reinstalliere rtl88xxau-aircrack-dkms-git (r1181.37e27f9-1)...
Starte Post-Transaction-Hooks...
Arming ConditionNeedsUpdate...
Install DKMS modules
==> dkms install --no-depmod rtl88xxau/r1181.37e27f9 -k 5.17.9-1-MANJARO
==> dkms install --no-depmod rtl88xxau/r1181.37e27f9 -k 5.15.41-1-MANJARO
==> dkms install --no-depmod rtl88xxau/r1181.37e27f9 -k 5.16.14-1-MANJARO
Error! Bad return status for module build on kernel: 5.16.14-1-MANJARO (x86_64)
Consult /var/lib/dkms/rtl88xxau/r1181.37e27f9/build/make.log for more information.
==> WARNING: `dkms install --no-depmod rtl88xxau/r1181.37e27f9 -k 5.16.14-1-MANJARO' exited 10
==> depmod 5.17.9-1-MANJARO
==> depmod 5.15.41-1-MANJARO
Vorgang erfolgreich abgeschlossen.

Content of /var/lib/dkms/rtl88xxau/r1181.37e27f9/build/make.log:

DKMS make.log for rtl88xxau-r1181.37e27f9 for kernel 5.16.14-1-MANJARO (x86_64)
Do 26. Mai 10:29:03 CEST 2022
make ARCH=x86_64 CROSS_COMPILE= -C /lib/modules/5.16.14-1-MANJARO/build M=/var/lib/dkms/rtl88xxau/r1181.37e27f9/build  modules
make[1]: Verzeichnis „/usr/lib/modules/5.16.14-1-MANJARO/build“ wird betreten
warning: the compiler differs from the one used to build the kernel
  The kernel was built by: gcc (GCC) 11.2.0
  You are using:           gcc (GCC) 12.1.0
  CC [M]  /var/lib/dkms/rtl88xxau/r1181.37e27f9/build/core/rtw_cmd.o
  CC [M]  /var/lib/dkms/rtl88xxau/r1181.37e27f9/build/core/rtw_security.o
  CC [M]  /var/lib/dkms/rtl88xxau/r1181.37e27f9/build/core/rtw_debug.o
  CC [M]  /var/lib/dkms/rtl88xxau/r1181.37e27f9/build/core/rtw_io.o
cc1: Fehler: incompatible gcc/plugin versions
cc1: Fehler: Plugin ./scripts/gcc-plugins/structleak_plugin.so kann nicht initialisiert werden
cc1: Fehler: incompatible gcc/plugin versions
cc1: Fehler: Plugin ./scripts/gcc-plugins/structleak_plugin.so kann nicht initialisiert werden
cc1: Fehler: incompatible gcc/plugin versions
cc1: Fehler: Plugin ./scripts/gcc-plugins/structleak_plugin.so kann nicht initialisiert werden
cc1: Fehler: incompatible gcc/plugin versions
cc1: Fehler: Plugin ./scripts/gcc-plugins/structleak_plugin.so kann nicht initialisiert werden
make[2]: *** [scripts/Makefile.build:287: /var/lib/dkms/rtl88xxau/r1181.37e27f9/build/core/rtw_security.o] Fehler 1
make[2]: *** Es wird auf noch nicht beendete Prozesse gewartet....
make[2]: *** [scripts/Makefile.build:287: /var/lib/dkms/rtl88xxau/r1181.37e27f9/build/core/rtw_cmd.o] Fehler 1
make[2]: *** [scripts/Makefile.build:287: /var/lib/dkms/rtl88xxau/r1181.37e27f9/build/core/rtw_debug.o] Fehler 1
make[2]: *** [scripts/Makefile.build:287: /var/lib/dkms/rtl88xxau/r1181.37e27f9/build/core/rtw_io.o] Fehler 1
make[1]: *** [Makefile:1846: /var/lib/dkms/rtl88xxau/r1181.37e27f9/build] Fehler 2
make[1]: Verzeichnis „/usr/lib/modules/5.16.14-1-MANJARO/build“ wird verlassen
make: *** [Makefile:2244: modules] Fehler 2

Question:
Are there still some entries of the 516 kernel and how do I remove them?
Is it enough and safe to remove the folder /usr/lib/modules/5.16.14-1-MANJARO/ ?

The headers are not automatically removed, so dkms thinks it needs to build the modules as well.

pamac remove linux516-headers

to remove any EOL kernel BEFORE updating

sudo mhwd-kernel -r linux516

check theses points

sudo mhwd-kernel -li
ls /etc/mkinitcpio.d/*.preset
sudo ls /boot/initramfs-*
sudo ls /boot/vmlinuz-*
sudo ls /usr/lib/modules/*
pacman -Qs linux*

see this

1 Like

@mithrial
linux516-headers were already removed, but thanx for this hint.

@stephane
Thanx! The issue disappeared after removing the /usr/lib/modules/5.16.14-1-MANJARO/ -folder. I also removed some old stuff from the 58 kernel in the other mentioned folders.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.