Due to an older version available of sysutils/debootstrap, Ubuntu 22.04 LTS (Jammy) cannot be installed directly.
Anyhow a running version of the latest Ubuntu release can be easily achieved.
The required steps are:
1. Install Ubuntu 20.04 LTS Focal
Follow the instructions at https://wiki.freebsd.org/LinuxJails.
Be aware of the required fix (to be run outside the jail).
Credit for the fix goes to https://www.micski.dk/2021/12/21/in...tem-into-freebsds-linux-binary-compatibility/ which by the way provides helpful information about setting up an Ubuntu jail in FreeBSD.
2. Install and run Ubuntu update manager
The '-d' option is required until 22.04.1 release has appeared, otherwise 'do-release-upgrade' will do nothing.
Then review outputs and confirm if everything is fine. It is recommended to remove obsolete packages if prompted.
3. Correct the library fix
Correct the fix from step 1 (outside of chroot) for the new library path:
4. Confirm
Inside the jail:
5. Optional: Reboot host
I had the experience that things were not too stable in the jail until rebooting the host after this. There may be other fixes though.
Anyhow a running version of the latest Ubuntu release can be easily achieved.
The required steps are:
1. Install Ubuntu 20.04 LTS Focal
Follow the instructions at https://wiki.freebsd.org/LinuxJails.
Be aware of the required fix (to be run outside the jail).
Code:
# cd /compat/ubuntu/lib64/
# rm ./ld-linux-x86-64.so.2
# ln -s ../lib/x86_64-linux-gnu/ld-2.31.so ld-linux-x86-64.so.2
2. Install and run Ubuntu update manager
Code:
# apt install update-manager-core
# do-release-upgrade -d
The '-d' option is required until 22.04.1 release has appeared, otherwise 'do-release-upgrade' will do nothing.
Then review outputs and confirm if everything is fine. It is recommended to remove obsolete packages if prompted.
3. Correct the library fix
Correct the fix from step 1 (outside of chroot) for the new library path:
Code:
# cd /compat/ubuntu/lib64/
# rm ./ld-linux-x86-64.so.2
# ln -s ../lib/x86_64-linux-gnu/ld-linux-x86-64.so.2 ld-linux-x86-64.so.2
4. Confirm
Inside the jail:
Code:
# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.1 LTS
Release: 22.04
Codename: jammy
5. Optional: Reboot host
I had the experience that things were not too stable in the jail until rebooting the host after this. There may be other fixes though.