Cannot install anything through Terminal - apt-get -f install

12,330

Solution 1

Okay, from what I can tell, your problem is that you've added a PPA to try and upgrade to the latest version of GIMP, and it hasn't worked out. I think the best option for now is to remove the PPA so you can get back your ability to install software.

Open Update Manager and hit Settings. This will bring you to the Software Sources manager, which you can read more about here. Go to the "Other Software" tab and untick any PPA's you added related to GIMP.

Then open a terminal, and type these commands one at a time (you may have to run the third command before sudo apt-get remove gimp if it fails):

sudo apt-get update
sudo apt-get remove gimp
sudo apt-get -f
sudo apt-get upgrade

GIMP will be uninstalled, but it should get your system working again. You should also be able to reinstall the default version of GIMP from the repositories.

Solution 2

Try this:

sudo apt-get build-dep <yourapp>
Share:
12,330

Related videos on Youtube

jaorizabal
Author by

jaorizabal

Prefer to use Ubuntu 12.04, made the switch from Win 7 to Ubuntu and loving it.

Updated on September 18, 2022

Comments

  • jaorizabal
    jaorizabal over 1 year

    I get this when ever i try and install anything with th Terminal:

        You might want to run 'apt-get -f install' to correct these:
    The following packages have unmet dependencies:
     gimp : Depends: libgimp2.0 (<= 2.6.12-z) but 2.8.0-1ubuntu0ppa3~precise is to be installed
            Depends: gimp-data (<= 2.6.12-z) but 2.8.0-1ubuntu0ppa3~precise is to be installed
    E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
    

    I added myself to the root group in the grub recovery mode. Then did sudo apt-get -f install and got this:

    Errors were encountered while processing:
     /var/cache/apt/archives/gimp_2.8.0-1ubuntu0ppa3~precise_amd64.deb
    
    E: Sub-process /usr/bin/dpkg returned an error code (1)
    
    • Marius
      Marius about 12 years
      Two things: have you actually tried running sudo apt-get -f install like it suggests, and did you recently add a PPA to try and get GIMP 2.8?
  • Admin
    Admin about 12 years
    I would just like to point out that Gimp 2.8 is very easy to build from source. gregorystrike.com/2012/05/03/…
  • Marius
    Marius about 12 years
    @gecko Thanks, I was hoping that someone would post a guide like that as I've been meaning to check out 2.8 for myself.
  • Andrea Corbellini
    Andrea Corbellini over 11 years
    build-dep is used to install build dependencies. Could you elaborate why and how this would solve the OP's problem?
  • Carlos_Mena
    Carlos_Mena over 11 years
    Because the problem is about dependencies and probably the tree es corrupt or have any error, in my case sudo apt-get -f install did no solve the problem.
  • valk
    valk about 10 years
    This solved a similar problem here. The cause? Some packages that were installed with dpkg -i.