Inspect apt Status, Version, Architecture, Depends, and Description fields.
Do not display the short list for every package.
Which command is appropriate?
dpkg -s PACKAGE displays the detailed status record for one installed package from the local database.
Detailed explanation
dpkg -s aptCorrect. dpkg -s apt displays the detailed status record.
Correct. -s reads the detailed status record for apt.
dpkg -lIncorrect. dpkg -l is a short list, not a single detailed record.
Incorrect. -l is the compact multi-package list.
dpkg -i aptIncorrect. -i attempts to install a deb archive.
Incorrect. -i treats apt as an archive argument.
dpkg -r aptIncorrect. -r removes the package.
Try it yourself
An example you can run in a temporary verification environment.
dpkg -s apt | sed -n '1,8p'Expected result
Package、Status、Priority、Section、Installed-Size等の項目Key points
- -s shows one detailed record
- -l is a compact list
- The package must be known locally
Notes
- Environment: dpkg 1.21以降 / ローカルデータベース
- Use a disposable package or read-only help when testing package commands.
- Package behavior can vary with dpkg and debconf versions.
Foundation review
Place the operation
A status record is local package-database data; it is not a repository candidate for an uninstalled package.
Check the side effect
Compare dpkg -s with the corresponding line from dpkg -l.