RHCSA RHCSA Software Package Management 5 — Questions and Answers
Question 1: You want to download an RPM package without installing it. Which command accomplishes this?
- dnf download <package> (Correct answer)
- dnf install --download-only <package>
- dnf fetch <package>
- rpm --download <package>
Correct answer: dnf download <package>
'dnf download <package>' downloads the RPM to the current directory without installing it; the plugin is included by default in RHEL 8+.
Question 2: Which command shows the list of all DNF modules available in configured repositories?
- dnf module list (Correct answer)
- dnf list modules
- dnf search --modules
- dnf info --modules
Correct answer: dnf module list
'dnf module list' displays all available modules with their streams, profiles, and current status.
Question 3: What is a DNF module 'profile'?
- A predefined set of packages within a module stream for a specific use case (Correct answer)
- A performance tuning preset for the module
- A user-specific set of package preferences
- A saved state of enabled module streams
Correct answer: A predefined set of packages within a module stream for a specific use case
A module profile is a curated list of packages from a stream optimized for a role (e.g., 'minimal', 'server', 'client') that can be installed together.
Question 4: An RPM package fails to install because it conflicts with an already-installed package. What flag forces the installation anyway (for testing only)?
- rpm -ivh --replacefiles <package.rpm>
- rpm -ivh --force <package.rpm> (Correct answer)
- rpm -ivh --nodeps <package.rpm>
- rpm -ivh --ignorearch <package.rpm>
Correct answer: rpm -ivh --force <package.rpm>
'rpm --force' overrides file conflicts and other non-fatal errors; --nodeps skips dependency checks, --replacefiles is not a valid rpm flag.
Question 5: Where does DNF store downloaded package metadata and cached RPMs by default?
- /var/cache/dnf/ (Correct answer)
- /var/lib/dnf/
- /tmp/dnf-cache/
- /etc/dnf/cache/
Correct answer: /var/cache/dnf/
DNF caches repository metadata and optionally downloaded packages in /var/cache/dnf/ organized by repository ID.
Question 6: Which command installs the 'development' profile of the 'nodejs' module stream '18'?
- dnf module install nodejs:18/development (Correct answer)
- dnf install nodejs:18 --profile development
- dnf module enable nodejs:18 && dnf install nodejs-development
- dnf module install nodejs --stream 18 --profile development
Correct answer: dnf module install nodejs:18/development
DNF module install uses the syntax 'module:stream/profile' to specify exactly which stream and profile to install.
Question 7: What command would you use to find which package installed the binary /usr/sbin/firewalld on a running system?
- rpm -qf /usr/sbin/firewalld (Correct answer)
- dnf provides /usr/sbin/firewalld
- rpm -qi firewalld
- rpm -ql /usr/sbin/firewalld
Correct answer: rpm -qf /usr/sbin/firewalld
'rpm -qf <file>' queries the RPM database to identify which installed package owns a specific file already on the system.
You want to download an RPM package without installing it.
Which command accomplishes this?