RHCE Package Management and Software Installation 2 — Questions and Answers
Question 1: Which command displays detailed information (version, size, description) about an installed or available package?
- dnf details httpd
- dnf info httpd (Correct answer)
- rpm -qa httpd
- dnf describe httpd
Correct answer: dnf info httpd
'dnf info <package>' shows comprehensive metadata including version, release, architecture, and description.
Question 2: How do you verify the integrity of all files in an installed RPM package named 'bash'?
- rpm --verify bash
- rpm -V bash
- dnf verify bash
- Both A and B are correct (Correct answer)
Correct answer: Both A and B are correct
Both 'rpm --verify' and its shorthand 'rpm -V' check file attributes (size, permissions, checksums) against the RPM database.
Question 3: What is the correct syntax to add a new repository by providing a URL to a .repo file using DNF?
- dnf repo-add <url>
- dnf config-manager --add-repo <url> (Correct answer)
- dnf addrepo --url <url>
- dnf repository --new <url>
Correct answer: dnf config-manager --add-repo <url>
'dnf config-manager --add-repo <url>' downloads and saves the .repo file into /etc/yum.repos.d/.
Question 4: Which command searches for a package that provides the '/usr/bin/vim' binary?
- dnf search vim
- dnf provides /usr/bin/vim (Correct answer)
- dnf whatprovides vim
- rpm -q --provides vim
Correct answer: dnf provides /usr/bin/vim
'dnf provides <file-or-capability>' searches all packages (installed and available) to find which one provides the specified path or capability.
Question 5: How do you download an RPM package without installing it using DNF?
- dnf get httpd
- dnf install --downloadonly httpd (Correct answer)
- dnf fetch httpd
- dnf pull httpd
Correct answer: dnf install --downloadonly httpd
'dnf install --downloadonly <package>' downloads the RPM and its dependencies to the cache without installing them.
Question 6: Which command lists all available DNF module streams for the 'php' application stream?
- dnf module list php (Correct answer)
- dnf list modules php
- dnf module info php
- dnf streams list php
Correct answer: dnf module list php
'dnf module list <module-name>' displays all available streams for that module along with their status (enabled/disabled/default).
Question 7: How do you undo the last DNF transaction (e.g., the most recent package installation)?
- dnf rollback last
- dnf undo
- dnf history undo last (Correct answer)
- dnf revert last
Correct answer: dnf history undo last
'dnf history undo last' reverses the most recent transaction by uninstalling installed packages or reinstalling removed ones.
Which command displays detailed information (version, size, description) about an installed or available package?