A junior administrator manually installed a locally compiled .deb on an Ubuntu Server 22.04 LTS file server. The installation failed midway, and every subsequent apt operation now ends with the message:
E: Unmet dependencies. Try 'apt --fix-broken install' to correct these.
The Samba service that depends on the missing libraries will not start until the package database is repaired. Which single command should the administrator run next to return the package manager to a consistent state so normal installations can continue?
The option that automatically repairs a Debianābased system with broken or partially installed packages is apt-get install -f (equivalent to apt --fix-broken install). The -f / --fix-broken flag tells APT to examine the package database, download any missing dependencies, and complete unfinished installs, thereby restoring consistency.
apt-get update only refreshes repository metadata and does not touch the broken dependency chain.
dpkg --configure -a merely configures packages that are already unpacked; it cannot download or install the libraries that are still missing.
apt-get clean deletes cached .deb files and frees disk space but does nothing to resolve dependency errors.
Therefore, running apt-get install -f is the most effective next step.