Managing Debian/Ubuntu packages with apt-get & apt-cache
DEBIANUBUNTULINUXDPKGAPTLPIC-1


Look at the file with repository information
$ cat /etc/apt/sources.list
Update the repository list, upgrade, install, remove, search packages, show package metadata, check dependencies
The relationship
apt-get / apt-cache — the older, lower-level tools, still present and valid
apt — a newer, friendlier frontend that combines the most common commands from both
Command equivalents
Old command New apt equivalent
apt-get update apt update
apt-get upgrade apt upgrade
apt-get install apt install
apt-get remove apt remove
apt-cache search apt search
apt-cache show apt show
apt-cache depends apt-cache depends (No equivalent)
update and upgrade
Command What it does
apt-get update Refreshes the package index — downloads the list of available packages from the repositories. Installs/removes nothing.
apt-get upgrade Upgrades installed packages — never removes packages
apt-get dist-upgrade Upgrades installed packages — can remove packages if needed to resolve dependencies
Notes: "update" and "upgrade" have very different meanings depending on the distribution.
For detailed information about "dpkg" options, go here.
Contact
hello@unixtips.eu
© 2025. All rights reserved.