How do I remove old kernels?

i had a situation were i have too many kernel ver
Currently running: 5.13.13-1-MANJARO (linux513)
The following kernels are installed in your system:

  • linux510
  • linux512
  • linux513
  • linux54

and when i try to remove the oldest ones i get the following error

sudo mhwd-kernel -r linux54 
checking dependencies...
error: failed to prepare transaction (could not satisfy dependencies)
:: removing linux54-headers breaks dependency 'linux54-headers' required by linux-lts-headers
[omar@Probook ~]$ sudo mhwd-kernel -i linux54
:: Synchronizing package databases...
 core                                                                             169.6 KiB  1238 KiB/s 00:00 [#################################################################] 100%
 extra                                                                           1893.0 KiB  3.30 MiB/s 00:01 [#################################################################] 100%
 community                                                                          6.6 MiB  3.97 MiB/s 00:02 [#################################################################] 100%
 multilib                                                                         174.6 KiB  2.55 MiB/s 00:00 [#################################################################] 100%
warning: linux54-5.4.143-1 is up to date -- reinstalling
warning: linux54-broadcom-wl-6.30.223.271-153 is up to date -- reinstalling
warning: linux54-headers-5.4.143-1 is up to date -- reinstalling
warning: linux54-virtualbox-host-modules-6.1.26-8 is up to date -- reinstalling
resolving dependencies...
looking for conflicting packages...

Packages (4) linux54-5.4.143-1  linux54-broadcom-wl-6.30.223.271-153  linux54-headers-5.4.143-1  linux54-virtualbox-host-modules-6.1.26-8

do i remove each of the dependencies. and run the coomand again

thank you for your time and look forward to hear from you
best regard
Omar

I guess you have the meta package linux-lts, so remove it first then retry.

thank you for your response the question i have how can i remove the meta data ?

thank you aging for your help

What ?

Remove the obsolete packages, such as:

  • linux-lts
  • linux-lts-headers
  • linux-latest
  • linux-latest-headers

@omano was referring to meta packages, not meta data.

@a2apple: they’re called “meta” packages, since they pull in other packages automatically, rather than providing software themselves.

However, in the case of “-lts” and “-latest”, these no longer exist on the official repositories.

finally finger it out had to remove the dependence first then remove the kernel

sudo pacman -Rsn linux54-broadcom-wl
sudo pacman -Rsn linux54-virtualbox-host-modules
sudo pacman -Rsn linux54

that did the trick
thank you all again for all the help

Please mark the thread as solved if you figured it out yourself.

You can do so by clicking on the hamburger icon (similar to an ellipsis mark) at the bottom of your solution. The option (It looks like a checkbox) is hidden there.

Thanks!

PS. I did it for you this time.

sorry about that forgt to do it thank you for the reminder.

best regard
omar

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