sudo apt-get (something) is not working

45,746

Solution 1

I just found out a solution to the problem. I had to open terminal and type in

sudo dpkg --configure -a

There had been interruptions in the dpkg, and that solved the problem.

Solution 2

Alright, this is a classic case of dependency mess-up.

First off, go to your Software Sources app and make sure that main, universe, and multiverse (optional) are all enabled.

Then, go back to your terminal and run the below command to refresh your package cache:

sudo apt update

Follow this up with these commands exactly as they appear below to upgrade your system and to clean up your dependency mess:

sudo apt -f install
sudo apt full-upgrade
sudo apt -f install

If this still doesn't work, we're going to have to resort to other tools, namely aptitude. As your apt is broken, we're going to have to manually install this. Visit this page and choose the most appropriate version of aptitude and download it. This is likely going to be xenial amd64, but check your system.

Then, run the following command to install aptitude on your system:

sudo dpkg -i <whatever you downloaded>.deb

Then, run:

sudo aptitude -f

Aptitude's dependency resolution/fixing system is slightly more complicated than Apt's, and as such is a lot more likely to fix any problems you may be encountering.

Share:
45,746

Related videos on Youtube

BONEPIEBONEPIE
Author by

BONEPIEBONEPIE

Updated on September 18, 2022

Comments

  • BONEPIEBONEPIE
    BONEPIEBONEPIE over 1 year

    when I try to download something, I use

     sudo apt-get install/upgrade (package)
    

    However, this gives me error messages:

    $ sudo apt-get upgrade
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    You might want to run 'apt-get -f install' to correct these.
    The following packages have unmet dependencies:
    google-chrome-stable : Depends: libpango1.0-0 (>= 1.14.0) but it is not installed
                           Depends: libappindicator1 but it is not installed
    E: Unmet dependencies. Try using -f.
    

    So, I tried using -f.

    sudo apt-get -f install (package)
    

    and there is still an error message.

    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    You might want to run 'apt-get -f install' to correct these:
    The following packages have unmet dependencies:
    0ad : Depends: 0ad-data (>= 0.0.20) but it is not going to be nstalled
          Depends: 0ad-data (<= 0.0.20-1) but it is not going to be installed
          Depends: 0ad-data-common (>= 0.0.20) but it is not going to be installed
          Depends: 0ad-data-common (<= 0.0.20-1) but it is not going to be installed
          Depends: libenet7 but it is not going to be installed
          Depends: libgloox13v5 but it is not going to be installed
          Depends: libnvtt2 but it is not going to be installed
          Depends: libopenal1 (>= 1.14) but it is not going to be installed
          Depends: libsdl2-2.0-0 (>= 2.0.4) but it is not going to be installed
          Depends: libwxbase3.0-0v5 (>= 3.0.2+dfsg) but it is not going to be installed
          Depends: libwxgtk3.0-0v5 (>= 3.0.2+dfsg) but it is not going to be installed
    google-chrome-stable : Depends: libpango1.0-0 (>= 1.14.0) but it is not going to be installed
                           Depends: libappindicator1 but it is not going to be installed
    E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
    

    How can I fix this?

    • Yaron
      Yaron about 7 years
      did you try running sudo apt-get -f install ?
    • BONEPIEBONEPIE
      BONEPIEBONEPIE about 7 years
      Yes, I have tried.
    • Kaz Wolfe
      Kaz Wolfe about 7 years
      Do you have any PPAs on your system? If so, which ones?
    • BONEPIEBONEPIE
      BONEPIEBONEPIE about 7 years
      Sorry, but how should I check for PPAs?
    • Admin
      Admin about 7 years
      Have you tried just running sudo apt-get dist-upgrade (upgrades more than just upgrade)? And are you sure that your package list is up-to-date (sudo apt-get update)?
    • BONEPIEBONEPIE
      BONEPIEBONEPIE about 7 years
      there is still that same message. that I should try apt-get -f. But when I try it, it gives the same message again.
    • psusi
      psusi about 7 years
      You need to omit the <package> argument after apt-get install -f.
    • BONEPIEBONEPIE
      BONEPIEBONEPIE about 7 years
      then how do I install packages?
    • Kaz Wolfe
      Kaz Wolfe about 7 years
      @user654662 You just use sudo apt install <package>. sudo apt -f install is meant only as a recovery/fix tool, not as a way to install things. See man apt and man apt-get.
  • TheCleverIdiot
    TheCleverIdiot about 7 years
    When apt is broken (or dpkg has been interrupted) there's no point in trying to install anything else using... APT.] Please read the other answers in order to understand the problem and the solutions.