Skip to content

Instantly share code, notes, and snippets.

@lidgnulinux
Created April 29, 2024 23:47
Show Gist options
  • Save lidgnulinux/b326755f4c4b1ed91c39d338531cb45b to your computer and use it in GitHub Desktop.
Save lidgnulinux/b326755f4c4b1ed91c39d338531cb45b to your computer and use it in GitHub Desktop.

Installing Ubuntu Via Minimal Archive

This is a simple guide for installing Ubuntu using minimal archive. I knew it some days ago, Ubuntu provides a minimal archive / rootfs which we can use to have a minimal Ubuntu system. We will use it to get a minimal and quite usable Ubuntu distro.

Requirements.

We will need some requirements, like :

  • A live bootable USB, I use slax, you can use whatever you want.
  • An internet connection, we will use it download some packages.
  • A partition for system (root, /), you can also have a swap if you need it.
  • Ubuntu minimal rootfs / archive, you can download it here

https://cdimage.ubuntu.com/ubuntu-base/daily/current/

note : I use the amd64 version.

Instalation Steps.

If you familiar with debootstrap or installing archlinux, it's almost basically same.

  1. Booting the live bootable usb.

  2. Format, mount partition.

    # mkfs.ext4 /dev/sdaX
    # mount /dev/sdaX /mnt
    

    note : You can format the partition with other format, I use ext4.

  3. Download and unpack the minimal archive.

    # cd /mnt
    # wget -c https://cdimage.ubuntu.com/ubuntu-base/daily/current/noble-base-amd64.tar.gz
    # tar -xvf noble-base-amd64.tar.gz
    
  4. Mount some file systems and chroot.

    # mount -t proc proc proc
    # mount -o bind /dev dev/
    # mount -o bind /sys sys/
    # mount -o bind /run run/
    # chroot /mnt /usr/bin/bash
    
  5. Update the repository.

    # apt update
    # apt upgrade
    
  6. Install some tools.

    # apt install vim locales dialog isc-dhcp-client wpasupplicant
    iproute2
    
  7. Configure locales and timezone.

    # dpkg-reconfigure locales
    # dpkg-reconfigure tzdata
    
  8. Edit fstab.

    UUID=2d3b91ab-4936-4fb1-add6-b820adbd0b6c /               ext4    errors=remount-ro 0 1
    

    Note : that's just an example.

  9. Install kernel, grub, dracut, systemd-sysv package.

    # apt install linux-image-generic dracut grub-pc systemd-sysv
    

    note: we need to install systemd-sysv to fix error on dracut (error installing "poweroff", "halt" and "reboot" when generating initrd).

  10. Install linux-firmware (optional).

    # apt install linux-firmware 
    
  11. Set root password.

    # passwd
    
  12. Generate initrd using dracut.

    # dracut -f --regenerate-all
    
  13. Install grub & update grub.

    # grub-install /dev/sdX
    # grub-mkconfig -o /boot/grub/grub.cfg
    
  14. Unmount some filesystems.

    # umount /mnt/proc
    # umount /mnt/dev
    # umount /mnt/sys
    # umount /mnt/run
    # cd /
    # umount /mnt
    
  15. Reboot.

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