Package management utility for Debian based distributions. Recommended replacement for apt-get when used interactively in Ubuntu versions 16.04 and later.
# To update the list of available packages and versions (it's recommended to run this before other 'apt' commands):
sudo apt update
# To search for a given package:
apt search <package>
# To show information for a package:
apt show <package>
# To install a package, or update it to the latest available version:
sudo apt install <package>
# To remove a package (using 'purge' instead also removes its configuration files):
sudo apt remove <package>
# To upgrade all installed packages to their newest available versions:
sudo apt upgrade
# To list all packages:
apt list
# To list installed packages:
apt list --installed
# ---
# To upgrade all installed packages to their newest available versions without promoting to confirm (yes/no):
apt -y upgrade
# .bash_alias to update the list of available packages and versions, upgrade all installed packages without prompting, and auto-remove packages no longer needed:
alias update='sudo apt update && sudo apt -y upgrade && sudo apt autoremove'