Install ZFS On Debian 12
Related Posts
Steps
To install ZFS, we need to add the contrib
package repository to Debian, which relies on packages in the non-free
repository,
which we thus need to also include.nFor my Debian 12 installations (installed through cloud-init), this was done by editing the
Debian sources file....
sudo editor /etc/apt/sources.list.d/debian.sources
.. and simply adding non-free non-free-firmware contrib
to the Components
list like so:
Types: deb deb-src
URIs: mirror+file:///etc/apt/mirrors/debian.list
Suites: bookworm bookworm-updates bookworm-backports
Components: main non-free non-free-firmware contrib
Types: deb deb-src
URIs: mirror+file:///etc/apt/mirrors/debian-security.list
Suites: bookworm-security
Components: main non-free non-free-firmware contrib
Then we just need to update the package list and install the ZFS packages like so:
sudo apt update \
&& sudo apt install linux-headers-amd64 zfsutils-linux zfs-dkms zfs-zed -y
This will result in getting a large message outlining the subtleties of the open source licensing issue with ZFS (which is why it has been put in the contrib repository) which you just need to accept before the ZFS kernel module then gets compiled and added to your system.
Checking Version
At this point I rebooted and then checked my ZFS version by running:
zfs version
This output:
zfs-2.1.11-1
zfs-kmod-2.1.11-1
References
First published: 11th September 2023