Lesson 5.2: Package management on Debian and Ubuntu: apt
The everyday apt cycle: update the package index, see and apply upgrades, search, install with dependencies, run the new program, remove it and clean up automatically installed leftovers; apt vs apt-get and dpkg.
17 min
You will learn to
- Explain the difference between apt update and apt upgrade
- Search for and install a package, reading apt's output
- Remove a package and autoremove its dependencies
- Inspect installed packages with dpkg -l and dpkg -L
Key terms
- apt update
- Downloads the current package lists (indexes) from the repositories. Installs nothing.
- apt upgrade
- Installs newer versions of packages you already have, according to the lists from update.
- apt install / remove / purge
- install adds a package with its dependencies; remove deletes it but keeps its configuration; purge deletes the configuration too.
- Automatically installed / autoremove
- Packages pulled in only as dependencies are marked 'automatic'; autoremove deletes those nothing needs any more.
- apt, apt-get, dpkg
- apt is the friendly command for people; apt-get does the same with output that stays stable for scripts; dpkg installs single .deb files and keeps the database of installed files.
← Linux package management · All lessons · Package management on Red Hat systems: dnf →