LFCS Certification Software Package Management 5 — Questions and Answers
Question 1: Which command installs a .deb package and automatically resolves its dependencies from APT repositories?
- apt install ./package.deb (Correct answer)
- dpkg -i package.deb
- apt-get install package.deb --fix
- dpkg --auto package.deb
Correct answer: apt install ./package.deb
Using `apt install ./package.deb` (with the ./ prefix) installs the local .deb file and fetches missing dependencies from repos.
Question 2: What does the `rpm -e --nodeps <package>` command do?
- Removes a package while ignoring dependency checks (Correct answer)
- Removes a package and all its dependencies
- Removes only the package's configuration files
- Forces removal even if files are locked
Correct answer: Removes a package while ignoring dependency checks
`rpm -e --nodeps` erases a package without checking whether other packages depend on it, which may break dependencies.
Question 3: In DNF/YUM, what is a 'group' and how do you install one?
- A collection of related packages installed together with `dnf group install '<name>'` (Correct answer)
- A set of repositories grouped by priority
- A category of packages shown only in GUI tools
- A dependency resolution cache group
Correct answer: A collection of related packages installed together with `dnf group install '<name>'`
DNF groups (like 'Development Tools') bundle related packages for easy bulk installation via `dnf group install`.
Question 4: Which directive in /etc/apt/sources.list specifies that source packages should be available?
- deb-src (Correct answer)
- deb-source
- src-deb
- deb type=source
Correct answer: deb-src
Lines beginning with `deb-src` in sources.list tell APT where to find source package archives for `apt-get source`.
Question 5: What is the purpose of `rpm --import /path/to/GPG-KEY`?
- Adds a GPG public key to the RPM keyring for package signature verification (Correct answer)
- Encrypts RPM packages using the provided key
- Signs locally built RPM packages
- Imports a key for use with SSH authentication
Correct answer: Adds a GPG public key to the RPM keyring for package signature verification
Importing a GPG key allows RPM to verify the digital signatures of packages signed with the corresponding private key.
Question 6: Which `dpkg` command displays the current state (installed, removed, etc.) of all packages on the system?
- dpkg --get-selections (Correct answer)
- dpkg -l
- dpkg --status-all
- dpkg -S '*'
Correct answer: dpkg --get-selections
`dpkg --get-selections` outputs a machine-readable list of all packages and their selection states, useful for system backup.
Question 7: When a `yum update` is run and a package update breaks an application, what is the correct approach to revert?
- Use `yum history undo <transaction-id>` to roll back the specific update transaction (Correct answer)
- Reinstall the OS and restore from backup
- Use `yum downgrade <package>` for each affected package
- Run `yum remove <package>` and `yum install <package>-<old-version>`
Correct answer: Use `yum history undo <transaction-id>` to roll back the specific update transaction
`yum history undo` is the recommended way to atomically revert a transaction, restoring all affected packages to their prior versions.
Which command installs a .deb package and automatically resolves its dependencies from APT repositories?