List only packages currently installed from the packages known to YUM.
Do not include available but uninstalled candidates.
Which command is appropriate?
yum list installed restricts the list to packages installed locally. yum list available shows repository candidates.
Detailed explanation
yum list availableIncorrect. available lists repository candidates, including uninstalled packages.
Incorrect. available lists repository candidates, including uninstalled packages.
yum list installedCorrect. yum list installed lists local installed packages.
Correct. yum list installed lists local installed packages.
yum search installedIncorrect. search treats installed as a search term.
Incorrect. search treats installed as a search term.
yum info installedIncorrect. info expects a package name and displays its details.
Incorrect. info expects a package name and displays its details.
Try it yourself
An example you can run in a temporary verification environment.
yum list installed | sed -n '1,8p'Expected result
Installed Packages見出しと名前・アーキテクチャ、版、取得元の行Key points
- installed limits to local state
- available is a different list
- The operation is read-only
Notes
- Environment: YUM 3.xまたは互換YUM / ローカル状態
- 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.