The Ubuntu Asahi flavor of Ubuntu 23.04 (Lunar) includes kernel version 6.5 from Ubuntu 23.10 (Mantic), with the Asahi-specific patches applied on top (for the stuff that hasn't been upstreamed yet).

That kernel already brings ZFS 2.2.0~rc3 and there is also a ticket for updating the version to the 2.2.0 release.

How do we get ZFS 2.2 userland into Ubuntu 23.04? We could install packages from 23.10, but that will likely cause dependency problems.

So let's build the packages ourselves instead (until somebody creates a PPA):

# get sources and switch to 2.2 release
$ git clone https://github.com/openzfs/zfs
$ git checkout zfs-2.2-release

# workaround for some crypto functionality that is marked as GPL-only on arm64
$ sed -i 's/CDDL/GPL/' META

# build
$ sh autogen.sh
$ ./configure
$ make native-deb-utils

# install
$ sudo apt install ../openzfs-libuutil3_2.2.0-0_arm64.deb 
$ sudo apt install ../openzfs-libnvpair3_2.2.0-0_arm64.deb 
$ sudo apt install ../openzfs-libzfs4_2.2.0-0_arm64.deb 
$ sudo apt install ../openzfs-libzpool5_2.2.0-0_arm64.deb 
$ sudo apt install ../openzfs-libzfsbootenv1_2.2.0-0_arm64.deb 
$ sudo apt install ../openzfs-libpam-zfs_2.2.0-0_arm64.deb 
$ sudo apt install ../openzfs-zfsutils_2.2.0-0_arm64.deb

Don't install openzfs-zfs-dkms_2.2.0-0_all.deb, as it conflicts with the built-in ZFS driver in the Ubuntu kernel, resulting in apt trying to remove the kernel and module packages which would break your system.