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. dpkg -s apt displays the detailed status record.
dpkg -lIncorrect. dpkg -l is a short list, not a single detailed record.
Incorrect. dpkg -l is a short list, not a single detailed record.
dpkg -i aptIncorrect. -i attempts to install a deb archive.
Incorrect. -i attempts to install a deb archive.
dpkg -r aptIncorrect. -r removes the package.
Incorrect. -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以降 / ローカルデータベース
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Read the scope first
Check whether the command acts on the current shell, a new process, an existing process, or a file.
Verify the observable result
Use the supplied command and compare the output with the expected result.