nerdexam
CompTIA

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.

Linux Installation and Package Management

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)
  • A
    4% (1)
  • B
    7% (2)
  • C
    89% (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`.

Ayum --query --all

`yum` does not support `--query` as a valid option - that flag belongs to the `rpm` command, not `yum`.

Byum --list --installed

`yum` uses the subcommand syntax `yum list installed` rather than `--list --installed` with double-dash flags.

Crpm --query --allCorrect

`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.

Drpm --list installed

`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

#RPM#package query#installed packages#rpm options

Community Discussion

No community discussion yet for this question.

Full LX0-103 Practice