Ubuntu is a Debian-based Linux distribution that emphasizes ease of use, regular release cycles, and community-driven development. It serves as the foundation for countless servers, desktops, and cloud deployments worldwide, offering robust package management, systemd service orchestration, and comprehensive security features. Understanding Ubuntu's command-line tools and configuration patterns is essential for system administration, automation, and troubleshooting—while most commands apply across Linux distributions, Ubuntu's specific defaults (like APT, Netplan, AppArmor, and Ubuntu Pro) shape the practical workflows covered here. As of Ubuntu 26.04 LTS (Resolute Raccoon, released April 2026), cgroup v1 has been removed and sudo-rs (Rust-based) replaces the classic C sudo by default.
What This Cheat Sheet Covers
This topic spans 32 focused tables and 370 indexed concepts, 124 flashcards. Below is a complete table-by-table outline of this topic, spanning foundational concepts through advanced details.
A jump-to index of every table row in this cheat sheet.
An interactive map of every table and concept in this topic.
Table 1: Package Management
APT is the everyday tool for installing, upgrading, and removing software on Ubuntu, with dpkg sitting underneath it for direct .deb handling. The habit worth forming is running apt update before any install so your package index is fresh — and knowing the difference between remove (keeps config) and purge (deletes it) saves a lot of confusion later.
| Command | Example | Description | |
|---|---|---|---|
sudo apt update | Refreshes package index from repositories — always run before installing or upgrading packages. | ||
sudo apt upgrade | Installs newer versions of all installed packages without removing any. | ||
sudo apt full-upgrade | • Upgrades packages and removes obsolete dependencies if needed • used for major version transitions. | ||
sudo apt install nginx | Installs a package along with its dependencies. | ||
sudo apt remove nginx | Removes a package but keeps configuration files. | ||
sudo apt purge nginx | Removes package and deletes configuration files. | ||
sudo apt autoremove | Removes unused dependencies automatically installed with other packages. | ||
apt search docker | Searches package repositories for a keyword. | ||
apt show nginx | Displays detailed information about a package including version, dependencies, and description. | ||
apt list --installed | Lists all installed packages. | ||
apt-cache policy nginx | Shows available versions across all repositories and the currently installed version. | ||
sudo apt-mark hold nginx | Pins a package at its current version, preventing upgrades. | ||
sudo apt-mark unhold nginx | Releases a pinned package, allowing it to upgrade again. | ||
sudo dpkg -i package.deb | Installs a .deb package directly — does not resolve dependencies. | ||
dpkg -l | grep nginx | • Lists installed packages • commonly piped to grep for filtering. | ||
sudo dpkg -r package-name | Removes a package using dpkg directly. | ||
sudo dpkg --configure -a | Fixes interrupted package installations by completing configuration steps. | ||
sudo add-apt-repository ppa:user/repo | Adds a PPA (Personal Package Archive) to repository list. |