Skip to content

Instantly share code, notes, and snippets.

@MerijnHendriks
Created June 10, 2025 01:39
Show Gist options
  • Save MerijnHendriks/e113f20399893a2ef6907f5ffeea85c0 to your computer and use it in GitHub Desktop.
Save MerijnHendriks/e113f20399893a2ef6907f5ffeea85c0 to your computer and use it in GitHub Desktop.
Installation instructions for Ubuntu Base 25.04

Installing and using Ubuntu Base

By Merijn Hendriks, 2025-05-26

Assumptions

  • You're using an UEFI compatible device
  • You have secure boot disabled
  • You're using a x86_64 processor
  • you got only one NVME drive installed
  • You got 8 GB RAM installed in the system

Thorough the tutorial I'll include comments where you need to make changes for your particular system.

1. Live CD

  1. Download ubuntu desktop (iso)
  2. Flash it on an usb stick (use rufus on windows, GPT)
  3. Boot from the usb stick (usually rapidly tap f9 during boot)
  4. Select try ubuntu

If you want to clear windows boot entries, use:

# replace 0x0000 with the bootloader entry
sudo efibootmgr -b 0x0000 -B

2. Setting up partitions

  1. Open drive in gdisk
sudo gdisk
type device filename: /dev/nvme0n1
  1. Reformat drive to GPT partition table
Command: o
Proceed: y
  1. Create new boot partition
Command: n
Number: default
First sector: default
Last sector: +500M
Flag: ef00              # ESP
  1. Create new swap partition

Change +8G to your RAM value instead

Command: n
Number: default
First sector: default
Last sector: +8G        # RAM size
Flag: 8200              # swap
  1. Create new root partition
Command: n
Number: default
First sector: default
Last sector: default
Flag: 8304              # x86_64 root
  1. Write changes to disk
Command: w
Proceed: y
  1. Format root partition as ext4
sudo mkfs -t ext4 /dev/nvme0n1p3
  1. Mount root partition (/dev/nvme0n1p3)
sudo mount /dev/nvme0n1p3 /mnt
  1. Mount boot partition (/dev/nvme0n1p1)
sudo mkdir /mnt/boot
sudo mount /dev/nvme0n1p1 /mnt/boot

2. Installing ubuntu base

  1. Download the image

Replace 25.04 to the version you want to install

# download ubuntu base
cd ~/Downloads/
wget -O ubuntu-base.tar.gz https://cdimage.ubuntu.com/ubuntu-base/releases/25.04/release/ubuntu-base-25.04-base-amd64.tar.gz
  1. Extract ubuntu base
cd /mnt
sudo tar zxfm ~/Downloads/ubuntu-base.tar.gz
  1. Make system parts available in chroot
sudo mount --rbind /dev /mnt/dev
sudo mount --bind /proc /mnt/proc
sudo mount --bind /sys /mnt/sys
  1. Make internet available in chroot
sudo cp /etc/resolv.conf /mnt/etc/resolv.conf

3. Chroot

  1. Enter chroot
sudo chroot /mnt
  1. Update packages and sources
# superuser
apt update
apt upgrade 
  1. Install text editor
# superuser
apt install --no-install-recommends nano
  1. Install kernel
# superuser
apt install -y --no-install-recommends linux-generic dialog language-pack-en
  1. Install systemd
# superuser
apt install --no-install-recommends systemd-sysv libpam-systemd libnss-systemd systemd-cryptsetup systemd-hwe-hwdb systemd-timesyncd systend-resolved linux-sysctl-defaults networkd-dispatcher
  1. Install dracut
# superuser
apt install --no-install-recommends dracut binutils zstd
  1. Install hardware support

Wireless

# superuser
apt install --no-install-recommends iw wireless-regdb

Bluetooth

# superuser
apt install --no-install-recommends bluez
  1. Enable services
# superuser

systemctl enable networkd-dispatcher.service
  1. Add kernel-install config
# superuser
nano /etc/kernel/install.conf
layout=uki
initrd_generator=dracut
uki_generator=dracut
  1. Change default dracut settings
# superuser
nano /etc/dracut.conf
hostonly="yes"
compress="zstd"
uefi="yes"
  1. Install bootloader
# superuser
apt install --no-install-recommends systemd-boot
systemctl enable systemd-boot-update.service
bootctl install
  1. Generate uki
# superuser
dpkg-reconfigure linux-image-$(uname -r)

4. Managing users

  1. Change root password
# superuser
passwd

Done!

If everything went right, after rebooting you should be greeted with a login prompt.

Your next steps would be making a new user, installing sudo/doas polkit, and installing whatever other packages you need.

FAQ

Q: Why is the /dev/nvme0n1p1 (boot) drive mounted like that?

I had to add user specifiers, otherwise the linux kernel would fail on installation:

unable to make backup link of './boot/System-map.$(uname -r)' before
installing new version: Operation not Permitted
unable to make backup link of './boot/vmlinuz-$(uname -r)' before
installing new version: Operation not Permitted

Q: Init system: Why systemd-sysv over others?

Easiest to get going and integrate with DE shells of all the other options.

Q: UKI generator: Why dracut over systemd-ukify?

Since I'm already using dracut, I might as well use it there too. A couple of less packages to manage.

Q: Bootloaders: Why systemd-boot over efibootmgr or grub?

  • efibootmgr: possible, but far more error prone and to manage.
  • grub: too big and complex for me to manage.

Q: Initrd generator: Why dracut over mkosi or initramfs-tools?

  • initramfs: dropped it as ubuntu is moving away from it too,
  • mkosi has both a larger dependency tree and requires more configuration.

Q: Compression: Why zstd over gzip?

Much faster and better compression all around.

Sources

Notes

Ubuntu Base package information

You can find the information about a package on the following page: https://packages.ubuntu.com/<release-codename>/<package-name>

For example: https://packages.ubuntu.com/plucky/systemd

To get a list of packages, in your chroot environment run

apt list
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment