By Merijn Hendriks, 2025-05-26
- 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.
- Download ubuntu desktop (iso)
- Flash it on an usb stick (use rufus on windows, GPT)
- Boot from the usb stick (usually rapidly tap f9 during boot)
- Select try ubuntu
If you want to clear windows boot entries, use:
# replace 0x0000 with the bootloader entry
sudo efibootmgr -b 0x0000 -B- Open drive in gdisk
sudo gdisk
type device filename: /dev/nvme0n1- Reformat drive to GPT partition table
Command: o
Proceed: y- Create new boot partition
Command: n
Number: default
First sector: default
Last sector: +500M
Flag: ef00 # ESP- 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- Create new root partition
Command: n
Number: default
First sector: default
Last sector: default
Flag: 8304 # x86_64 root- Write changes to disk
Command: w
Proceed: y- Format root partition as ext4
sudo mkfs -t ext4 /dev/nvme0n1p3- Mount root partition (
/dev/nvme0n1p3)
sudo mount /dev/nvme0n1p3 /mnt- Mount boot partition (
/dev/nvme0n1p1)
sudo mkdir /mnt/boot
sudo mount /dev/nvme0n1p1 /mnt/boot- 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- Extract ubuntu base
cd /mnt
sudo tar zxfm ~/Downloads/ubuntu-base.tar.gz- Make system parts available in chroot
sudo mount --rbind /dev /mnt/dev
sudo mount --bind /proc /mnt/proc
sudo mount --bind /sys /mnt/sys- Make internet available in chroot
sudo cp /etc/resolv.conf /mnt/etc/resolv.conf- Enter chroot
sudo chroot /mnt- Update packages and sources
# superuser
apt update
apt upgrade - Install text editor
# superuser
apt install --no-install-recommends nano- Install kernel
# superuser
apt install -y --no-install-recommends linux-generic dialog language-pack-en- 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- Install dracut
# superuser
apt install --no-install-recommends dracut binutils zstd- Install hardware support
Wireless
# superuser
apt install --no-install-recommends iw wireless-regdbBluetooth
# superuser
apt install --no-install-recommends bluez- Enable services
# superuser
systemctl enable networkd-dispatcher.service- Add
kernel-installconfig
# superuser
nano /etc/kernel/install.conflayout=uki
initrd_generator=dracut
uki_generator=dracut- Change default dracut settings
# superuser
nano /etc/dracut.confhostonly="yes"
compress="zstd"
uefi="yes"- Install bootloader
# superuser
apt install --no-install-recommends systemd-boot
systemctl enable systemd-boot-update.service
bootctl install- Generate uki
# superuser
dpkg-reconfigure linux-image-$(uname -r)- Change root password
# superuser
passwdIf 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.
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-sysvover others?
Easiest to get going and integrate with DE shells of all the other options.
Q: UKI generator: Why
dracutoversystemd-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-bootoverefibootmgrorgrub?
efibootmgr: possible, but far more error prone and to manage.grub: too big and complex for me to manage.
Q: Initrd generator: Why
dracutovermkosiorinitramfs-tools?
initramfs: dropped it as ubuntu is moving away from it too,mkosihas both a larger dependency tree and requires more configuration.
Q: Compression: Why
zstdovergzip?
Much faster and better compression all around.
- https://wiki.ubuntu.com/Base
- https://wiki.ubuntu.com/Base/InstallationExample
- https://wiki.archlinux.org/title/EFI_system_partition#Create_the_partition
- https://wiki.archlinux.org/title/Systemd
- https://wiki.archlinux.org/title/Systemd-boot
- https://wiki.debian.org/EFIStub
- https://copyninja.in/blog/enable_ukify_debian.html
- https://wiki.gentoo.org/wiki/Unified_kernel_image
- https://superuser.com/questions/1720216/chown-operation-not-permitted-even-as-root-user
- https://askubuntu.com/questions/1225791/how-to-replace-grub-with-bootloader-systemd-boot-in-ubuntu-20-04
- https://discourse.ubuntu.com/t/please-try-out-dracut/48975
- https://bbs.archlinux.org/viewtopic.php?id=287790
- https://forum.artixlinux.org/index.php/topic,4969.0.html
- https://wiki.gentoo.org/wiki/Doas
- https://wiki.archlinux.org/title/Doas
- https://www.reddit.com/r/Ubuntu/comments/jszveh/howto_opendoas_on_ubuntu/
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