Inspect Status, Version, Depends, and Description for the local bash package record.
Read the installed-package database.
Which command is appropriate?
dpkg -s PACKAGE displays the package status, version, dependencies, description, and related metadata from the local database.
Detailed explanation
dpkg -P bashIncorrect. -P purges a package.
Incorrect. -P purges a package.
dpkg -s bashCorrect. dpkg -s bash displays status and package metadata.
Correct. dpkg -s bash displays status and package metadata.
dpkg -L bashIncorrect. -L lists files installed by a package.
Incorrect. -L lists files installed by a package.
dpkg -S bashIncorrect. -S searches file ownership.
Incorrect. -S searches file ownership.
Try it yourself
An example you can run in a temporary verification environment.
dpkg -s bash | grep -E '^(Package|Status|Version):'Expected result
Package、Status、Versionの各行Key points
- -s means status
- The local package database is queried
- Use -L for the file list
Notes
- Environment: Debian系 / dpkg-query
- 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.