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?
93 Answers
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 updateFollow 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 installIf 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>.debThen, run:
sudo aptitude -fAptitude'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.
1I just found out a solution to the problem. I had to open terminal and type in
sudo dpkg --configure -aThere had been interruptions in the dpkg, and that solved the problem.
sudo apt-get install/upgrade (package) is not a legal command. You would install a new package by typing something like:
sudo apt-get install vlc #Where vlc is the name of the pkg you want to installYou would do an upgrade by typing:
sudo apt-get update # updates the repositoty packages
sudo apt-get upgrade vlc # upgrades the VLC package to the latest version.In your upgrade example you posted a list of missing dependencies. The easiest way to resolve this is to uninstall the package (in your example google-chrome-stable) and reinstall it. It was previously installed incorrectly, apparently.
You can also resolve dependency issues piecemeal by typing:
sudo apt-get install libpango1*
sudo apt-get install libappindicator1*
etc.I'd recommend reading the apt-get man page:
man apt
man apt-getFor most common packages you are better off using the "Ubuntu Software" feature to install and upgrade packages such as chrome. This will ensure that all dependencies are installed along with the desired package.
1