1. Home
  2. Linux

How to fix broken packages on Ubuntu

The nature of how Ubuntu Linux works means that sometimes when using it, you’ll be downloading DEB package files from the internet to install. Usually, downloading these types of packages doesn’t present any problems as developers regularly update their DEB files to meet the needs of new releases of the Ubuntu operating system. However, sometimes DEB packages go years without updates, and when users install them, breakages can happen. These breakages also occur when users uninstall necessary packages that should stay on the system. Here’s how to fix broken packages on Ubuntu.

Note: though this guide is centered around Ubuntu Linux, the information covered in it applies to other Linux operating systems based on Ubuntu, such as Linux Mint, Elementary OS, Zorin OS, and many other derivatives. Feel free to follow along with the instructions covered in this post!

Install Synaptic package manager

Ubuntu Linux does not come with the Synaptic package manager pre-installed anymore. The fact that it’s not a default program anymore is quite a shame, as Synaptic has built-in ways of fixing broken packages.

To install Synaptic, open up a terminal window by pressing Ctrl + Alt + T or Ctrl + Shift + T on the keyboard. Then, once the command-line window is open and ready to use, run the update command to check Ubuntu for any software updates or pending patches.

sudo apt update

Following the update command, install all software patches onto your Ubuntu Linux system with the upgrade command. Be sure to use the “y” switch to accept the prompt automatically.

sudo apt update -y

With the update and upgrade done, you’ll be able to quickly install the Synaptic package manager on any version of Ubuntu Linux with the apt install command below.

sudo apt install synaptics -y

Don’t want to use the Terminal? Update your system with the Ubuntu update tool (usually found by searching for Update in the app menu).  Then once everything is up to date, open up Ubuntu Software Center, and click the search box to locate the Synaptics application.

Finding broken packages with Synaptic

The process of finding broken packages in Synaptic starts by launching the application. On your Ubuntu Linux PC, press the Windows key, type in “Synaptic” and open up the app with the brown box icon.

After launching the application, the system will ask for a password. The reason it asks for a password is that Synaptic needs to operate with system-level privileges. In the password box, enter the passcode for the user you are currently using, and press Enter to accept.

With Synaptic open, click the blue search icon next to “Properties.” From there, type in the exact name of the package (or packages) you know to be broken. Then, select the “search” button to start a search on your Linux PC.

If your search terms are accurate, broken packages on your Ubuntu PC will show up in the “S” column with a red square.

Sort by broken

Your Ubuntu PC may tell you that you’re holding broken packages, but not show you the exact name of each package with a problem. In this case, searching for the packages isn’t an option, since you’re not aware of what they’re called. Thankfully, Synaptic lets users sort installed packages by status.

To filter out broken packages in Synaptic on Ubuntu, find the “Custom Filters” button at the bottom left part of the screen and click on it. Selecting “Custom Filters” will take you to a window, with several different package sorting options. Look through the sorting options and select the “Broken” filter to reveal all broken, non-working packages installed on Ubuntu.

Fix broken packages with Synaptic

Getting rid of broken packages on Ubuntu with Synaptic is incredibly easy, thanks to the “Fix broken packages” button. Why? It takes care of all of the problems, and the user doesn’t need to deal with any of them! It’s pretty great!

To fix any broken packages that may appear on your Ubuntu Linux PC, ensure Synaptic is open. Then, click on the “Edit” menu with the mouse. Inside of the “Edit” menu, locate the option labeled “Fix Broken Packages” and click it with the mouse.

Clicking the “Fix Broken Packages” option will tell Synaptic to automatically sort out why the packages are broken on your Ubuntu system, and propose changes, such as uninstalling them, correcting missing files, or re-installing previously removed sub-packages that caused the breakage.

Once Synaptic is done proposing changes, make your way back to the “Broken” section under “Custom Filters,” and you’ll notice all of the broken packages now have green status icons.

Finish up the package repair process on your Ubuntu PC by clicking the “Apply” button in Synaptic. Allow it to repair the broken packages. When the process is complete, close Synaptic and everything should be back to normal on Ubuntu!

Leave a comment