GSEC · Question #102
Which command would allow an administrator to determine if a RPM package was already installed?
The correct answer is B. rpm -q. The rpm -q flag queries the RPM database to determine whether a specific package is currently installed on the system.
Question
Which command would allow an administrator to determine if a RPM package was already installed?
Options
- Arpm -s
- Brpm -q
- Crpm -a
- Drpm -t
How the community answered
(27 responses)- A7% (2)
- B74% (20)
- C4% (1)
- D15% (4)
Why each option
The rpm -q flag queries the RPM database to determine whether a specific package is currently installed on the system.
There is no standard -s flag in rpm used to check installation status; -s is not a recognized standalone query option.
The -q option in the rpm command stands for 'query' and checks the local RPM database for the presence of a named package. Running 'rpm -q <packagename>' returns the package name and version if installed, or a 'not installed' message if absent.
The -a modifier means 'all' and is used in combination with -q (e.g., rpm -qa to list all installed packages), but is not a standalone option for checking a specific package.
There is no standard -t flag in rpm for querying installation status of a package.
Concept tested: RPM package query command usage
Source: https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/9/html/managing_software_with_the_dnf_tool/assembly_introduction-to-rpm_managing-software-with-the-dnf-tool
Topics
Community Discussion
No community discussion yet for this question.