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 curlList with apt
apt lists the installed packages. The warning says this list is for reading, not for scripts.
$ apt list --installed | grep curlThe details of one package
apt show prints the details of one package.
$ apt show curl | head -6Example
$ dpkg -l | grep curl
$ apt show curl | head -6Key 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?