Firefox cannot open "libgtk-3.so.0". How to circumvent?
Asked Answered
C

3

12

I have two CentOS VMs which use Jenkins to run automated tests through firefox. Both have firefox installed. Both versions of firefox are the same (firefox-56.0.1). I do not know if they are both x86_64 or some other type, but whichever they are, they are the same. (I am using the same .tar.bz2 file. I copied it from one instance to the other.)

In one instance, I am able to run firefox. "firefox --headless" returns "*** You are running in headless mode."

After copying the .tar.bz2 file to the other instance and installing firefox, I find that the new instance does not have the same performance. "firefox --headless" returns the following:

XPCOMGlueLoad error for file /usr/local/firefox/libmozgtk.so:
libgtk-3.so.0: cannot open shared object file: No such file or directory
Couldn't load XPCOM.

What might explain this difference? It appears that I did something right in the first instance, but I cannot tell what. Is there some setting that will prevent firefox from trying to use the "libgtk-3.so.0" file? This file does not exist on either instance.

I've seen this question elsewhere, but the answer seems to focus on versions (I know my version has worked in the first instance) and a particular bug that has been backlogged (this bug only bothers me for the new instance).

Cutlery answered 8/6, 2018 at 20:36 Comment(0)
C
16

Problem solved minutes after asking the question.

Simply run:

yum info gtk3

Check if gtk3 is installed. If not:

yum install gtk3

My old instance had gtk3 version 3.22.10 installed. My new instance had the same available but not installed. I don't recall seeing this in any of the guides to running firefox headlessly, but a search result that I did not originally think worth checking was able to resolve this rather quickly. Credit to the folks at https://forums.fedoraforum.org/showthread.php?310652-Udating-Firefox-fedora-19

For Ubuntu or Debian distros use:

apt-get install packagekit-gtk3-module
Cutlery answered 8/6, 2018 at 20:46 Comment(3)
I tried this on Ubuntu 19.10, but it did not solve my problem, which arose when installing a portable version of firefox esr68.5.0 with this script: gist.github.com/rubo77/…Touched
@Touched Did you resolve this issue? I'm having the same problem.Contravention
@Contravention Yes, see my answer belowTouched
T
4

You probably installed the wrong firefox version for 32bit on a 64bit system.

try downloading firefox with this portable installer download-mozilla-portable.sh which should work on a 64bit linux (tested in Ubuntu 19.10)

Touched answered 2/3, 2020 at 0:7 Comment(0)
J
0
sudo apt install libgtk-3-0:i386

fixed the issue for me (firefox 119, tarball install on lubuntu 22).

Jennine answered 13/11, 2023 at 11:57 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.