LFCS Certification Software Package Management 4 — Questions and Answers
Question 1: What happens when you run `apt-get install -f` (or `--fix-broken`)?
- Resolves and fixes broken package dependencies automatically (Correct answer)
- Forces installation ignoring all dependency errors
- Reinstalls all installed packages from scratch
- Fixes corrupted package files using checksums
Correct answer: Resolves and fixes broken package dependencies automatically
`apt-get install -f` attempts to correct broken dependencies by installing missing packages or removing conflicting ones.
Question 2: Which `rpm` command rebuilds the RPM database after it becomes corrupted?
- rpm --rebuilddb (Correct answer)
- rpm --fixdb
- rpm -e --allfiles
- rpmdb --rebuild
Correct answer: rpm --rebuilddb
`rpm --rebuilddb` rebuilds the RPM database from the installed package headers, fixing corruption issues.
Question 3: In a YUM/DNF .repo file, what does the `enabled=0` directive do?
- Disables the repository so it is not used by default (Correct answer)
- Marks the repository as read-only
- Prevents the repository from being listed
- Disables GPG checking for that repository
Correct answer: Disables the repository so it is not used by default
Setting `enabled=0` prevents DNF/YUM from querying this repository unless explicitly enabled with `--enablerepo`.
Question 4: Which command shows which installed RPM packages have files that have been modified since installation?
- rpm -Va (Correct answer)
- rpm -qa --modified
- rpm --check-files
- rpm -Vp
Correct answer: rpm -Va
`rpm -Va` verifies all installed packages, reporting files whose attributes differ from the original package metadata.
Question 5: What is the role of `/etc/apt/preferences` or `/etc/apt/preferences.d/` on Debian systems?
- Defines package pinning rules that control which version APT installs (Correct answer)
- Stores user-specific APT configuration preferences
- Lists packages that should always be held back
- Configures APT proxy and download settings
Correct answer: Defines package pinning rules that control which version APT installs
APT pinning in /etc/apt/preferences allows administrators to specify which package versions or repositories take priority.
Question 6: What does the `dnf provides /usr/bin/python3` command do?
- Shows which package provides the file /usr/bin/python3 (Correct answer)
- Installs the package that provides python3
- Lists all capabilities provided by python3 packages
- Checks if python3 is available in current repos
Correct answer: Shows which package provides the file /usr/bin/python3
`dnf provides` performs a reverse lookup to find which package supplies a specific file or capability.
Question 7: When compiling software from source using the traditional method, which sequence is correct?
- ./configure && make && make install (Correct answer)
- make configure && make && install
- ./configure && make install
- make && ./configure && make install
Correct answer: ./configure && make && make install
The standard build sequence is: configure (checks dependencies and sets up build), make (compiles), then make install (copies binaries).
What happens when you run `apt-get install -f` (or `--fix-broken`)?