Search package names and descriptions for the term websocket.
The task is not to find which package provides a file path.
Which command is appropriate?
apt search TERM searches names and descriptions of available packages. apt-file search is for path providers.
Detailed explanation
apt show websocketIncorrect. apt show expects a package name and displays its details.
Incorrect. apt show expects a package name and displays its details.
apt search websocketCorrect. apt search websocket finds matching package names and descriptions.
Correct. apt search websocket finds matching package names and descriptions.
apt-file search websocketIncorrect. apt-file search queries Contents paths.
Incorrect. apt-file search queries Contents paths.
apt list --installed websocketIncorrect. This filters installed packages rather than searching descriptions.
Incorrect. This filters installed packages rather than searching descriptions.
Try it yourself
An example you can run in a temporary verification environment.
apt search websocket 2>/dev/null | sed -n '1,8p'Expected result
検索語に関連するパッケージ名と短い説明(索引により異なる)Key points
- apt search covers names and descriptions
- show expects a known package
- apt-file search searches paths
Notes
- Environment: 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.