Difficulty: Easy
Correct Answer: rpm -q
Explanation:
Introduction / Context:
Querying installed packages is a routine task in system administration. The rpm tool provides a query mode that quickly answers questions such as whether a package is installed, its version, and which files it installed.
Given Data / Assumptions:
Concept / Approach:
The -q option enables query mode. You can use rpm -q packagename to check installation and version, rpm -qi packagename for detailed info, and rpm -ql packagename to list installed files. Other letters have different purposes (for example, -i for install, -e for erase).
Step-by-Step Solution:
Verification / Alternative check:
Compare output with dnf list installed or rpm -qa | grep packagename. All methods corroborate whether a package is present.
Why Other Options Are Wrong:
Common Pitfalls:
Forgetting to combine flags properly (for example, using -qa to list all packages). Confusing rpm query capabilities with repository-enabled tools like dnf that can query remote repos.
Final Answer:
rpm -q
Discussion & Comments