20

Every time I try to upgrade it shows me this message

sudo apt-get upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 libreoffice-avmedia-backend-gstreamer : Depends: libreoffice-core (= 1:6.0.7-0ubuntu0.18.04.9) but 1:6.0.6-0ubuntu0.18.04.1 is installed
 libreoffice-base : Depends: libreoffice-core (= 1:6.0.7-0ubuntu0.18.04.9) but 1:6.0.6-0ubuntu0.18.04.1 is installed
 libreoffice-base-core : Depends: libreoffice-core (= 1:6.0.7-0ubuntu0.18.04.9) but 1:6.0.6-0ubuntu0.18.04.1 is installed
 libreoffice-base-drivers : Depends: libreoffice-core (= 1:6.0.7-0ubuntu0.18.04.9) but 1:6.0.6-0ubuntu0.18.04.1 is installed
 libreoffice-calc : Depends: libreoffice-core (= 1:6.0.7-0ubuntu0.18.04.9) but 1:6.0.6-0ubuntu0.18.04.1 is installed
 libreoffice-draw : Depends: libreoffice-core (= 1:6.0.7-0ubuntu0.18.04.9) but 1:6.0.6-0ubuntu0.18.04.1 is installed
 libreoffice-gnome : Depends: libreoffice-core (= 1:6.0.7-0ubuntu0.18.04.9) but 1:6.0.6-0ubuntu0.18.04.1 is installed
 libreoffice-gtk3 : Depends: libreoffice-core (= 1:6.0.7-0ubuntu0.18.04.9) but 1:6.0.6-0ubuntu0.18.04.1 is installed
 libreoffice-impress : Depends: libreoffice-core (= 1:6.0.7-0ubuntu0.18.04.9) but 1:6.0.6-0ubuntu0.18.04.1 is installed
 libreoffice-math : Depends: libreoffice-core (= 1:6.0.7-0ubuntu0.18.04.9) but 1:6.0.6-0ubuntu0.18.04.1 is installed
 libreoffice-ogltrans : Depends: libreoffice-core (= 1:6.0.7-0ubuntu0.18.04.9) but 1:6.0.6-0ubuntu0.18.04.1 is installed
 libreoffice-sdbc-hsqldb : Depends: libreoffice-core (= 1:6.0.7-0ubuntu0.18.04.9) but 1:6.0.6-0ubuntu0.18.04.1 is installed
 libreoffice-writer : Depends: libreoffice-core (= 1:6.0.7-0ubuntu0.18.04.9) but 1:6.0.6-0ubuntu0.18.04.1 is installed
 openjdk-11-jre : Depends: openjdk-11-jre-headless (= 11.0.4+11-1ubuntu2~18.04.3) but 10.0.2+13-1ubuntu0.18.04.4 is installed
 python3-uno : Depends: libreoffice-core (= 1:6.0.7-0ubuntu0.18.04.9) but 1:6.0.6-0ubuntu0.18.04.1 is installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
3
  • 2
    Did you run sudo apt --fix-broken install? Aug 26, 2019 at 23:07
  • @ajgringo619 Have you? That command literally never works.
    – Cerin
    Apr 19 at 17:06
  • @Cerin - I've switched to an Arch-based distro since that post. When using Linux Mint, I did have to use that command a couple of times. Maybe sicvolo's answer will work for you. Apr 19 at 19:35

3 Answers 3

26

In certain cases you might also want to force the overwrite

sudo dpkg --configure --force-overwrite -a

Alternatively:

sudo apt -o Dpkg::Options::="--force-overwrite" --fix-broken install

4
  • 3
    I scoured all over the internet to find this solution. :) Aug 1, 2021 at 8:19
  • Dpkg really helped!
    – 0dminnimda
    May 2, 2022 at 6:27
  • it's frustrating that this issue breaks the whole sytem update system. sudo dpkg --configure --force-overwrite -a was the solution: just beware that the things it lists as broken may indeed break: Tolerable if getting the rest of the system updated is in fact more urgent (as it often is, otherwise you miss security-critical updates). Issue affects far more than just libreoffice.
    – RGD2
    Jun 7, 2022 at 0:39
  • thanks a lot. alternative solution worked for me
    – BC Smith
    Jul 6, 2022 at 15:25
10
sudo apt --fix-broken install

Is not valid command for apt v.1.6.12. What should help is:

sudo apt install --fix-broken

or

sudo apt reinstall
5
  • Given that apt itself suggests apt --fix-broken install, I think it’s safe to assume that variant works. apt reinstall won’t work on its own, it needs to be told what package to reinstall. Jun 11, 2020 at 13:52
  • thank you, this worked Apr 14, 2021 at 10:11
  • @StephenKitt apt still suggests the same, but wouldn't execute and give the help menu every time I execute apt --fix-broken install, but as suggested in the answer, apt install --fix-broken works perfectly fine and fixes everything. Jul 20, 2021 at 19:08
  • @YashvanderBamel what version of apt do you have? Jul 20, 2021 at 19:13
  • @StephenKitt 2.0.6 Jul 20, 2021 at 19:20
3

Try these out:

sudo apt --fix-broken install
sudo apt-get update
sudo apt-get upgrade
3
  • 1
    I tried the first one many times but it seems is not working properly, i get this all the time
    – Carlos tmf
    Aug 27, 2019 at 17:01
  • 1
    it wont let me use sudo apt --fix-broken install
    – Carlos tmf
    Aug 27, 2019 at 17:50
  • You can try deleting the lock files if present. sudo rm /var/lib/apt/lists/lock You may also need to delete the lock file in the cache directory sudo rm /var/cache/apt/archives/lock Aug 28, 2019 at 5:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .