Skip to content

Instantly share code, notes, and snippets.

@jj1bdx
Created April 11, 2024 08:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jj1bdx/47c17117fa3d8365221249d15f6f85bc to your computer and use it in GitHub Desktop.
Save jj1bdx/47c17117fa3d8365221249d15f6f85bc to your computer and use it in GitHub Desktop.
Ubuntu conversion from Desktop to Server

Ubuntu conversion from Desktop to Server

Source: https://www.technomancer.com/archives/789

# Do this as a root
# Install Ubuntu Server, after stopping unattended upgrades
systemctl disable unattended-upgrades
systemctl set-default multi-user.target
apt update && apt -y upgrade 
apt install ubuntu-server
# Getting rid of Firefox snap
systemctl stop var-snap-firefox-common-host\\x2dhunspell.mount
systemctl disable var-snap-firefox-common-host\\x2dhunspell.mount
# Remove all snaps (repeat this until no snap is left)
for snap in $( snap list | tail -n +2 | awk '{ print $1; }' ); { snap remove --purge $snap; } ; snap list
# Purge all of the leftover desktop packages
# (Other desktop packages should also be removed manually)
apt purge ubuntu-desktop ubuntu-desktop-minimal \
    cups pipewire-bin modemmanager pulseaudio \
    xdg-dbus-proxy wpasupplicant snapd \
    avahi-autoipd avahi-daemon \
    firefox -y
apt autoremove -y
apt autoclean
# Reboot after this
systemctl reboot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment