As per the manjaro wiki I should use pacman to remove kernels, but there is a -r option to remove kernels with mhwd-kernel.
Can someone explain why this is while you are instructed to use mhwd-kernel to install?
Is it because mhwd-kernel will not remove everything so I should clean up with pacman?
Edit
I just used mhwd-kernel to remove a kernel, and everything gets removed including nvidia drivers. I’m just curious why all those steps are there?
No, that example only shows you how to use pacman for removing headers, extramodules, or everything, all as possible options.
You are not actively being told to use pacman for removing kernels. As the matter of fact, the example for removing a kernel by way of mhwd-kernel -r is right there on the page, above the examples for using pacman.
The recommended way for uninstalling a kernel is mhwd-kernel -r.
Same. And I just checked, the page does specify and show removing kernels with mhwd-kernel. As @Aragorn mentioned, it’s only the headers and extramodules that mentions using pacman.
Not really, should probably be worded differently then:
Where multiple kernels are present on your system, pacman can be used to remove them in the terminal. It may be necessary to delete a total of three elements of the kernel in total to completely remove it:
The kernel itself
The kernel's headers
The kernel's extra modules
The line “It may be necessary to delete a total of three elements of the kernel in total to completely remove it” is what bothers me. There is no description on how to KNOW that.
I know I’m making a chicken out of a feather here, but if I get confused, so can others (although I should not take that for granted xD)
No … the point was you postulated the reason for “R” was to remove dependencies as well when “R” alone rather explicitly means just the single package.
And then there is the question of cache files… Unless you periodically clean the folder completely but rather use the rvk3 method, you will have leftovers from every kernel you ever uninstalled.
In this case, I only needed mhwd-kernel (I think, still unclear to me when I need to use pacman on top).
I ran sudo find /var/cache/pacman/pkg/ -type f -iname 'linux65*' and yepp, there they were. sudo find /var/cache/pacman/pkg/ -type f -iname 'linux65*' -exec rm -v {} \;
Its mentioned in a few places.
Remove all but 2 latest caches of installed packages, then remove all uninstalled caches…
paccache -rvk2
paccache -rvuk0
Not to mention bigger hammers like …
sudo pacman -Scc
And remember … at least initially the idea of the manjaro wiki was to not just duplicate things on the Arch wiki. So for something like pacman … you will find the most verbose information there.
Let me ask this question instead then:
Under what circumstances would I have to run mhwd-kernel AND pacman to uninstall?
The recommendation that I first marked as solution earlier stated to only use mhwd-kernel.
If you have extra packages aside from the kernel installed.
(though by and large I thought they will be gotten by dependencies checks)
At least one person here seemed to think it was needed to remove the headers.
(mhwd-kernel doesnt work when I’m running a non-manjaro kernel so I cant check right now)
The headers aren’t normally required unless one has a DKMS package installed. If MHWD detects headers are necessary / no longer necessary, it will install / remove them.
No, the idea was just that it took them with the kernel … and …
$ sudo mhwd-kernel -r linux61
checking dependencies...
:: base optionally requires linux: bare metal support
:: dkms optionally requires linux-headers: build modules against the Manjaro kernel
Packages (2) linux61-6.1.61-1 linux61-headers-6.1.61-1
Total Removed Size: 288.70 MiB
:: Do you want to remove these packages? [Y/n]