[Pkg-zfsonlinux-devel] Bug#1135579: Bug#1135579: zfs-dkms does not compile with Linux 7.0

Craig Sanders debbugs at taz.net.au
Sun May 3 13:03:53 BST 2026


On Sun, May 03, 2026 at 02:04:53AM +0200, Linus Lüssing wrote:
> Updating to linux-image-7.0.3+deb14-amd64 conflicts with this zfs-dkms
> package:
>
> ```
> $ apt update && apt dist-upgrade
> [...]
> Autoinstall of module zfs/2.4.1 for kernel 7.0.3+deb14-amd64 (x86_64)
> Running the pre_build script..............(bad exit status: 1)
> Failed command:
> cd /var/lib/dkms/zfs/2.4.1/build/ && /var/lib/dkms/zfs/2.4.1/build/configure --disable-dependency-tracking --prefix=/usr --with-config=kernel --with-linux=/lib/modules/7.0.3+deb14-amd64/source --with-linux-obj=/lib/modules/7.0.3+deb14-amd64/build --with-qat= --host= --enable-linux-experimental
> Consult /var/lib/dkms/zfs/2.4.1/build/make.log for more information.
> [...]


A variant of this issue comes up every time there's a major new kernel release
or major changes to the kernel APIs, and the solution is the same every time:

If you're using zfs-dkms or any other out-of-tree kernel module, DO NOT
UPGRADE YOUR KERNEL UNTIL YOU'RE ABSOLUTELY CERTAIN IT'S COMPATIBLE WITH YOUR
MODULES.

BTW, this issue is not specific to ZFS, it's the same for every out-of-tree
kernel module including those packaged for debian (e.g. nvidia-kernel-dkms)
and those you might have downloaded from github or a manufacturer's web site
or wherever.

And the solution is the same for all of them - don't try to upgrade your
kernel when you need out-of-tree modules that haven't been proven to compile
against the new kernel.

You're using a non-standard kernel module. You have to accept that things can
and will go wrong from time to time.  That means there will be extra work
involved and it's up to YOU to do the essential systems administration tasks
so that your system doesn't break.



Here's an easy to follow guide on how to do that:

1. HOLD

   Use `apt-mark` to hold your kernel packages. e.g. on amd64, run:

       apt-mark hold linux-image-amd64 linux-headers-amd64 linux-base-amd64

   Run this NOW and after every time you upgrade the kernel. This will stop
   the debian kernel packages from being automatically upgraded.

   I've been running ZFS on my debian systems since around 2010 and the only
   times I ever have a problem upgrading to new kernels is when I forget to
   hold them again after an upgrade.

   Same with the proprietary nvidia driver on my systems with nvidia cards,
   and same with the drivers for sensor chipsets (temp, voltage, etc) on some
   of my systems. And other non-standard drivers I've needed over the years.


2. WAIT, AND HAVE SOME PATIENCE.

   Do not try to upgrade your kernel until you know for sure that the zfs-dkms
   package has been updated to work with the kernel you are trying to install.

   It might take a few days or a few weeks or even months, but eventually a
   new zfs-dkms package will be released that compiles against the new kernel.

   Unless you're part of the development or debugging effort, there is no
   point in trying to upgrade your kernel until the new, compatible, module
   package is released.


3. WAIT SOME MORE

   Even when a new zfs-dkms module is installed, DON'T INSTALL IT ONTO YOUR
   REAL SYSTEM IMMEDIATELY.

   Set up a VM just for testing kernel upgrades and make sure that both the
   new zfs-dkms AND the new kernel will install.

   It's not 100% necessary, but it's useful to have a few zfs pools on the testing
   VM so you can make sure that the kernel & zfs not only compiled and install but
   that it actually works.

   You do not want to risk the filesystem on your real/production systems (and
   all your important files) with untested new versions.

   If all seems fine, then, AND ONLY THEN, should you attempt to upgrade zfs
   and the kernel on your real system(s).

   A testing VM like this is also useful for practising the steps to fix the
   problems you caused by being over-eager to upgrade (e.g. step 5 below).


4. INSTALL AND HOLD AGAIN

   Whenever you do upgrade the kernel, remember to hold the packages again
   (same as in step 1) after the upgrade completes.  I usually do it like so:

       apt-get -u install linux-image-amd64 linux-headers-amd64 linux-base-amd64
       apt-mark hold linux-image-amd64 linux-headers-amd64 linux-base-amd64

   If you don't want to rely on your bash history for that, I suggest
   you put those commands into a shell script and call it something like
   /usr/local/bin/upgrade-kernel.sh

   And if you have dlocate installed, maybe add the following to the script.
   They'll prevent old kernel images from being auto-uninstalled before you're
   ready to uninstall them yourself.

       update-dlocatedb
       apt-mark manual $(dlocate -k | grep -v linux-doc)


5. REPAIRING A FAILED KERNEL UPGRADE

   While you're waiting for the new zfs-dkms package, to stop apt from
   complaining about failed kernel upgrades, you'll need to downgrade
   linux-image-amd64, linux-headers-amd64, and linux-base-amd64 back
   to the previous working version.  You might find them in your
   /var/cache/apt/archives/ if you haven't cleared it out recently.

   e.g. for 6.19.14:

       cd /var/cache/apt/archives
       dpkg -iBE linux-base-amd64_6.19.14-1_amd64.deb linux-image-amd64_6.19.14-1_amd64.deb linux-headers-amd64_6.19.14-1_amd64.deb
       apt-mark hold linux-image-amd64 linux-headers-amd64 linux-base-amd64

   If they're not in your /var/cache/apt/archives, you'll have to download
   them from a debian repo.  If you're running debian 'testing' or 'unstable',
   they may no longer even exist in the debian archives, so maybe get into the
   habit of keeping backup copies of kernel packages after every upgrade. A
   few minutes of planning and preparation can prevent hours of stressful
   system repair work.

   Then purge the 7.0 packages:

       apt-get purge linux-base-7.0.3+deb14-amd64 linux-image-7.0.3+deb14-amd64 \
         linux-headers-7.0.3+deb14-amd64 linux-headers-7.0.3+deb14-common \
         linux-modules-7.0.3+deb14-amd64 linux-kbuild-7.0.3+deb14



If you don't follow these common-sense steps, you will have what is known as a
"self-created problem".

Practice some discipline, don't upgrade to the latest shiniest thing just
because it has been released.  Test first, deploy only if it works.



More information about the Pkg-zfsonlinux-devel mailing list