Start with a clean Ubuntu Server

Streamlining the default install
2022-12-04

Mostly a note for myself.

This list is for Ubuntu Server 24.04 (jammy):

sudo apt purge
    cloud-guest-utils \
    cloud-init \
    cloud-initramfs-copymods \
    cloud-initramfs-dyn-netconf \
    open-vm-tools \
    snapd \
    sosreport \
    ubuntu-advantage-tools
sudo apt autoremove

And when I update, I run

sudo apt update
sudo apt upgrade
sudo shutdown -r now  # if necessary

grep -rl buster /etc/apt/ | sudo xargs sed -i 's/buster/bullseye/g'
sudo apt update
sudo apt dist-upgrade
sudo shutdown -r now

sudo apt autoremove
sudo apt autoclean
dpkg --list

and remove old packages, like older gcc packages, if any.