Score:0

Why is the zfs-dracut package kept back?

de flag

I have recently upgraded from ubuntu 18.04 to 22.04, which also upgraded my zfs versions ... except for this one package, zfs-dracut. It "has been kept back".

As can be seen in the output of apt policy zfs-dracut, the problem is not that it's a phased upgrade.

generic@motorbrot:/media/generic$ sudo apt upgrade
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
  alsa-ucm-conf firmware-sof-signed ubuntu-advantage-tools zfs-dracut
# [more irrelevant stuff here]

generic@motorbrot:~$ sudo apt policy zfs-dracut
zfs-dracut:
  Installed: 0.8.4-1
  Candidate: 2.1.4-0ubuntu0.1
  Version table:
     2.1.4-0ubuntu0.1 500
        500 http://archive.ubuntu.com/ubuntu jammy-updates/universe amd64 Packages
        500 http://security.ubuntu.com/ubuntu jammy-security/universe amd64 Packages
     2.1.2-1ubuntu3 500
        500 http://archive.ubuntu.com/ubuntu jammy/universe amd64 Packages
 *** 0.8.4-1 100
        100 /var/lib/dpkg/status

My zfs version is currently:

generic@motorbrot:~$ zfs --version
zfs-2.1.4-0ubuntu0.1
zfs-kmod-2.1.4-0ubuntu0.1

While there are many questions on askubuntu asking about why "packages have been kept back", the answers tend to suggest the following:

  • it's a phased update. just wait.
    That would show up in the apt policy output though.
  • just install it ( apt install --upgrade-only zfs-dracut, apt install zfs-dracut, apt full-upgrade, apt-get --with-new-pkgs upgrade, ... )
    None of these made a difference.
  • The package was marked as held back.
    It is in my case not, sudo apt-mark showhold zfs-dracut has no output.
  • just purge and reinstall it.
    I could do that, but I am worried it might have been held back for a good reason and purging it would break something. Especially since I am running zfs on root.

Why was this package held back?
(and How could I figure that out myself? )


To follow-up on the comments: Here is what happens when I do some of the things I have mentioned to not work. These excerpts are more current, so contain other packages too. Those others are phased as per apt policy.

generic@motorbrot:/media/generic$ sudo apt list --upgradeable
[sudo] password for generic: 
Listing... Done
alsa-ucm-conf/jammy-updates,jammy-updates 1.2.6.3-1ubuntu1.4 all [upgradable from: 1.2.6.3-1ubuntu1.3]
libnvpair3linux/jammy-updates 2.1.5-1ubuntu6~22.04.1 amd64 [upgradable from: 2.1.4-0ubuntu0.1]
libuutil3linux/jammy-updates 2.1.5-1ubuntu6~22.04.1 amd64 [upgradable from: 2.1.4-0ubuntu0.1]
libzfs4linux/jammy-updates 2.1.5-1ubuntu6~22.04.1 amd64 [upgradable from: 2.1.4-0ubuntu0.1]
libzpool5linux/jammy-updates 2.1.5-1ubuntu6~22.04.1 amd64 [upgradable from: 2.1.4-0ubuntu0.1]
python3-pyzfs/jammy-updates 2.1.5-1ubuntu6~22.04.1 amd64 [upgradable from: 2.1.4-0ubuntu0.1]
ubuntu-advantage-tools/jammy-updates 27.13.5~22.04.1 amd64 [upgradable from: 27.13.3~22.04.1]
zfs-dkms/jammy-updates,jammy-updates 2.1.5-1ubuntu6~22.04.1 all [upgradable from: 2.1.4-0ubuntu0.1]
zfs-dracut/jammy-updates 2.1.5-1ubuntu6~22.04.1 amd64 [upgradable from: 0.8.4-1]
zfs-initramfs/jammy-updates 2.1.5-1ubuntu6~22.04.1 amd64 [upgradable from: 2.1.4-0ubuntu0.1]
zfs-test/jammy-updates 2.1.5-1ubuntu6~22.04.1 amd64 [upgradable from: 2.1.4-0ubuntu0.1]
zfs-zed/jammy-updates 2.1.5-1ubuntu6~22.04.1 amd64 [upgradable from: 2.1.4-0ubuntu0.1]
zfsutils-linux/jammy-updates 2.1.5-1ubuntu6~22.04.1 amd64 [upgradable from: 2.1.4-0ubuntu0.1]

generic@motorbrot:/media/generic$ sudo apt full-upgrade
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
  alsa-ucm-conf libnvpair3linux libuutil3linux libzfs4linux libzpool5linux python3-pyzfs
  ubuntu-advantage-tools zfs-dkms zfs-dracut zfs-initramfs zfs-test zfs-zed zfsutils-linux
0 upgraded, 0 newly installed, 0 to remove and 13 not upgraded.

Warning: an answer suggests to run apt install zfs-dracut dracut zfsutils-linux. That, in my case, uninstalled zfs-initramfs, issued a warning, then failed installing zfs-dracut, and because I am more curious than is healthy I rebooted and now was stuck with an initramfs that does not know zfs. I fixed this up from a live stick but this is not a great outcome anyway.
For anyone in the same situation: I essentially followed this guide: Boot from a live-usb stick, import but don't mount your zfs pool, mount a snapshot back from when booting still worked with zfs mount -t zfs tank/your_dataset@something /mnt/rescue, bind-mount all that is needed (especially boot and efi partitions), chroot into it and run update-initramfs -u -k all (or at least the latest kernel version that shows up in ls -la /lib/modules).

