The update removed all of the installed kernels

It’s been at least a year since I had a problem with an update but luckily I recognised what happened and was able to repair everything. This is the third time this has happened since I switched to Manjaro a number of years ago.

During the update I was logged out by the system. I could log back in but I know that the update removed all of the installed kernels. When this happened previously I though removing the pacman lock and re-running the update would fix it but rebooting will boot to the BIOS and fixing it requires a live USB.

What happens is that all the kernels are removed during the update without their updated versions being installed. The solution is to go into SETTINGS | MANJARO SETTINGS MANAGER and reinstall all the desired kernels. If they are showing as installed they should be removed and reinstalled. Then grub needs to be updated manually to make sure an entry is there for each kernel. Only then can the system be restarted.

So it has happened three times and I am sure it will happen again in the future. Hopefully, no one else has experienced this weird update glitch or can at least find my solution.

That is an issue you should discuss with your local system administrator.

Did you use pamac or pacman?

Updates should never be run unattended.

That would imply a flaw in upstream Arch Linux pacman - more precisely the libalpm backend - I have never seen kernels removed without the new being installed - not withstanding the below mentioned packages.

Do you by any chance have the kernel-alive package on your system? As I recall it was removed years ago due to creating more issues than it solved.

Another abandoned experiment was linux-latest and linux-lts packages - also causing more issues than it solved.

3 Likes

As far as I’m aware, the kernels are disabled / removed at the start of the upgrade process, then only re-referenced and re-incorporated at the end, during the bootloader configuration. At least that’s how I interpret the logs.

I do think it would be a good idea for Pacman to keep at least one intact, working kernel as this would help, somewhat, to avoid such issues.

1 Like

I’m pretty sure it’s only DKMS-installed kernel modules that are removed at the beginning and then reinstalled at the end.

You can be sure, but the opposite is proven by using maxi -w=100 in a second terminal during the update.

1 Like

How do you do that, not touching one kernel, when you only have one kernel?

I think before brainstorming how to change Pacman, slumbergod should check why he has a recurring issue that nobody else seems to have. Also, if you stop the update process before it finishes, obviously there will be issues. As suggested by linux-aarhus he should check if he has one of the legacy metapackages linux-lts or linux-latest, or kernel-alive installed, and remove them first to see if that helps to solve his issues.

//EDIT: also checking the Pacman log could probably shed some light on what’s happening.

4 Likes

It would fix it…if one of the packages triggered mkinitcpio (though that doesn’t usually happen), or if no kernels were updated. You should also reinstall the last package to be updated, in case it was corrupted.

The solution is to reinstall the last package to be updated, finish the update, run sudo mkinitcpio -P, and then sudo grub-mkconfig -o /boot/grub/grub.cfg.

Your solution works because it triggers mkinitcpio and updates grub.

https://wiki.archlinux.org/title/Mkinitcpio


However important software can become corrupted and it takes more to fix it. Sometimes you need to reinstall, at least it’s much quicker and easier.

I have kernel-alive installed, should this be removed then before updating? However, looks like I do not have kernel-modules-hook installed. re: this thread

thanks

yes.

ftfy :wink:

Well it is not required. But if you want something that does the job of kernel-alive without (as many) issues… then you might want to install it.

ok, thanks!