Unable to install any packages because of dependency conflicts with libgtk-3-0

Asked by Siddhartha Chakraborty on 2019-09-06

I am trying to install Firefox on Ubuntu 18.04.2 LTS. O/P from the VM below

Dependency problem on trying ot install Firefox
-------------------------------------------------------------------------

sudo apt-get install firefox
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 firefox : Depends: libgtk-3-0 (>= 3.4) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

Fetched dependency list
--------------------------------------

sudo apt-get build-dep firefox
Reading package lists... Done
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 builddeps:firefox : Depends: libx11-dev but it is not going to be installed
                     Depends: libx11-xcb-dev but it is not going to be installed
                     Depends: libxt-dev but it is not going to be installed
                     Depends: libxext-dev but it is not going to be installed
                     Depends: libgtk2.0-dev (>= 2.14) but it is not going to be installed
                     Depends: libgtk-3-dev (>= 3.4) but it is not going to be installed
                     Depends: libpango1.0-dev (>= 1.14.0) but it is not going to be installed
                     Depends: libstartup-notification0-dev but it is not going to be installed
                     Depends: mesa-common-dev but it is not going to be installed
                     Depends: libnotify-dev (>= 0.4) but it is not going to be installed
                     Depends: libxrender-dev but it is not going to be installed
                     Depends: xvfb but it is not going to be installed
                     Depends: clang-8 but it is not going to be installed
                     Depends: llvm-8-dev but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

No broken packages I guess
------------------------------------------

sudo apt --fix-broken install
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Tried cleaning already
---------------------------------

sudo apt-get autoclean
Reading package lists... Done
Building dependency tree
Reading state information... Done

sudo apt-get --purge autoremove
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Please advice.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu ubiquity Edit question
Assignee:
No assignee Edit question
Solved by:
Manfred Hampl
Solved:
2019-09-06
Last query:
2019-09-06
Last reply:
2019-09-06
Manfred Hampl (m-hampl) said : #1

For diagnostic purposes please provide the output of the following commands:

uname -a
lsb_release -crid
sudo dpkg --audit
apt policy firefox libgtk-3-0
apt --simulate install libgtk-3-0
sudo apt update
apt policy firefox libgtk-3-0
apt --simulate install libgtk-3-0

Thanks for reaching out. Please find below output for the commands executed in the same order as specified.

uname -a
Linux vcloud-opentext 4.15.0-60-generic #67-Ubuntu SMP Thu Aug 22 16:55:30 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

lsb_release -crid
Distributor ID: Ubuntu
Description: Ubuntu 18.04.2 LTS
Release: 18.04
Codename: bionic

sudo dpkg --audit
<No output>

apt policy firefox libgtk-3-0
firefox:
  Installed: (none)
  Candidate: 69.0+build2-0ubuntu0.18.04.1
  Version table:
     69.0+build2-0ubuntu0.18.04.1 500
        500 http://archive.ubuntu.com/ubuntu bionic-security/main amd64 Packages
     59.0.2+build1-0ubuntu1 500
        500 http://archive.ubuntu.com/ubuntu bionic/main amd64 Packages
libgtk-3-0:
  Installed: (none)
  Candidate: 3.22.30-1ubuntu1
  Version table:
     3.22.30-1ubuntu1 500
        500 http://archive.ubuntu.com/ubuntu bionic/main amd64 Packages

apt --simulate install libgtk-3-0
NOTE: This is only a simulation!
      apt needs root privileges for real execution.
      Keep also in mind that locking is deactivated,
      so don't depend on the relevance to the real current situation!
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 libgtk-3-0 : Depends: libwayland-egl1-mesa (>= 10.0.2) but it is not going to be installed or
                       libwayland-egl1
E: Unable to correct problems, you have held broken packages.

sudo apt update
Hit:1 http://archive.ubuntu.com/ubuntu bionic InRelease
Hit:2 http://archive.canonical.com/ubuntu bionic InRelease
Get:4 http://archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]
Get:3 http://dl.bintray.com/apache/cassandra 39x InRelease [3,168 B]
Get:5 http://archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]
Hit:6 https://dbeaver.io/debs/dbeaver-ce InRelease
Get:7 http://archive.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]
Fetched 255 kB in 3s (94.0 kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
All packages are up to date.

apt policy firefox libgtk-3-0
firefox:
  Installed: (none)
  Candidate: 69.0+build2-0ubuntu0.18.04.1
  Version table:
     69.0+build2-0ubuntu0.18.04.1 500
        500 http://archive.ubuntu.com/ubuntu bionic-security/main amd64 Packages
     59.0.2+build1-0ubuntu1 500
        500 http://archive.ubuntu.com/ubuntu bionic/main amd64 Packages
libgtk-3-0:
  Installed: (none)
  Candidate: 3.22.30-1ubuntu1
  Version table:
     3.22.30-1ubuntu1 500
        500 http://archive.ubuntu.com/ubuntu bionic/main amd64 Packages

apt --simulate install libgtk-3-0
NOTE: This is only a simulation!
      apt needs root privileges for real execution.
      Keep also in mind that locking is deactivated,
      so don't depend on the relevance to the real current situation!
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 libgtk-3-0 : Depends: libwayland-egl1-mesa (>= 10.0.2) but it is not going to be installed or
                       libwayland-egl1
E: Unable to correct problems, you have held broken packages.

Manfred Hampl (m-hampl) said : #3

Ok, let's continue:
What is the output of the commands

apt --simulate install libwayland-egl1-mesa
grep '^deb ' /etc/apt/sources.list

Please find output below-

sudo apt --simulate install libwayland-egl1-mesa
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 libwayland-egl1-mesa : Depends: libegl1 but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

grep '^deb ' /etc/apt/sources.list
deb http://archive.ubuntu.com/ubuntu bionic main restricted
deb http://archive.ubuntu.com/ubuntu bionic universe
deb http://archive.ubuntu.com/ubuntu bionic-updates universe
deb http://archive.ubuntu.com/ubuntu bionic multiverse
deb http://archive.ubuntu.com/ubuntu bionic-updates multiverse
deb http://archive.ubuntu.com/ubuntu bionic-backports main restricted universe multiverse
deb http://archive.canonical.com/ubuntu bionic partner
deb http://archive.ubuntu.com/ubuntu bionic-security main restricted

Best Manfred Hampl (m-hampl) said : #5

The configuration of your package management system is inconsistent.

The "bionic" and "backports" repositories are enabled for main, restricted, universe and multiverse.
"security" is only enabled for main and restricted
"updates" is only enabled for universe and multiverse
This does not make sense.

Edit the /etc/apt/sources.list configuration file with admin rights and enable "main" and "restricted" for "bionic-updates", and enable "universe" and "multiverse" for "bionic-security".

Then run "sudo apt-get update" and try installing firefox.
Maybe correcting the sources.list configuration file resolves the dependecy problem.

Thanks Manfred Hampl, that solved my question.