How to fix broken packages using the Command Line

  11 years ago

Using aptitude for package management instead of apt-get, please note that it is bad practice to use aptitude and apt-get interchangeably, as they record separately the changes made by a user.


Open the Terminal from the Mint Menu and start with the commands:

sudo aptitude update && sudo aptitude install gtkorphan

The && is used to run the second command if the first command runs successfully.


Continue by running:

sudo aptitude update && sudo aptitude upgrade

This is used to double-check that you have all the updates.


To clear out the broken packages use the command:

sudo aptitude -f

It brings up a beautiful interface to search, navigate, install, update and otherwise to manage packages.

Use the commands on the screen to install all the updates. You may use the mouse or CTRL + T to open the menu. Also, you could use the arrow keys and the Enter key to navigate.

You can also install the Aptitude Package Manager if you want to use something like Synaptic. Just type aptitude-gtk in the search field of the Mint Menu and click on Install package 'aptitude-gtk'. You can then find it under the Administration menu.


You may also use other commands to:

  • install software for your system, with needed dependencies as well:
sudo aptitude install
  • remove packages as well as orphaned dependencies:
sudo aptitude remove
  • remove packages and orphaned dependencies, as well as any configuration files left behind:   
sudo aptitude purge
  • search for packages in the local apt package lists:
sudo aptitude search package-name
  • show details about a package:
sudo aptitude show package-name
  • update the local packages lists:
sudo aptitude update
  • upgrade any installed packages that have been updated:
sudo aptitude upgrade
  • upgrade packages, even if it means uninstalling certain packages:
sudo aptitude dist-upgrade
  • delete only out-of-date packages, but keep current ones:
sudo aptitude autoclean
  • delete any downloaded files necessary for installing the software on your system:
sudo aptitude clean
  • fix a package at it’s current version, and don’t update it:
sudo aptitude hold


Recommended reading: Aptitude vs Apt-Get

Liqua 4 years ago

Life saver - thankyou.

LeeC 5 years ago

I was stuck in an apt-get "loop". Broken package couldn't be uninstalled.
"dpkg: error processing package ibm-java80-jre:amd64 (--remove):
package is in a very bad inconsistent state; you should
reinstall it before attempting a removal
Errors were encountered while processing:

Following the instructions in this article cleaned up the mess. Thank you very much!

Sam_Sung 5 years ago

there is no aptitude-gtk package to be found in synaptic

Sam_Sung 5 years ago


Alexio 6 years ago

Using aptitude for package management instead of apt-get (via Synaptic), please note that it is bad practice to use aptitude and apt-get interchangeably, as warned at the very beginning of this tutorial.

Anaemic 6 years ago

It is not necessary to install a program to fix broken packages.
Open Synaptic Package Manager > click edit > click Fix Broken Packages

Alexio 6 years ago

Try the command:

aptitude why-not package

where package is the name of the package you want to install.

For details see

gorade 7 years ago

Very nice and instructive. only it didn't solve the problem. The irksome "solve the problem with broken packages" is still there. I am accused for "holding back broken packages". What do I do wrong?

Fokir 7 years ago

Nice and straight. We like this

Xzoma 8 years ago

Works great thanks

linux1492 9 years ago

This article rules!!! Thanks so much. Well done.

ssj_satish 9 years ago

Nice article. Solved the problem, I was hunting for 3 days.
Thanks a lot.

jaredchu 10 years ago

sudo aptitude -f

this command removed all my package, when i come back my computer return black screen and nothing in there...

blueXrider 11 years ago

Good information.

remoulder 12 years ago

I didn't say your post was an idea, following your instructions is not a good idea. It may well have worked for you but you probably understand what you are doing. An inexperienced user doing this could cause themselves problems.

Alexio 12 years ago

This is a tutorial and not an idea :) It worked well for me and for others when Synaptic was not able to fix the broken packages. It is possible to install a nice front-end to aptitude called "aptitude-gtk".

remoulder 12 years ago

This is not a good idea, users should understand what is causing the broken packages, not just force a fix or they could end up removing needed software. Besides imo, it is easier to see what is going on using synaptic rather than aptitude.