Linux Package Management 4 — Questions and Answers
Question 1: Which command displays detailed metadata about an installed RPM package, including its description?
- rpm -ql package
- rpm -qi package (Correct answer)
- rpm -qd package
- rpm -qR package
Correct answer: rpm -qi package
`rpm -qi` (query information) prints the full metadata of a package including name, version, description, and build date.
Question 2: On a system using `dnf`, how would you downgrade a specific package to its previous version?
- dnf rollback package
- dnf downgrade package (Correct answer)
- dnf revert package
- dnf install package--
Correct answer: dnf downgrade package
`dnf downgrade package` installs the highest available version that is lower than the currently installed version.
Question 3: What does the `apt-cache depends` command show?
- Packages that depend on the given package
- The dependencies that a package requires (Correct answer)
- Circular dependency chains
- Optional recommended packages only
Correct answer: The dependencies that a package requires
`apt-cache depends package` lists the direct dependencies (Depends, Recommends, Suggests) that the specified package declares.
Question 4: Which `snap` command installs a snap in classic confinement mode?
- snap install --devmode app
- snap install --classic app (Correct answer)
- snap install --unconfined app
- snap install --legacy app
Correct answer: snap install --classic app
`snap install --classic` bypasses Snap's strict confinement and allows the application full access to the system, similar to a traditional package.
Question 5: What does `dpkg -S /path/to/file` do?
- Shows the file's SHA checksum
- Identifies which package owns the file (Correct answer)
- Searches for a file in uninstalled packages
- Syncs the dpkg database
Correct answer: Identifies which package owns the file
`dpkg -S` searches the dpkg database to find which installed package provided a specific file path.
Question 6: In the context of YUM/DNF, what is a 'group' install?
- Installing packages for all user groups
- Installing a predefined collection of related packages (Correct answer)
- Installing packages across multiple servers
- Installing a package with all weak dependencies
Correct answer: Installing a predefined collection of related packages
A YUM/DNF group is a named collection of packages (e.g., 'Development Tools') that can be installed together with `dnf groupinstall`.
Question 7: Which file stores the dpkg package status database on Debian-based systems?
- /etc/dpkg/packages.db
- /var/lib/dpkg/status (Correct answer)
- /var/cache/apt/packages
- /lib/dpkg/installed
Correct answer: /var/lib/dpkg/status
`/var/lib/dpkg/status` is a plain-text file that records the status and metadata of every package known to dpkg.
Which command displays detailed metadata about an installed RPM package, including its description?