Inspect the APT record for bash, including Version, Depends, and Description.
Use repository index data rather than limiting the query to the installed package.
Which command is appropriate?
apt-cache show displays package records from the APT indexes, including version, dependencies, description, and related fields.
Detailed explanation
apt-get show bashIncorrect. apt-get is not the traditional command for this cache query.
Incorrect. apt-get is not the traditional command for this cache query.
dpkg -L bashIncorrect. dpkg -L lists files installed by the local package.
Incorrect. dpkg -L lists files installed by the local package.
apt-cache search bashIncorrect. apt-cache search performs a keyword search rather than showing the full record.
Incorrect. apt-cache search performs a keyword search rather than showing the full record.
apt-cache show bashCorrect. apt-cache show bash displays the repository package metadata.
Correct. apt-cache show bash displays the repository package metadata.
Try it yourself
An example you can run in a temporary verification environment.
apt-cache show bash 2>/dev/null | grep -m 3 -E '^(Package|Version|Description):'Expected result
Package、Version、Descriptionの一部(索引が利用可能な環境)Key points
- show displays a package record
- Repository indexes are queried
- dpkg -s reports local installed state
Notes
- Environment: Debian系 / APT 2.x
- 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.