LCA Package Management & Software Installation 4 — Questions and Answers
Question 1: What is the purpose of a GPG key in the context of YUM/DNF repositories?
- To verify the authenticity and integrity of downloaded packages (Correct answer)
- To encrypt packages during transfer
- To authenticate the user downloading packages
- To sign the repository configuration file
Correct answer: To verify the authenticity and integrity of downloaded packages
GPG keys allow the package manager to verify that packages come from the claimed publisher and haven't been tampered with.
Question 2: Which command installs a .deb package file directly using dpkg?
- dpkg -i package.deb (Correct answer)
- dpkg -a package.deb
- dpkg --add package.deb
- dpkg install package.deb
Correct answer: dpkg -i package.deb
dpkg -i (install) installs a .deb package file directly, bypassing the apt repository system.
Question 3: What is the role of 'createrepo' command on RPM-based systems?
- Creates repository metadata from a directory of RPM files (Correct answer)
- Creates a new empty RPM repository
- Downloads RPMs to create a local repo
- Creates an RPM spec file
Correct answer: Creates repository metadata from a directory of RPM files
createrepo generates the repodata/ directory with XML metadata that makes a directory of RPMs usable as a YUM/DNF repository.
Question 4: Which file would you edit to disable a specific YUM/DNF repository temporarily?
- The .repo file in /etc/yum.repos.d/ and set enabled=0 (Correct answer)
- Delete the .repo file from /etc/yum.repos.d/
- Edit /etc/yum.conf and add the repo to excluderepos
- Remove the repo entry from /etc/dnf/dnf.conf
Correct answer: The .repo file in /etc/yum.repos.d/ and set enabled=0
Setting 'enabled=0' in the repository's .repo file disables it without removing the configuration.
Question 5: What does 'dpkg -l' output?
- A table listing all packages with their status, version, and description (Correct answer)
- Only installed packages with file lists
- Packages available but not installed
- Package changelog entries
Correct answer: A table listing all packages with their status, version, and description
dpkg -l lists all packages known to dpkg with their status codes (ii=installed, rc=removed with config files remaining, etc.).
Question 6: When using 'dnf install', what does the '--downloadonly' flag do?
- Downloads packages and dependencies without installing them (Correct answer)
- Downloads only the package without its dependencies
- Downloads only metadata for the package
- Downloads the package and marks it for later install
Correct answer: Downloads packages and dependencies without installing them
The --downloadonly flag fetches the RPM files to the dnf cache but does not install them on the system.
Question 7: What is 'Flatpak' and how does it differ from traditional package management?
- A sandboxed application distribution system that bundles dependencies, independent of the host OS (Correct answer)
- A faster version of the apt package manager
- A container format for system packages
- A cross-distro replacement for RPM
Correct answer: A sandboxed application distribution system that bundles dependencies, independent of the host OS
Flatpak distributes self-contained applications in sandboxes with bundled dependencies, allowing the same package to run on any Linux distribution.
What is the purpose of a GPG key in the context of YUM/DNF repositories?