LCA Package Management & Software Installation 2 — Questions and Answers
Question 1: Which command lists all files installed by a specific RPM package named 'httpd'?
- rpm -ql httpd (Correct answer)
- rpm -qi httpd
- rpm -qd httpd
- rpm -qc httpd
Correct answer: rpm -ql httpd
rpm -ql (query list) shows all files installed by the specified package.
Question 2: What does the 'dnf group install' command do on RHEL/CentOS systems?
- Installs a predefined collection of related packages (Correct answer)
- Installs packages for a specific user group
- Groups installed packages by category
- Installs dependencies only for a package group
Correct answer: Installs a predefined collection of related packages
dnf group install installs a package group, which is a curated set of related packages (e.g., 'Development Tools').
Question 3: Which file in a Debian-based system contains the list of APT repository sources?
- /etc/apt/sources.list (Correct answer)
- /etc/apt/repos.conf
- /var/lib/apt/sources
- /etc/dpkg/sources.list
Correct answer: /etc/apt/sources.list
The /etc/apt/sources.list file (and files in /etc/apt/sources.list.d/) define where APT looks for packages.
Question 4: What command would you use to find which RPM package owns the file /usr/bin/python3?
- rpm -qf /usr/bin/python3 (Correct answer)
- rpm -qp /usr/bin/python3
- rpm -ql python3
- rpm -qi /usr/bin/python3
Correct answer: rpm -qf /usr/bin/python3
rpm -qf (query file) identifies the package that owns a specified installed file.
Question 5: Which dnf command is equivalent to 'yum localinstall package.rpm'?
- dnf install ./package.rpm (Correct answer)
- dnf localinstall package.rpm
- dnf install --local package.rpm
- dnf add package.rpm
Correct answer: dnf install ./package.rpm
In dnf, installing a local RPM file is done with 'dnf install ./package.rpm' using the explicit path.
Question 6: What is the purpose of the 'apt-cache showpkg' command?
- Displays package dependency and reverse-dependency information (Correct answer)
- Shows the package cache size
- Lists all cached package files
- Shows the package installation log
Correct answer: Displays package dependency and reverse-dependency information
apt-cache showpkg displays detailed information about a package including its dependencies and packages that depend on it.
Question 7: Which command verifies the integrity of all installed RPM packages on a system?
- rpm -Va (Correct answer)
- rpm -qa --verify
- rpm --check-all
- rpm -iv --test
Correct answer: rpm -Va
rpm -Va (verify all) checks all installed packages against the RPM database for file changes, permissions, and checksums.
Which command lists all files installed by a specific RPM package named 'httpd'?