LFCS · Question #817
Which of the following commands lists all currently installed packages when using RPM package management?
The correct answer is C. rpm --query --all. To list all currently installed packages using the RPM package management system, the rpm command with the query (-q) and all (-a) options is used.
Question
Options
- Ayum --query --all
- Byum --list --installed
- Crpm --query --all
- Drpm --list installed
How the community answered
(53 responses)- A2% (1)
- B2% (1)
- C92% (49)
- D4% (2)
Why each option
To list all currently installed packages using the RPM package management system, the `rpm` command with the query (`-q`) and all (`-a`) options is used.
While `yum` can list installed packages (e.g., `yum list installed`), the `--query` and `--all` options are specific to the `rpm` command, not `yum`.
The `yum --list --installed` syntax is incorrect; the correct `yum` command to list installed packages is `yum list installed`.
The `rpm --query --all` command, often shortened to `rpm -qa`, is the correct and standard way to query and list all packages that have been installed on the system using the RPM Package Manager.
The `rpm --list installed` syntax is incorrect for listing all installed packages; the correct options are `--query` or `-q` combined with `--all` or `-a`.
Concept tested: Listing installed RPM packages
Source: https://man7.org/linux/man-pages/man8/rpm.8.html
Topics
Community Discussion
No community discussion yet for this question.