These proposed fixes are potentially useful (or harmful), but essentially miss to answer my question: Why was zfs-dracut kept back?

Sidenote for people with this exact same problem: The actual fix was to completely uninstall zfs-dracut and re-install zfs-initramfs, then running update-initramfs -u -k all again.
This is irrelevant to the question though.

user535733 avatar
cn flag
`zfs-dracut/jammy-updates 2.1.5-1ubuntu6~22.04.1 amd64 [upgradable from: 0.8.4-1]`. You don't have an *old* package, you have an *ancient* package, This is not obscure-but-normal. It's unusual, and requires troubleshooting.
lucidbrot avatar
de flag
Well, afaict it was the latest available package on ubuntu 18.04. The other zfs packages had similar versions but have upgraded themselves during the upgrade.
Organic Marble avatar
us flag
How, exactly, did you "upgrade from 18.04 to 22.04"? Did you upgrade to 20.04 first, then to 22.04?
lucidbrot avatar
de flag
@OrganicMarble I ran essentially `apt update && apt upgrade && apt autoremove && do-release-upgrade -m "desktop"` once on ubuntu 18.04, which brought me to 20.04, and then once more to get from 20.04 to 22.04. If you think more information is useful (e.g. that i uninstalled ROS, that I chose to use the new `/etc/grub.d/10_linux` file instead of my old lightly patched one, etc) I could edit the question. I took lots of notes - but not sure which part would be relevant.
Organic Marble avatar
us flag
did you run into zfs-dracut problems at the 20.04 step or the 22.04 step? I'm thinking it didn't successfully upgrade to 20.04. wait - looks like you have the 20.04 version installed - although not exactly. Weird, and implies some kind of manual tinkering was done. Latest in 20.04 is 0.8.3-1ubuntu12.14 and yours is newer than that, but older than the 22.04 version.
lucidbrot avatar
de flag
@OrganicMarble hm, could be indeed. I have never before encountered `zfs-dracut` or `dracut` back when I initially set up zfs on root, as far as I can remember. How can you tell it is from 20.04? Sidenote: due to messing up my initramfs after asking this question, I have completely uninstalled zfs-dracut and reinstalled zfs-initramfs and it seems to be working again. I could go to an older snapshot for investigation though
lucidbrot avatar
de flag
@OrganicMarble regarding "manual tinkering" - i originally set up zfs on root before it was really supported. I had [problems](https://askubuntu.com/questions/1246534/why-does-dkms-status-warning-diff-between-built-and-installed-module-happen) when they introduced official support in the kernel, but I really hope that is no longer having any impact. I thought I had switched to the official versions
Organic Marble avatar
us flag
I am running 20.04, although not zfs, and just did an `apt policy zfs-dracut` to get the version # from it. packages.ubuntu.com can also be helpful. I couldn't find 0.8.4-1 anywhere, but EOL releases aren't shown on packages.ubuntu.com I really wonder where that version of the package came from.
Score:3
pl flag

I suspect this is because you're using apt upgrade and not apt dist-upgrade or apt full-upgrade. upgrade won't install packages if there is a requirement to install an additional package as well to fulfil the dependencies. While dist-upgrade and full-upgrade will do that.

zfs-dracut requires dracut and zfsutils-linux (which incidentally may have been mentioned in your "# [more irrelevant stuff here]" section you stripped).

So either sudo apt install zfs-dracut dracut zfsutils-linux or sudo apt dist-upgrade will likely get you out of this.

Artur Meinild avatar
vn flag
Pretty much hitting the nail on the head here. Also, as I understand it, `dist-upgrade` is the historical "Debian" name, while `full-upgrade` is the command name that makes sense on Ubuntu - these commands should do exactly the same - doing a *full upgrade*, including new dependencies.
lucidbrot avatar
de flag
The `#more irrelevant stuff here` was just that it is upgrading some other packages this time. Last time I ran it, there were none of them, hence irrelevant to the question. The packages `dracut-core` and `zfsutils-linux` both show up in `apt list --installed`, so I am thinking they are installed. Pretty sure I've tried the `full-upgrade` before, and it did not help, but I can try again.
lucidbrot avatar
de flag
Huh, wait you said it depends on `dracut`, which is not installed. That could indeed be the issue then... how could I have figured that out on my own, that it depends on that? (Edit: the requirements show up in `apt-cache show zfs-dracut`, i guess that's how.
Artur Meinild avatar
vn flag
When you have upgrade distributions, always do `full-upgrade` because dependencies can have changed.
lucidbrot avatar
de flag
Well, I did do the full upgrade right *before* the release upgrade (and afaik the `do-release-upgrade` command also does it). Pretty sure I also did it again when the message of kept back packages was there, but i can't confidently say that i did.
pl flag
I went to https://packages.ubuntu.com/jammy/zfs-dracut to figure out the dependencies. But yeah, you can use the command-line too.
lucidbrot avatar
de flag
I ran `apt full-upgrade` once more and it did not even try afaict (snippet edited into the question). So I am trying the explicit `apt install` now, and that failed because it tries to access `/lib/modules/4.15.0.101-generic`, which does not exist. Could it be that apt was saying it was held back because it tried and failed to install it?
lucidbrot avatar
de flag
**Warning** to future readers: This can break initramfs' zfs support, and hence can break booting. It did in my case, because while `apt full-upgrade` did nothing, `apt install zfs-dracut dracut zfsutils-linux` uninstalled `zfs-initramfs`, issued a warning, then failed installing `zfs-dracut`. I fixed this up from a live stick but this is not a great outcome anyway.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.