Dependency errors on Ubuntu happen when users install a third-party DEB package they’ve downloaded from the internet through the command-line, and the package manager can’t find the correct dependent packages required to run the program on Ubuntu. Though these kinds of issues come up less and less in 2019, due to most Ubuntu fans moving away from DEBs in favor of Snaps and Flatpaks, it’s still important to know what to do when an error like this comes up. So, in this guide, we’ll show you how to fix dependency errors on Ubuntu.
Note: though this guide focuses on fixing dependency issues on Ubuntu Linux, the information we cover is also applicable to Linux Mint, Elementary OS, Zorin OS, and any other Ubuntu-like operating system out there. Feel free to follow along if you use any of these Ubuntu-based distros!
What is a software dependency?
A software dependency is a general term used on Linux to mean necessary programs, libraries, codecs, and other items that are required by a given application to run correctly. Usually, the developer handles these important files by bundling them within the package. However, sometimes, developers do not bundle software dependencies, and instead, they rely on the Ubuntu software sources to provide it for them.
Correcting dependency errors with Apt
The most straight-forward way to correct dependency errors on Ubuntu Linux is with the default package manager: Apt. To start the correction, open up a terminal window by pressing Ctrl + Alt + T or Ctrl + Shift + T on the keyboard. Once the command-line window is open, use the command below to fix the errors.
sudo apt install -f
Upon running the install command above, Ubuntu’s package manager will try to fix the dependency issues you are facing, and print out the changes it’s going to make. Read through the on-screen prompt that the terminal prints out. Then, when you’re done reading the on-screen prompt, press Y on the keyboard to continue.
Let the Apt packaging tool install the various software dependencies required to set your program up. Alternatively, if Apt can’t find any of the missing software dependencies it needs to work, it will automatically uninstall the app. If this is the case, consider trying to find the app through other means, rather than a DEB package.
Correcting dependency errors with Synaptic
Solving dependency errors through Apt and the command-line usually works pretty well. That said, if you’re not a fan of that method, there’s another way: Synaptic package manager.
To get your hands on Synaptic package manager on Ubuntu to solve dependency errors, you’ll need to install the application. Open up a terminal window with Ctrl + Alt + T or Ctrl + Shift + T. Then, use the command below to install the app on your system.
Note: It is also possible to install Synaptic by searching Ubuntu Software Center for “Synaptic.”
sudo apt install synaptic
After installing the Synaptic package manager on Ubuntu, launch the application, and enter your user’s password to gain access to the app. Then, follow the step-by-step instructions below to learn how to solve dependency errors with it.
Step 1: Look in the Synaptic package manager for the “Search” button and select it to access the search function in the app.
Step 2: Type the name of the app with broken dependencies into the search box. For example, if you’ve installed the Discord DEB package, you’d write “discord” in the search box.
Step 3: Look through the search results in Synaptic for the app with missing dependency files, and select it with the mouse.
Step 4: Find the “Edit” menu in the Synaptic package manager window, and click it to reveal the options inside. Once the menu is open, select the “Fix Broken Packages” button.
Step 5: Find the “Apply” button and select it to tell Synaptic to go forward with the dependency resolving process.
The fix feature will go out and collect all missing software dependencies the program needs. When the process is done, your errors are solved, and the app is ready to use!
Ways to avoid dependency errors on Ubuntu
Dependency errors on Ubuntu can easily be avoided by following this simple rule: only install software from the official Ubuntu software sources. Don’t be tempted to download random DEB packages, unless you need them. Ubuntu has an enormous amount of free, open source, and proprietary software. There shouldn’t be any reason to download DEB packages off the internet (especially since a lot of these come with problematic dependency issues.)
Getting the software from outside of the Ubuntu software sources is sometimes necessary. Even with Ubuntu’s vast amount of apps to install, some slip through the cracks. If you need to get your hands on an app not found in the traditional Ubuntu software sources, consider looking for a Snap or Flatpak version instead, as they never have dependency issues, and get regular updates directly from the developers.