Package managers
Packages, repositories, dependencies and signatures; apt's subcommands, how it differs from dpkg, their dnf and rpm equivalents, and diagnosing the common errors.
- 24 cards
- 4 topics
- Free
The outline, topic by topic
Each topic is weighted the way the exam weighs it.
- Concepts
- Questions
- Sort and link
- Scenarios
A few cards from the deck
Package manager: what is it?
Show the answer
A tool that installs, updates and removes a system's software from repositories, keeping the list of what is installed.
It replaces manual downloads: it knows which files belong to which software, and therefore how to remove it cleanly.
Which command installs the latest available versions of all already installed packages, once the list has been refreshed?
sudo apt upgradesudo apt updatesudo apt install --allsudo dpkg --upgrade
Show the answer
sudo apt upgradeupdateonly rereads the repositories' index.apt installexpects package names, and--alldoes not exist.dpkghas no--upgradeoption: it does not talk to repositories.apt's … subcommand refreshes the list of available packages; the … subcommand installs newer versions of the packages already present.
Show the answer
apt's update subcommand refreshes the list of available packages; the upgrade subcommand installs newer versions of the packages already present.
Without
update,aptdoes not know what is new in the repositories: this is the classic cause of an “Unable to locate package” on a fresh machine.Package repository: what is it?
Show the answer
A server that publishes packages and the index describing them, whose addresses are listed in the manager's configuration.
On Debian and Ubuntu, these addresses are in
/etc/apt/sources.listand in the files of/etc/apt/sources.list.d/. A package absent from every configured repository cannot be installed.On a freshly installed machine,
sudo apt install htopanswers “E: Unable to locate package htop”. What are the most likely cause and fix?- The package list was never downloaded; run
sudo apt updatethen try again - htop does not exist for this architecture; go through dpkg
- Rights are missing; rerun the command with
suinstead of sudo - The package is already installed; use
apt upgrade htop
Show the answer
The package list was never downloaded; run
sudo apt updatethen try againThe message says the name is in no known index. On a fresh install the index is empty or old:
apt updatefills it. Missing rights would give another message (permission denied).- The package list was never downloaded; run