LX0-103 · Question #4
Which of the following commands lists all currently installed packages when using RPM package management?
The correct answer is C. rpm --query --all. The rpm --query --all command (equivalent to rpm -qa) lists all packages currently installed on an RPM-based system. The other options use incorrect syntax for either rpm or yum.
Question
Which of the following commands lists all currently installed packages when using RPM package management?
Options
- Ayum --query --all
- Byum --list --installed
- Crpm --query --all
- Drpm --list installed
How the community answered
(27 responses)- A4% (1)
- B7% (2)
- C89% (24)
Why each option
The `rpm --query --all` command (equivalent to `rpm -qa`) lists all packages currently installed on an RPM-based system. The other options use incorrect syntax for either `rpm` or `yum`.
`yum` does not support `--query` as a valid option - that flag belongs to the `rpm` command, not `yum`.
`yum` uses the subcommand syntax `yum list installed` rather than `--list --installed` with double-dash flags.
`rpm --query --all` uses the long-form options equivalent to `rpm -qa`, where `--query` (`-q`) enters query mode and `--all` (`-a`) selects all installed packages. This is a fundamental RPM query that reads the local RPM database and prints the name, version, and release of every installed package. It works without network access and directly queries the RPM database on the local system.
`rpm --list` is not a valid `rpm` option - listing installed packages requires the `--query --all` (`-qa`) syntax, not `--list`.
Concept tested: Querying all installed RPM packages
Source: https://man7.org/linux/man-pages/man8/rpm.8.html
Topics
Community Discussion
No community discussion yet for this question.