Install Ubuntu 22.04 Jammy in FreeBSD Jail

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).
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
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

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.
 
Thank you very much for this. This seems like a very clean procedure compared to others I've tried.

After do-release-upgrade I encountered:

Code:
# do-release-upgrade
Checking for a new Ubuntu release
Get:1 Upgrade tool signature [833 B]
Get:2 Upgrade tool [1267 kB]
Fetched 1268 kB in 0s (0 B/s)
authenticate 'jammy.tar.gz' against 'jammy.tar.gz.gpg'
extracting 'jammy.tar.gz'

Reading cache

Checking package manager
Reading package lists... Done
Building dependency tree
Reading state information... Done

Required depends is not installed

The required dependency 'apt (>= 2.0.4)' is not installed.

And after attempting the obvious, I got:

Code:
# apt update
Hit:1 http://archive.ubuntu.com/ubuntu focal InRelease
Reading package lists... Done
Building dependency tree
Reading state information... Done
All packages are up to date.
# apt upgrade apt
Reading package lists... Done
Building dependency tree
Reading state information... Done
apt is already the newest version (2.0.2).
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

The solution for me was:

Code:
# cat << EOF >> /etc/apt/sources.list
deb http://archive.ubuntu.com/ubuntu/ focal-updates main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse
EOF

That allowed me to upgrade apt and proceed.

Just thought I'd share this in case someone else encounters the same.
 
much easier way is to create new debootstrap scripts for lunar and mantic

lunar


mantic


set up

 
Back
Top