When is it safe to remove old kernel versions?

I’ve gotten failures like this before but ignored them.


Upgrading linux-firmware (20210405.r1866.af1ca28-1 → 20210426.r1905.fa0efef-1)…
Upgrading linux510 (5.10.30-1 → 5.10.32-1)…
Upgrading linux510-nvidia (460.67-7 → 460.73.01-1)…
Upgrading linux59-nvidia (460.67-1 → 460.73.01-1)…
depmod: ERROR: could not open directory /lib/modules/5.9.16-1-MANJARO: No such file or directory
Error while configuring linux59-nvidia
depmod: FATAL: could not search modules: No such file or directory
Error: linux59-nvidia: command failed to execute correctly

Looking in /lib/modules I can see that the error message is technically correct:

% ls -l /lib/modules
total 16
drwxr-xr-x 4 root root 4096 Apr 18 10:02 5.10.30-1-MANJARO
drwxr-xr-x 4 root root 4096 Apr 29 09:12 5.10.32-1-MANJARO
drwxr-xr-x 2 root root 4096 Apr 29 09:11 extramodules-5.10-MANJARO
drwxr-xr-x 2 root root 4096 Apr 29 09:12 extramodules-5.9-MANJARO

Do I perhaps need to do something to get the system to stop caring about 5.9 versions of the kernel? If so, how? It seems I have both 5.9 and 5.10 kernels installed:

% pacman -Ss linux59 | grep installed
core/linux59 5.9.16-1 [installed]
extra/linux59-nvidia 460.73.01-1 (linux59-extramodules) [installed]
% pacman -Ss linux510 | grep installed
core/linux510 5.10.32-1 [installed]
extra/linux510-nvidia 460.73.01-1 (linux510-extramodules) [installed]

How do I know when it’s safe to remove those 5.9 packages? Will they automatically be removed at some point?

Hi,

Kernel 5.9 is end-of-life, therefore you should remove it, this can be done via Manjaro Settings Manager.

It’s usually a good idea to have two kernels installed as a fallback, so you could install 5.4 or 5.12.

1 Like

The ultra simple answer is - when you no longer need it - and you are the only one who knows.

you have to remove

sudo mhwd-kernel -r linux59 
sudo mhwd-kernel  -i linux54 

see this for info on LTS version
https://www.kernel.org/category/releases.html

6 posts were split to a new topic: How do I remove old kernels?

Bumping old threads is discouraged by the forum rules.