Pacman not allowing removal of 5.4 kernel

Hi there.

I have three LTS kernels on my machine & am trying to remove the oldest one - 5.4. When I try, I keep getting the following warning:

“failed to prepare transaction (could not satisfy dependencies)
:: removing linux54 breaks dependency ‘linux54’ required by linux54-nvidia”

If I try removing “linux54-nvidia” first, I get the following:

“base optionally requires linux: bare metal support” - that sounds dangerous, so I’m not going ahead for now.

I will keep looking into it but if you have any light to shed on this would, I’d appreciate it.

Thanks a lot :slight_smile:

Hi @ruziel,

I think you’d have to remove the dependency first:

pamac remove linux54-nvidia

I may be wrong but if your removing the 5.4 kernel then you should be able to remove linux54-nvidia as well. You should not need it anymore.Just to add if you use Manjaro settings manager to remove the kernel it should remove all dependency’s as well.

Which kernel are you running ?

1 Like

My thought exactly! Probably running the Kernel that is too be deleted!

Thanks everyone. I am running 6.1 & also have 5.10 as back-up. The only reason I’m concerned about removing linux54-nvidia is what it says about "“base optionally requires linux: bare metal support”. I’m not sure why it’s saying that because I’ve removed kernels in the past - I don’t want to risk breaking my system. Thanks a lot…

2 Likes

Depending on how you do it, dependencies may not be automatically removed.
The easiest way to handle kernels should be through the Manjaro Settings Manager.

2 Likes

To manage kernels using console commands there is a manjaro tool for this:

mhwd-kernel -h
Usage: mhwd-kernel [option]
-h --help Show this help message
-i --install Install a new kernel [kernel(s)] [optional: rmc = remove current kernel]
-l --list List all available kernels
-li --listinstalled List installed kernels
-r --remove Remove a kernel [kernel(s)]

1 Like

Have you tried removing the kernel with mhwd-kernel?

sudo mhwd-kernel --remove linux54

If, and only if, you don’t run the kernel you’re trying to remove.

1 Like

When you get messages like above - simply add the mentioned packages to your command - if you get other required by - repeat until the command

But knowing pacman arguments will help you

 $ man pacman
[...]
REMOVE OPTIONS (APPLY TO -R)
       -c, --cascade
           Remove all target packages, as well as all packages that
           depend on one or more target packages. This operation is
           recursive and must be used with care, since it can remove
           many potentially needed packages.

       -n, --nosave
           Instructs pacman to ignore file backup designations.
           Normally, when a file is removed from the system, the
           database is checked to see if the file should be renamed with
           a .pacsave extension.

       -s, --recursive
           Remove each target specified including all of their
           dependencies, provided that (A) they are not required by
           other packages; and (B) they were not explicitly installed by
           the user. This operation is recursive and analogous to a
           backwards --sync operation, and it helps keep a clean system
           without orphans. If you want to omit condition (B), pass this
           option twice.

       -u, --unneeded
           Removes targets that are not required by any other packages.
           This is mostly useful when removing a group without using the
           -c option, to avoid breaking any dependencies.
[...]

So by applying options you can make pacman remove everything related to linux54. Always the content of transaction before hitting Enter

 $ sudo pacman -R linux54
checking dependencies...
error: failed to prepare transaction (could not satisfy dependencies)
:: removing linux54 breaks dependency 'linux54' required by linux54-nvidia
 $ sudo pacman -Rns linux54
checking dependencies...
error: failed to prepare transaction (could not satisfy dependencies)
:: removing linux54 breaks dependency 'linux54' required by linux54-nvidia
 $ sudo pacman -Rnsc linux54
checking dependencies...
:: base optionally requires linux: bare metal support

Package (2)     Old Version  Net Change

linux54-nvidia  525.89.02-4  -48,33 MiB
linux54         5.4.234-1    -77,13 MiB

Total Removed Size:  125,46 MiB

:: Do you want to remove these packages? [Y/n] 
1 Like

Thank you - that is helpful

Thank you.

On a side note: one should remember that pacman doesn’t prevent one from - accidently - removing the running kernel - that is not a bug - pacman assumes you know what you are doing :slight_smile:

1 Like

Thanks everyone. Just to confirm, I am running 6.1 & have 5.10 as my back-up. I should be safe to uninstall 5.4.

The thing that is concerning me is this…

“checking dependencies…
error: failed to prepare transaction (could not satisfy dependencies)
:: removing linux54-headers breaks dependency ‘linux54-headers’ required by linux-lts-headers”

Could it impact the running of 6.1? Thank you for your patience!

Ruziel :slight_smile:

That is a deprecated package that hasn’t existed in the repos for a long time. Remove that first.

All done. Thanks everyone. My worst fears didn’t come to pass.

More power to Manjaro & community :slight_smile:

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