Here is my version of how I approached the problem:
- Create a VM in VirtualBox if you haven't already.
- Configure it to use EFI, that's just how I prefer to do things and it may also be easier copying the contents from the VM to a USB drive if you use only UEFI capable computers.
- Configure port forwarding in the network settings, I forwarded host port 55222 to guest port 22. When you install OpenSSH server after the installation finished and rebooted into your new system you have the benefits of using features like copy and paste through SSH and displaying more content while you are without the GUI.
- Download minimal Network Boot mini.iso.
- Boot and follow the installer instructions. Create a GPT partition table and the following partitions:
- Create a FAT16 EFI (mountpoint
/boot/efi
) partition with 10MB.
- Create a EXTt4 root partition with 3990MB. Set EXT4 reserved blocks to 1% instead of 5%. It's generally not recommended, but if you want to make the most of the available space this an option you have.
- After the installation of the minimal system has been completed and you booted into the system the first time you can do the following:
- Remove swapfile from / and fstab.
- Remove plymouth package and replace
splash
with nosplash
in /etc/default/grub
, run update-grub
. Removing plymouth from initramfs (happens in the next step) saves a few more MB.
- Change to COMPRESS=xz and BUSYBOX=n
/etc/initramfs-tools/initramfs.conf
and run update-initramfs -u
. This will boot a bit slower, but saves about 10MB of initramfs. You can save more (up to 25MB) with MODULES=dep, but at the risk of non-bootable OS on some systems.
- Remove manpages package if you think you will never need them and rather look them up on http://manpages.ubuntu.com/.
- If you are sure you can also remove these packages: busybox-static grub-efi-amd64-signed linux-signed-generic shim-signed secureboot-db sbsigntool ubuntu-advantage-tools wamerican wbritish dictionaries-common emacsen-common mokutil shim intel-microcode
- Run
apt autoremove
.
- Set
SystemMaxUse=10MB
in /etc/systemd/journald.conf
.
- Install the desktop with
sudo apt-get install lubuntu-desktop --no-install-recommends
as suggested by N0rbert.
My previous approach was to look at the dependencies of lubuntu-desktop package and decide what I don't need. I came up with this list of packages I don't need: genisoimage plymouth-theme-lubuntu-logo plymouth-theme-lubuntu-text software-properties-qt.
So this is the list of packages I installed:
alsa-base alsa-utils anacron arc-theme bc bluedevil breeze-cursor-theme ca-certificates dbus-x11 desktop-file-utils fcitx fcitx-frontend-qt5 fcitx-ui-qimpanel ffmpegthumbnailer fonts-dejavu-core fonts-freefont-ttf foomatic-db-compressed-ppds fwupdate ghostscript-x gvfs-backends gvfs-fuse inputattach kde-style-breeze libfm-modules libmtp-runtime libqt5svg5 libsasl2-modules libu2f-udev lubuntu-artwork lubuntu-default-settings lxqt-about lxqt-admin lxqt-core lxqt-openssh-askpass lxqt-powermanagement lxqt-sudo mobile-broadband-provider-info modemmanager network-manager nm-tray obconf-qt openbox openprinting-ppds oxygen-icon-theme papirus-icon-theme pavucontrol-qt pcmanfm-qt pinentry-qt printer-driver-gutenprint printer-driver-pnm2ppa pulseaudio pulseaudio-module-bluetooth qterminal qttranslations5-l10n rfkill sddm sddm-theme-lubuntu spice-vdagent ubuntu-drivers-common ubuntu-mono ubuntu-release-upgrader-qt unzip usb-creator-kde usb-modeswitch whoopsie wireless-tools wpasupplicant wvdial x11-utils xdg-user-dirs xkb-data xorg xscreensaver xz-utils zip
Adding the --no-install-recommends
will save even more space.
My result (with recommends):
df -h
/dev/nvme0n1p2 3.6G 3.1G 495M 87% /
sudo apt clean
/dev/nvme0n1p2 3.6G 3.0G 593M 84% /
Yes I installed on NVME instead of SATA in VirtualBox, because you can with EFI. :)
I don't know of a good and small browser, installing Firefox or Chrome and attempting to use them as desktop browsers (or use electron apps, leave alone snaps of flatpaks) will create a lot or cache files. You could mount some directories in RAM if the data is not important and you have plenty of RAM, but you are going to hit the limitations of this setup soon I think.