Advanced Application Updates
Author(s): Matthias Lee (ml2322)
Last Updated: 9-10-2025
Recommended Prerequisites (click to expand)
- Intermediate application updates
Some problems with APT
Malicious Sources
Previously, we learned about missing or incomplete APT sources. However, not only can there be
missing or inadequate sources, there could also be malicious sources that tell APT to download
software from sources controlled by bad actors. Additionally, even if not malicious, unwanted
sources facilitate the downloading of unwanted software and should be removed. To look for apt
sources, you can check in /etc/apt/sources.list for any source line that does not seem to be
official. Generally, all official sources will include ubuntu or the name of your distro. To be sure,
you can take baselines of the this file on a clean copy of the OS and compare them. However,
malicious sources don't have to be here, as apt allows for additional sources to be listed in files
in /etc/apt/sources.list.d. Usually, this directory is empty or contains a readme of some sort,
so if there's anything else in there it may be a malicious or unwanted sources. Some programs like
firefox or docker require additional sources if they are to be installed with apt, so before
removing a source, check and make sure that it is not required.
Unmet dependencies and broken packages
Sometimes, if the wrong package is installed or a dependency is not met, apt can enter a state
where it can not function properly due to unmet dependencies. If this happens, you can run
apt --fix-broken install. This will make apt attempt to resolve unmet dependencies and restore
proper functionality. Cases like this usually happen due to installing the wrong package straight
from a .deb file or because apt was using the wrong sources. Therefore, if you can't fix the
problem with apt --fix-broken install, try removing any weird packages, ensuring your apt sources
are set properly, running apt update, and then trying apt --fix-broken install again.
dpkg reconfigure
Another common issue that can come up with apt is that if the process is killed during the
installation, update, or removal of a package, the package can become improperly configured, and
apt will refuse to work. The solution is very simple however, as you can simply run
dpkg --force-all --configure -a, and dpkg will resolve any errors, and apt should be restored.