You are not logged in.

#1 2022-09-14 23:24:04

expatiate-orangutans
Member
Registered: 2019-07-11
Posts: 6

[SOLVED] Upgrade linux without removing existing kernel modules

I often want to upgrade my system without immediately wanting to restart as well. The usual way to do this is pacman -Syu, and that's usually want I want, with one exception: linux. I've frequently found that upgrading linux results in other programs failing (most commonly docker, which can be a problem for work), usually as a result of attempting to load a kernel module which no longer exists on the filesystem.

I could solve this with e.g. `IgnorePkg=linux`, and I have tried this in the past, along with variations along the lines of

IgnorePkg   = linux linux-headers linux-api-headers linux-firmware intel-ucode ...

but I don't like this for various reasons:

0. I'm never totally comfortable with the result of this, since I may have upgraded something related to linux but not linux itself, and then maybe I have to boot with a usb key and fool around with the rescue system when I'm trying to get something useful done.

1. I can't recall for certain, but I think I may have had issues in the past with docker or similar programs in spite of using IgnorePkg, although this definitely makes it more likely.

2. Fundamentally, I don't want to not upgrade linux. I do want to upgrade it, and have the latest linux available next time I reboot or kexec, I just don't want to have the issues related to removing the current kernel's modules.

So: is there some way to upgrade linux without removing the kernel modules of the currently-running kernel? Or is there some other way people solve this problem?

I assume the answer to the first question is "No" since I'm basically saying I want to remove a package without removing the package's files, which is not what pacman does, but I could be wrong about this. I'm somewhat more hopeful for the 2nd question though.

Last edited by expatiate-orangutans (2022-09-15 00:31:51)

Offline

#2 2022-09-15 00:05:22

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,428

Re: [SOLVED] Upgrade linux without removing existing kernel modules

You can install and enable the service for https://archlinux.org/packages/communit … ules-hook/ which will copy your kernel modules on linux updates and remove old ones when you reboot.

Offline

#3 2022-09-15 00:16:57

expatiate-orangutans
Member
Registered: 2019-07-11
Posts: 6

Re: [SOLVED] Upgrade linux without removing existing kernel modules

Neat! I got 80% of the way through writing up a proposed solution, but it sounds like this is more or less what I came up with, except arguably better. This is probably solved, but I should probably try it first.

Offline

#4 2022-09-15 00:31:08

expatiate-orangutans
Member
Registered: 2019-07-11
Posts: 6

Re: [SOLVED] Upgrade linux without removing existing kernel modules

Okay, it works as expected, so my immediate problem is solved.

However, I didn't find this when looking at the wiki or forums. I checked now and the only article which mentions this package is https://wiki.archlinux.org/title/Genera … leshooting. Some of the articles which I checked include:

- https://wiki.archlinux.org/title/Kernel_module
- https://wiki.archlinux.org/title/Kernel
- https://wiki.archlinux.org/title/Pacman
- https://wiki.archlinux.org/title/Pacman/Tips_and_tricks

Which all seem like they might be good places to link to the explanation of kernel-modules-hook. Are there any articles where you think such a reference definitely _does not_ belong?

UPDATE:

Added a note on this to tips-and-tricks. IMO it should probably go more places, but that's something for now.

Last edited by expatiate-orangutans (2022-09-15 00:46:34)

Offline

Board footer

Powered by FluxBB