How to install software with apt

Overview

APT downloads signed packages from configured Ubuntu or Debian repositories and manages their dependencies. Package installation changes the system and normally requires sudo.

Common workflow

sudo apt update
apt search curl
apt show curl
sudo apt install curl
sudo apt remove curl
sudo apt autoremove

Commands explained

  • apt update refreshes package lists; it does not upgrade software
  • apt install name installs or upgrades a named package
  • apt upgrade applies available upgrades
  • apt remove removes software but may keep configuration
  • apt purge also removes package configuration
  • apt autoremove offers to remove no-longer-needed dependencies

Safety

Read APT's package and disk-space summary before answering yes. Use official repositories when possible and be cautious with third-party repository instructions.

Do not interrupt package configuration or delete APT lock files. If another package tool is running, let it finish.