← Back to blog

Ubuntu

Productivity

Coding

Video and graphics

System and file repair

  • sudo fsck -f /dev/sdXN
  • sudo apt --fix-broken install
  • sudo dpkg --configure -a
  • sudo kill -9 $(pgrep program)

fsck must run on an unmounted partition, never on the active root filesystem while the system is running.

Drivers and hardware

  • ubuntu-drivers devices
  • sudo ubuntu-drivers autoinstall
  • sudo lshw -short

Network and connectivity

  • sudo resolvectl flush-caches
  • sudo systemctl restart NetworkManager
  • ping google.com

System information

  • hostnamectl
  • lsb_release -a
  • sudo dmidecode -s system-serial-number

Ubuntu Server basics

  • adduser username
  • usermod -aG sudo username
  • sudo hostnamectl set-hostname server-name
  • sudo timedatectl set-timezone Europe/Copenhagen
  • sudo apt install unattended-upgrades
  • sudo dpkg-reconfigure --priority=low unattended-upgrades

Create a sudo user and log in with it first — never keep working as root over SSH once the server is set up.

Server hardening and security

  • sudo nano /etc/ssh/sshd_config → set PasswordAuthentication no
  • sudo nano /etc/ssh/sshd_config → set PermitRootLogin no
  • sudo systemctl restart ssh
  • sudo ufw allow OpenSSH
  • sudo ufw enable
  • sudo ufw status verbose
  • sudo apt install fail2ban
  • sudo systemctl enable --now fail2ban

Confirm your SSH key still logs you in from a second, separate session before disabling password authentication — locking yourself out of a remote server usually means a rescue console or reinstall.

Advanced tools

  • sudo apt autoremove && sudo apt clean
  • sudo do-release-upgrade
  • journalctl -p 3 -xb
  • sudo reboot

Application administration

Clear terminal history

  • cat /dev/null > ~/.bash_history && history -c && exit

Clear APT and Snap caches

  • sudo apt clean
  • sudo rm -rf /var/cache/apt/archives/*
  • sudo apt update
  • sudo apt upgrade
  • sudo apt full-upgrade
  • snap refresh
  • sudo snap set system refresh.retain=2
  • for pkg in $(snap list --all | awk '/disabled/{print $1, $3}'); do sudo snap remove $pkg; done

History

  • 2004

    Mark Shuttleworth founds Canonical Ltd. and, on 20 October, releases Ubuntu 4.10 "Warty Warthog", built on top of Debian's package base.

  • 2005

    Shuttleworth establishes the Ubuntu Foundation with $10 million in funding and commits to a predictable six-month release cycle; Kubuntu and Edubuntu variants follow.

  • 2006

    Ubuntu 6.06 "Dapper Drake" introduces the Long Term Support (LTS) model, guaranteeing years of updates for chosen releases.

  • 2011

    Ubuntu 11.04 "Natty Narwhal" replaces GNOME 2 with Canonical's own Unity desktop as the default interface.

  • 2014

    Ubuntu 14.04 LTS "Trusty Tahr" becomes a de facto standard for cloud and server deployments, cementing Ubuntu's role in enterprise infrastructure.

  • 2017

    Canonical discontinues Unity and the Ubuntu Phone/convergence effort; from Ubuntu 17.10 onward, GNOME returns as the default desktop.

  • Today

    Ubuntu remains one of the most widely used Linux distributions, maintained by Canonical with LTS releases every two years, still following its alliterative animal codename tradition.