🎓 A1Learner
🔍
0 of 50 lessons completed

Listing Packages

A package is a bundle of files that installs one program. A repository is a store that holds packages.

List with dpkg

dpkg lists the packages on this machine. Three lines mention curl.

$ dpkg -l | grep curl

List with apt

apt lists the installed packages. The warning says this list is for reading, not for scripts.

$ apt list --installed | grep curl

The details of one package

apt show prints the details of one package.

$ apt show curl | head -6

Example

$ dpkg -l | grep curl
$ apt show curl | head -6

Key points

  • Use dpkg -l to list the packages on this machine.
  • Use apt list --installed to list the installed packages.
  • Use apt show to print the details of one package.
  • One package holds one program and its files.
  • A package has a name, a version, and a size.
  • Your package list will differ from the list shown here.

In this example, dpkg lists the curl lines. apt show then prints the details of curl. The name and the version sit in those lines.

Note

These three commands only look. They change nothing.

Try it Yourself

Edit the code, then press Run.

Running is simulated

Exercise

What is a package?