Can't update system because of zfs-linux dependency even though zfs update is available

I installed zfs-linux from the AUR with yay. I now can’t update the system because I get the following error message

failed to prepare transaction (could not satisfy dependencies)
:: installing linux (5.15.2.arch1-1) breaks dependency ‘linux=5.14.16.arch1-1’ required by zfs-linux
→ error installing repo packages

From the arch wiki I understand that this is to be expected if zfs-linux hasn’t been updated yet, but it has. When I first remove zfs-linux with

yay -R zfs-linux

then update the system with

yay

and install zfs linux again with

yay -S zfs-linux

everything installed just fine and my system is up to date.

Is this what is called a dependency loop?
I don’t want to have to un- and re-install zfs-linux every time I update, what is the proper way to solve this in the future?

If you are using zfs on a critical drive such as /, I would recommend adding the archzfs repo above the arch repos in pacman.conf. Then it will just magically work.

If you are only using zfs for storage devices, I would switch to zfs-dkms which should make that process cleaner.

4 Likes

I had old zfs-linux-lts 6.1.28 and linux-lts 6.1.28 in VM.

I got the similar error messages:

$ paru -Syu

...
...
error: could not find all required packages:
    linux-lts-headers=6.1.30-1 (wanted by: zfs-linux-lts)
    linux-lts=6.1.30-1 (wanted by: zfs-linux-lts)

$ paru -S linux-lts

resolving dependencies...
looking for conflicting packages...
error: failed to prepare transaction (could not satisfy dependencies)
:: installing linux-lts (6.1.31-1) breaks dependency 'linux-lts=6.1.28-1' required by zfs-linux-lts

If you want to use zfs-linux-lts instead zfs-dkms, there is a trick:

  1. Fetch two old matching Linux packages into pacman cache: /var/cache/pacman/pkg/

$ sudo downgrade linux-lts linux-lts-headers
and select two matching versions 6.1.30 for zfs-linux-lts.

  1. Install these Linux packages from the cache:
$ cd /var/cache/pacman/pkg
$ sudo pacman -U --nodeps linux-lts-6.1.30-1-x86_64.pkg.tar.zst linux-lts-headers-6.1.30-1-x86_64.pkg.tar.zst
  1. Install the current version of zfs-linux-lts
    $ paru -S zfs-linux-lts

  2. Do not forget to rebuild initramfs again
    $ sudo reinstall-kernels

Reboot, that works for me in VM, it is just a test.

@Zesko this topic is two years old. maybe it makes more sense to create a new one.

I don’t see any difference between this old topic and today’s same problem.
I made the solution for ZFS users here, if they have the same problem today or in the “future”.

If you disagree, I or admin can delete this solution.

I don’t need to create duplicates of topic.

1 Like

don’t worry, it’s totally ok with me. just wanted to point out that the thread is already two years old. maybe you missed it. all is well