RHCSA RHCSA Software Package Management 2 — Questions and Answers
Question 1: Which command displays detailed information about an installed RPM package including its description and install date?
- rpm -qi <package> (Correct answer)
- rpm -ql <package>
- rpm -qd <package>
- rpm -qR <package>
Correct answer: rpm -qi <package>
rpm -qi shows package info (name, version, description, install date); -ql lists files, -qd lists docs, -qR lists dependencies.
Question 2: A DNF module stream is enabled but you want to switch to a different stream. What must you do first?
- dnf module reset <module> (Correct answer)
- dnf module disable <module>
- dnf module remove <module>
- dnf module switch <module>
Correct answer: dnf module reset <module>
You must run 'dnf module reset <module>' to clear the active stream before enabling a different one.
Question 3: Which file would you examine to see the history of all DNF transactions on a system?
- /var/log/dnf.log (Correct answer)
- /var/log/yum.log
- /etc/dnf/dnf.conf
- /var/lib/dnf/history.sqlite
Correct answer: /var/log/dnf.log
/var/log/dnf.log records all DNF transactions; the history database is in /var/lib/dnf/ but the human-readable log is /var/log/dnf.log.
Question 4: How do you list only the packages that are available as updates but NOT install them?
- dnf check-update (Correct answer)
- dnf list updates
- dnf upgrade --dry-run
- dnf search updates
Correct answer: dnf check-update
'dnf check-update' lists packages with available updates without installing them; it exits with code 100 if updates exist.
Question 5: An administrator runs 'rpm -V httpd' and sees 'S.5....T. /etc/httpd/conf/httpd.conf'. What does the '5' indicate?
- MD5 checksum differs from the package (Correct answer)
- File size has changed
- File permissions differ
- SELinux context differs
Correct answer: MD5 checksum differs from the package
In rpm -V output, '5' means the MD5 checksum (digest) of the file differs from what the package recorded at install time.
Question 6: Which DNF command is used to find which installed package provides the file /usr/bin/python3?
- dnf provides /usr/bin/python3 (Correct answer)
- dnf search python3
- dnf info python3
- dnf list --installed python3
Correct answer: dnf provides /usr/bin/python3
'dnf provides <file>' identifies which package owns or provides a specific file path or capability.
Question 7: What is the effect of running 'dnf install @Base' on a RHEL system?
- Installs the Base environment group of packages (Correct answer)
- Installs only the base kernel package
- Installs all available packages
- Installs the Base module stream
Correct answer: Installs the Base environment group of packages
The @ prefix indicates an environment group; 'dnf install @Base' installs the Base environment group as defined in the repository metadata.
Which command displays detailed information about an installed RPM package including its description and install date?