CompTIA Linux+ (XK0-006)System ManagementMedium
A technician manually downloaded a .deb package and installed it with 'dpkg -i package.deb', but the installation failed due to unmet dependencies. Which command should be run next to automatically resolve and install the missing dependencies?
- Aapt list --upgradable
- Bapt-cache search package
- Cdpkg --configure -a
- Dapt-get install -f
Show answer & explanationAnswer & explanation
Correct answer: D. apt-get install -f
'apt-get install -f' (fix-broken install) scans for and installs any missing dependencies required by packages that were partially installed via dpkg, completing the configuration. 'dpkg --configure -a' only finishes configuring already-unpacked packages, and the other two commands merely list or search packages without fixing dependencies.
Why the other options are wrong
- A. Lists packages with available upgrades, unrelated to fixing dependencies.
- B. Searches the package cache by keyword, does not install anything.
- C. Reconfigures partially installed packages but does not fetch missing dependencies.
apt-get install -f
Command used to fix broken package dependencies, commonly needed after installing a .deb file manually with dpkg -i.
- -f stands for 'fix-broken'
- Downloads and installs missing dependency packages
- Often paired with dpkg --configure -a for full recovery
Memory trick: apt -f = 'fix' the puzzle pieces dpkg left missing.