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 updaterefreshes package lists; it does not upgrade softwareapt install nameinstalls or upgrades a named packageapt upgradeapplies available upgradesapt removeremoves software but may keep configurationapt purgealso removes package configurationapt autoremoveoffers 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.