Skip to content

nix-env -u \* upgrades zfs package to the wrong kernel version #154

Closed

Description

@ivan
# uname -a
Linux nixos-vanilla 3.4.54 #1 SMP Tue Jul 23 21:48:39 UTC 2013 x86_64 GNU/Linux

# nix-env -i zfs-0.6.1-3.4.54
warning: there are multiple derivations named `zfs-0.6.1-3.4.54'; using the first one
installing `zfs-0.6.1-3.4.54'
building path(s) `/nix/store/f8jr5yalaarknsy3kvnjjp5dbpxw6c4s-user-environment'
created 305 symlinks in user environment

# nix-env -u \*
upgrading `zfs-0.6.1-3.4.54' to `zfs-0.6.1-3.10.3'

(eventually fails)

I'm guessing the package-version-kernelversion scheme worked better for kernel module packages that don't need to be in the user environment, but zfs includes a userspace utility for managing ZFS filesystems.

Please let me know if I'm doing it wrong, or if there's some workaround I'm missing.

Activity

  1. vcunat commented on Aug 8, 2013

    @vcunat
    Member

    User envs aren't well suited for kernel-dependent packages. (EDIT: or anything system-dependent)

    If you have NixOS, then it's better to have it in the system env (you have the kernelPackages attribute accessible there, so you can get compatible packages).

  2. vcunat commented on Aug 8, 2013

    @vcunat
    Member

    If you prefer user envs, then attribute-based approach is better than name-based one anyway. You can nix-env -iA linuxPackages_3_4.zfs. Upgrades are then best done via expressions with attributes you need, e.g. like in https://nixos.org/wiki/Howto_keep_multiple_packages_up_to_date_at_once

  3. ivan commented on Aug 8, 2013

    @ivan
    SponsorMemberAuthor

    Thanks. I rebuilt my system with boot.supportedFilesystems = [ "ext4" "zfs" ];, which is all I needed to get zfs and zpool in root's PATH. I thought I already did this, but I commented it out while debugging another zfs-in-initrd issue.

    I made a bad assumption earlier: I thought root needed zfs in its own environment as well. The source of this bad assumption was some earlier experimentation where I had different versions of systemd in the system env and user env.

  4. added a commit that references this issue on Jan 1, 2024
  5. added a commit that references this issue on Aug 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions