RHCSA RHCSA Software Package Management 3 — Questions and Answers
Question 1: You need to install a local RPM file that has dependencies in configured repositories. Which command handles this automatically?
- dnf install ./package.rpm (Correct answer)
- rpm -ivh package.rpm
- rpm -Uvh package.rpm
- dnf localinstall package.rpm --nodeps
Correct answer: dnf install ./package.rpm
'dnf install ./package.rpm' installs a local RPM and resolves dependencies from configured repositories; rpm -ivh does not resolve repo dependencies.
Question 2: Which command removes a package AND all packages that depend on it?
- dnf remove <package> (Correct answer)
- rpm -e <package>
- dnf autoremove <package>
- dnf erase --cascade <package>
Correct answer: dnf remove <package>
'dnf remove' automatically removes the package and any packages that would be broken without it.
Question 3: What does 'dnf module list' output's 'e' status indicator mean?
- The module stream is enabled (Correct answer)
- The module is enabled and installed
- The module stream is expired
- The module has errors
Correct answer: The module stream is enabled
In 'dnf module list' output, 'e' in the Status column means the stream is enabled (active/selected), while 'd' means disabled.
Question 4: A system needs to have kernel updates excluded permanently. Which file and directive would you use?
- Add 'exclude=kernel*' to /etc/dnf/dnf.conf (Correct answer)
- Add 'exclude=kernel*' to /etc/yum.conf
- Run 'dnf mark exclude kernel'
- Add 'skip_if_unavailable=kernel' to dnf.conf
Correct answer: Add 'exclude=kernel*' to /etc/dnf/dnf.conf
Adding 'exclude=kernel*' to the [main] section of /etc/dnf/dnf.conf permanently excludes kernel packages from all DNF operations.
Question 5: Which rpm command verifies that a package's GPG signature is valid before trusting it?
- rpm --checksig <package.rpm> (Correct answer)
- rpm -V <package.rpm>
- rpm --verify-sig <package.rpm>
- rpm -qi <package.rpm>
Correct answer: rpm --checksig <package.rpm>
'rpm --checksig' (or '-K') checks the GPG signature and digest of an RPM file to confirm it is authentic.
Question 6: After adding a new repo file to /etc/yum.repos.d/, what command rebuilds the DNF metadata cache?
- dnf makecache (Correct answer)
- dnf clean all && dnf update
- dnf repolist --refresh
- dnf cache rebuild
Correct answer: dnf makecache
'dnf makecache' downloads and caches metadata for all enabled repositories, making future operations faster.
Question 7: What is the minimum set of fields required in a valid .repo file for DNF to use a repository?
- [repoid], name=, baseurl= (or mirrorlist=), enabled= (Correct answer)
- [repoid], baseurl=, gpgcheck=
- [repoid], name=, gpgkey=
- [repoid], name=, enabled=, priority=
Correct answer: [repoid], name=, baseurl= (or mirrorlist=), enabled=
A valid repo file needs a section ID, a name, and either baseurl or mirrorlist to locate packages; enabled defaults to 1 but is best practice to include.
You need to install a local RPM file that has dependencies in configured repositories.
Which command handles this automatically?