Topic: https://intoli.com/blog/installing-google-chrome-on-centos/
hide preview

What's next? verify your email address for reply notifications!

unverified 6y, 360d ago

Excellent article..Thanks..immensely helpful.

hide preview

What's next? verify your email address for reply notifications!

qRxMxiAL 6y, 357d ago

thanks for the great article! just tried the localinstall

[ec2-user@ip-172-31-6-82 ~]$ cat /etc/system-release
Amazon Linux AMI release 2017.03
sudo yum --nogpgcheck localinstall https://intoli.com/blog/installing-google-chrome-on-centos/google-chrome-stable-60.0.3112.113-1.x86_64.rpm

it seems to work for me, but when i try to generate a pdf I'm getting some weird error messages. (the pdf is being generated though)

is this something I could fix?

[ec2-user@ip-172-31-6-82 ~]$ google-chrome-stable --headless --disable-gpu --print-to-pdf https://www.orf.at
[1029/160518.999058:ERROR:bus.cc(422)] Failed to connect to the bus: Failed to connect to socket /run/dbus/system_bus_socket: No such file or directory
[1029/160518.999195:ERROR:bus.cc(422)] Failed to connect to the bus: Failed to connect to socket /run/dbus/system_bus_socket: No such file or directory
[1029/160518.999331:ERROR:bus.cc(422)] Failed to connect to the bus: Failed to connect to socket /run/dbus/system_bus_socket: No such file or directory
[1029/160518.999379:WARNING:property.cc(150)] DaemonVersion: GetAndBlock: failed.
[1029/160518.999475:ERROR:bus.cc(422)] Failed to connect to the bus: Failed to connect to socket /run/dbus/system_bus_socket: No such file or directory
[1029/160518.999547:ERROR:bus.cc(422)] Failed to connect to the bus: Failed to connect to socket /run/dbus/system_bus_socket: No such file or directory
[1029/160519.787873:ERROR:gl_implementation.cc(246)] Failed to load /opt/google/chrome/libosmesa.so: /opt/google/chrome/libosmesa.so: cannot open shared object file: No such file or directory
[1029/160519.790114:ERROR:gpu_child_thread.cc(264)] Exiting GPU process due to errors during initialization
[1029/160519.852964:ERROR:bus.cc(422)] Failed to connect to the bus: Failed to connect to socket /run/dbus/system_bus_socket: No such file or directory
[1029/160519.852985:ERROR:bus.cc(422)] Failed to connect to the bus: Failed to connect to socket /run/dbus/system_bus_socket: No such file or directory
[1029/160519.853018:ERROR:bus.cc(422)] Failed to connect to the bus: Failed to connect to socket /run/dbus/system_bus_socket: No such file or directory
[1029/160519.853021:WARNING:property.cc(150)] DaemonVersion: GetAndBlock: failed.
[1029/160519.853037:ERROR:bus.cc(422)] Failed to connect to the bus: Failed to connect to socket /run/dbus/system_bus_socket: No such file or directory
[1029/160519.853050:ERROR:bus.cc(422)] Failed to connect to the bus: Failed to connect to socket /run/dbus/system_bus_socket: No such file or directory
[1029/160520.170447:INFO:headless_shell.cc(464)] Written to file output.pdf.
[1029/160520.176012:ERROR:media_internals.cc(107)] Cannot get RenderProcessHost
remark link
hide preview

What's next? verify your email address for reply notifications!

evan 6y, 356d ago

This probably just means that the dbus service isn't running on your machine. If you run sudo service messagebus restart on CentOS 6 or Amazon Linux then it should hopefully resolve those errors. I wouldn't worry too much about the errors though, dbus should be used primarily for inter-process communication which would be used for desktop integration (e.g. notifications).

hide preview

What's next? verify your email address for reply notifications!

VYbCkZI7 6y, 352d ago

After installing the rpm on Amazon Linux, I'm getting the following error:

/usr/bin/google-chrome: symbol lookup error: /opt/google/chrome/lib/libgtk-3.so.0: undefined symbol: g_log_structured

Here's the specific linux version: Linux version 4.9.51-10.52.amzn1.x86_64 (mockbuild@gobi-build-64010) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-11) (GCC) ) #1 SMP Fri Sep 29 01:16:19 UTC 2017

Would appreciate any help in getting past this issue!

remark link
hide preview

What's next? verify your email address for reply notifications!

evan 6y, 351d ago [edited]

This error is caused by running the Chrome executable without the --headless flag.

hide preview

What's next? verify your email address for reply notifications!

unverified 6y, 333d ago

thanks for your share, when I execute the command on CentOS 6.6, I got the error message

......
--> Finished Dependency Resolution  
Error: Package: google-chrome-stable-60.0.3112.113-1.x86_64 (/google-chrome-stable-60.0.3112.113-1.x86_64)  
           Requires: libc.so.6(GLIBC_2.14)(64bit)  
Error: Package: google-chrome-stable-60.0.3112.113-1.x86_64 (/google-chrome-stable-60.0.3112.113-1.x86_64)  
           Requires: libstdc++.so.6(GLIBCXX_3.4.15)(64bit)
Error: Package: google-chrome-stable-60.0.3112.113-1.x86_64 (/google-chrome-stable-60.0.3112.113-1.x86_64)
           Requires: libstdc++.so.6(GLIBCXX_3.4.19)(64bit)
Error: Package: google-chrome-stable-60.0.3112.113-1.x86_64 (/google-chrome-stable-60.0.3112.113-1.x86_64)
           Requires: libstdc++.so.6(GLIBCXX_3.4.14)(64bit)
Error: Package: google-chrome-stable-60.0.3112.113-1.x86_64 (/google-chrome-stable-60.0.3112.113-1.x86_64)
           Requires: libstdc++.so.6(GLIBCXX_3.4.18)(64bit)
Error: Package: google-chrome-stable-60.0.3112.113-1.x86_64 (/google-chrome-stable-60.0.3112.113-1.x86_64)
           Requires: libc.so.6(GLIBC_2.15)(64bit)

Is it reasonable ? When I check with yum, the version of glibc seems should be 2.12
Should I build 2.14 and 2.15 on CentOs 6 ?
thanks for your reply

remark link
hide preview

What's next? verify your email address for reply notifications!

evan 6y, 303d ago

Can you try it with the installer script? There started being some issues with library compatibility so we updated the article.

hide preview

What's next? verify your email address for reply notifications!

unverified 6y, 298d ago

Then how run google-chrome?

remark link
hide preview

What's next? verify your email address for reply notifications!

evan 6y, 298d ago

The Google Chrome startup script is google-chrome-stable. You will likely want to evoke it with the both --headless and --disable-gpu flags.

remark link parent
hide preview

What's next? verify your email address for reply notifications!

F9FuLLks 6y, 298d ago [edited]

Used installer script, RHEL 6.9 up to date. tried to run chrome as

$ google-chrome-stable --headless --disable-gpu

cat: relocation error: /opt/google/chrome/lib/libc.so.6: symbol _dl_starting_up, version GLIBC_PRIVATE not defined in file ld-linux-x86-64.so.2 with link time reference

cat: relocation error: /opt/google/chrome/lib/libc.so.6: symbol _dl_starting_up, version GLIBC_PRIVATE not defined in file ld-linux-x86-64.so.2 with link time reference

remark link parent
hide preview

What's next? verify your email address for reply notifications!

evan 6y, 270d ago

Thanks, it seems that the glibc version on 6.9 is incompatible with the packages that are being borrowed from CentOS 7. I've improved the error handling for this in the script and I'm working on a fix.

hide preview

What's next? verify your email address for reply notifications!

tKedwlkD 6y, 285d ago [edited]

After running google-chrome-stable --headless --disable-gpu I receive no errors but nothing seems to happen. Also I am trying to find where Chrome was installed.

Any thoughts?

Thanks!

P.S Great article! Spent forever trying to find this

remark link
hide preview

What's next? verify your email address for reply notifications!

evan 6y, 278d ago

That's roughly what I would expect to happen if things are working. You'll either need to use a browser automation framework like Selenium, or connect to the browser instance via the Dev Tools Protocol to control the browser. You can verify that things are installed properly by including the --screenshot. If the following outputs a file called screenshot.png, then you should be good to go.

google-chrome-stable --headless --disable-gpu --screenshot https://intoli.com/blog/installing-google-chrome-on-centos/
hide preview

What's next? verify your email address for reply notifications!

K1qOwgz6 6y, 279d ago

I have Red Hat Enterprise Linux Server release 5.3 (Tikanga), Linux Bare Metal,

I get the following error:

cat: relocation error: /opt/google/chrome/lib/libc.so.6: catsymbol _dl_starting_up, version GLIBC_PRIVATE not defined in file ld-linux-x86-64.so.2 with link time reference: relocation error: /opt/google/chrome/lib/libc.so.6: symbol _dl_starting_up, version GLIBC_PRIVATE not defined in file ld-linux-x86-64.so.2 with link time reference

Any help is much appreciated.

remark link
hide preview

What's next? verify your email address for reply notifications!

evan 6y, 270d ago

I'm working on a fix for a similar issue with 6.9 variants. There's a chance that it might work here as well, but the library compatibilities between 5 and 7 will be more difficult to overcome.

hide preview

What's next? verify your email address for reply notifications!

QHp932Rl 6y, 276d ago

I ran the installer script and got this error at the end:

Downloading packages: 
Running transaction check
ERROR with transaction check vs depsolve:
libgcc < 4.4.6-4.81.amzn1 is obsoleted by libgcc44-4.4.6-4.81.amzn1.x86_64
You could try running: rpm -Va --nofiles --nodigest
remark link
hide preview

What's next? verify your email address for reply notifications!

evan 6y, 270d ago

Which AMI are you using? This seems like it should be relatively easy to fix, but I'll need to reproduce the issue first.

hide preview

What's next? verify your email address for reply notifications!

unverified 6y, 275d ago [edited]

Installed - but I get this:

[0118/224629.251803:FATAL:nss_util.cc(631)] NSS_VersionCheck("3.26") failed. NSS >= 3.26 is required. Please upgrade to the latest NSS, and if you still get this error, contact your distribution maintainer. Aborted

However - it would seem to me that I have nss 3.28 installed:

$ rpm -qa | grep nss-3

nss-3.28.4-12.80.amzn1.x86_64

nss-3.28.4-12.80.amzn1.i686

remark link
hide preview

What's next? verify your email address for reply notifications!

evan 6y, 270d ago

Could you share which AMI you're using so that I can take a look?

hide preview

What's next? verify your email address for reply notifications!

unverified 6y, 273d ago

I installed the script using curl https://intoli.com/install-google-chrome.sh | bash as per the Github comment It finished with the number of errors, but the success message in the very end:

27647 blocks
rm: relocation error: /opt/google/chrome/lib/libc.so.6: symbol _dl_starting_up, version GLIBC_PRIVATE not defined in file ld-linux-x86-64.so.2 with link time reference
awk: relocation error: /opt/google/chrome/lib/libc.so.6: symbol _dl_starting_up, version GLIBC_PRIVATE not defined in file ld-linux-x86-64.so.2 with link time reference
Finding dependency for
arch: relocation error: /opt/google/chrome/lib/libc.so.6: symbol _dl_starting_up, version GLIBC_PRIVATE not defined in file ld-linux-x86-64.so.2 with link time reference
/usr/bin/python: relocation error: /opt/google/chrome/lib/libc.so.6: symbol _dl_starting_up, version GLIBC_PRIVATE not defined in file ld-linux-x86-64.so.2 with link time reference
arch: relocation error: /opt/google/chrome/lib/libc.so.6: symbol _dl_starting_up, version GLIBC_PRIVATE not defined in file ld-linux-x86-64.so.2 with link time referencearch: relocation error
: /opt/google/chrome/lib/libc.so.6: symbol _dl_starting_up, version GLIBC_PRIVATE not defined in file ld-linux-x86-64.so.2 with link time reference
sed: relocation error: /opt/google/chrome/lib/libc.so.6: symbol _dl_starting_up, version GLIBC_PRIVATE not defined in file ld-linux-x86-64.so.2 with link time reference
sed: relocation error: /opt/google/chrome/lib/libc.so.6: symbol _dl_starting_up, version GLIBC_PRIVATE not defined in file ld-linux-x86-64.so.2 with link time reference
wget: relocation error: /opt/google/chrome/lib/libc.so.6: symbol _dl_starting_up, version GLIBC_PRIVATE not defined in file ld-linux-x86-64.so.2 with link time reference
cpio: relocation error: /opt/google/chrome/lib/libc.so.6: symbol _dl_starting_up, version GLIBC_PRIVATE not defined in file ld-linux-x86-64.so.2 with link time reference
rpm2cpio: relocation error: /opt/google/chrome/lib/libc.so.6: symbol _dl_starting_up, version GLIBC_PRIVATE not defined in file ld-linux-x86-64.so.2 with link time reference
rm: relocation error: /opt/google/chrome/lib/libc.so.6: symbol _dl_starting_up, version GLIBC_PRIVATE not defined in file ld-linux-x86-64.so.2 with link time reference
find: relocation error: /opt/google/chrome/lib/libc.so.6: symbol _dl_starting_up, version GLIBC_PRIVATE not defined in file ld-linux-x86-64.so.2 with link time reference
grep: relocation error: /opt/google/chrome/lib/libc.so.6: symbol _dl_starting_up, version GLIBC_PRIVATE not defined in file ld-linux-x86-64.so.2 with link time reference
xargs: relocation error: /opt/google/chrome/lib/libc.so.6: symbol _dl_starting_up, version GLIBC_PRIVATE not defined in file ld-linux-x86-64.so.2 with link time reference
rm: relocation error: /opt/google/chrome/lib/libc.so.6: symbol _dl_starting_up, version GLIBC_PRIVATE not defined in file ld-linux-x86-64.so.2 with link time reference
awk: relocation error: /opt/google/chrome/lib/libc.so.6: symbol _dl_starting_up, version GLIBC_PRIVATE not defined in file ld-linux-x86-64.so.2 with link time reference
Finding dependency for
arch: relocation error: /opt/google/chrome/lib/libc.so.6: symbol _dl_starting_up, version GLIBC_PRIVATE not defined in file ld-linux-x86-64.so.2 with link time reference
arch: relocation error: /opt/google/chrome/lib/libc.so.6: symbol _dl_starting_up, version GLIBC_PRIVATE not defined in file ld-linux-x86-64.so.2 with link time reference
sed: relocation error: /opt/google/chrome/lib/libc.so.6: symbol _dl_starting_up, version GLIBC_PRIVATE not defined in file ld-linux-x86-64.so.2 with link time reference
arch: relocation error: /opt/google/chrome/lib/libc.so.6: symbol _dl_starting_up, version GLIBC_PRIVATE not defined in file ld-linux-x86-64.so.2 with link time reference
/usr/bin/python: relocation error: /opt/google/chrome/lib/libc.so.6: symbol _dl_starting_up, version GLIBC_PRIVATE not defined in file ld-linux-x86-64.so.2 with link time reference
sed: relocation error: /opt/google/chrome/lib/libc.so.6: symbol _dl_starting_up, version GLIBC_PRIVATE not defined in file ld-linux-x86-64.so.2 with link time reference
wget: relocation error: /opt/google/chrome/lib/libc.so.6: symbol _dl_starting_up, version GLIBC_PRIVATE not defined in file ld-linux-x86-64.so.2 with link time reference
cpio: relocation error: /opt/google/chrome/lib/libc.so.6: symbol _dl_starting_up, version GLIBC_PRIVATE not defined in file ld-linux-x86-64.so.2 with link time reference
rpm2cpio: relocation error: /opt/google/chrome/lib/libc.so.6: symbol _dl_starting_up, version GLIBC_PRIVATE not defined in file ld-linux-x86-64.so.2 with link time reference
rm: relocation error: /opt/google/chrome/lib/libc.so.6: symbol _dl_starting_up, version GLIBC_PRIVATE not defined in file ld-linux-x86-64.so.2 with link time reference
find: relocation error: /opt/google/chrome/lib/libc.so.6: symbol _dl_starting_up, version GLIBC_PRIVATE not defined in file ld-linux-x86-64.so.2 with link time reference
grep: relocation error: /opt/google/chrome/lib/libc.so.6: symbol _dl_starting_up, version GLIBC_PRIVATE not defined in file ld-linux-x86-64.so.2 with link time reference
xargs: relocation error: /opt/google/chrome/lib/libc.so.6: symbol _dl_starting_up, version GLIBC_PRIVATE not defined in file ld-linux-x86-64.so.2 with link time reference
rm: relocation error: /opt/google/chrome/lib/libc.so.6: symbol _dl_starting_up, version GLIBC_PRIVATE not defined in file ld-linux-x86-64.so.2 with link time reference
grep: relocation error: /opt/google/chrome/lib/libc.so.6: symbol _dl_starting_up, version GLIBC_PRIVATE not defined in file ld-linux-x86-64.so.2 with link time reference
rm: relocation error: /opt/google/chrome/lib/libc.so.6: symbol _dl_starting_up, version GLIBC_PRIVATE not defined in file ld-linux-x86-64.so.2 with link time reference
Successfully installed google-chrome-stable-63.0.3239.132-1.x86_64.rpm

When I try running the Chrome, the error comes back:

google-chrome-stable  --version
/bin/bash: relocation error: /opt/google/chrome/lib/libc.so.6: symbol _dl_starting_up, version GLIBC_PRIVATE not defined in file ld-linux-x86-64.so.2 with link time reference

or:

google-chrome-stable --headless --disable-gpu --screenshot https://intoli.com/blog/installing-google-chrome-on-centos/
/bin/bash: relocation error: /opt/google/chrome/lib/libc.so.6: symbol _dl_starting_up, version GLIBC_PRIVATE not defined in file ld-linux-x86-64.so.2 with link time reference

Here is the instance info:

$ cat /etc/system-release
CentOS release 6.9 (Final)

$ uname -a
Linux phantomjsbuild2 2.6.32-358.6.2.el6.x86_64 #1 SMP Thu May 16 20:59:36 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

Any thoughts/suggestions are appreciated.

remark link
hide preview

What's next? verify your email address for reply notifications!

unverified 6y, 270d ago

No fix for 6.9 yet, stated in the install message.

hide preview

What's next? verify your email address for reply notifications!

unverified 6y, 272d ago

THANK YOU, I was going crazy without your help!!! That script fixed it on my Amazon Linux AMI =)

hide preview

What's next? verify your email address for reply notifications!

unverified 6y, 270d ago [edited]

Thank you so much for the resource – it almost, almost works!

[ec2-user@ip-10-0-0-128 ~]$ cat /etc/system-release
Amazon Linux AMI release 2017.09
[ec2-user@ip-10-0-0-128 ~]$ ldd /opt/google/chrome/chrome | grep 'not found'
[ec2-user@ip-10-0-0-128 ~]$ google-chrome-stable --headless --disable-gpu --screenshot     https://intoli.com/blog/installing-google-chrome-on-centos/
Failed to generate minidump.Illegal instruction
[ec2-user@ip-10-0-0-128 ~]$
remark link
hide preview

What's next? verify your email address for reply notifications!

mengwong 6y, 270d ago

For lack of any better ideas I installed X11 and set up an ssh -X forward to see what happens in non-headless mode. ¯\_(ツ)_/¯

[ec2-user@ip-10-0-0-128 ~]$ google-chrome-stable 
/opt/google/chrome/nacl_helper: error while loading shared libraries: libgconf-2.so.4: cannot open shared object file: No such file or directory
[1:1:0124/101109.009694:ERROR:nacl_fork_delegate_linux.cc(315)] Bad NaCl helper startup ack (0 bytes)
/usr/bin/google-chrome-stable: symbol lookup error: /opt/google/chrome/lib/libgdk-3.so.0: undefined symbol: g_type_add_instance_private
remark link parent
hide preview

What's next? verify your email address for reply notifications!

evan 6y, 270d ago

Could you share the specific AMI identifier that you're using?

remark link parent
hide preview

What's next? verify your email address for reply notifications!

unverified 6y, 265d ago

Thanks, I'm on ami-910d72ed which is in ap-southeast-1; sorry I failed to mention that first time round. You should be able to repro with any of the ECS-optimized AMIs listed at https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-optimized_AMI.html

I start by sudo yum installing wget zsh xauth xterm

Latest error:

google-chrome-stable-64.0.3282.119-1.x86_64.rpm                                                                                                                           |  49 MB  00:00:00
Downloaded google-chrome-stable-64.0.3282.119-1.x86_64.rpm
################################# [100%]
Updating / installing...
################################# [100%]
Error: Could not find xdg-icon-resource
warning: %post(google-chrome-stable-64.0.3282.119-1.x86_64) scriptlet failed, exit status 1
--2018-01-29 09:50:18--  http://mirror.centos.org/centos/7/os/x86_64/Packages/glibc-2.17-196.el7.x86_64.rpm

My success conditions are to either run headless with chromedriver, or launch a GUI browser via X tunneled over ssh -Y.

When I try to launch,

[ec2-user@ip-10-0-1-100 ~]$ google-chrome-stable
/opt/google/chrome/nacl_helper: error while loading shared libraries: libXi.so.6: cannot open shared object file: No such file or directory
[1:1:0129/095422.137553:ERROR:nacl_fork_delegate_linux.cc(316)] Bad NaCl helper startup ack (0 bytes)

(google-chrome-stable:10141): GdkPixbuf-WARNING **: Cannot open pixbuf loader module file '/usr/lib64/gdk-pixbuf-2.0/2.10.0/loaders.cache': No such file or directory

This likely means that your installation is broken.
Try running the command
  gdk-pixbuf-query-loaders > /usr/lib64/gdk-pixbuf-2.0/2.10.0/loaders.cache
to make things work again for the time being.
Fontconfig warning: "/etc/fonts/conf.d/30-metric-aliases.conf", line 84: Having multiple <family> in <alias> isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/30-metric-aliases.conf", line 93: Having multiple <family> in <alias> isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/30-metric-aliases.conf", line 102: Having multiple <family> in <alias> isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/40-nonlatin.conf", line 33: Having multiple <family> in <alias> isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/40-nonlatin.conf", line 59: Having multiple <family> in <alias> isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/40-nonlatin.conf", line 68: Having multiple <family> in <alias> isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/40-nonlatin.conf", line 79: Having multiple <family> in <alias> isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/40-nonlatin.conf", line 88: Having multiple <family> in <alias> isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/45-latin.conf", line 23: Having multiple <family> in <alias> isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/45-latin.conf", line 39: Having multiple <family> in <alias> isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/45-latin.conf", line 56: Having multiple <family> in <alias> isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/45-latin.conf", line 66: Having multiple <family> in <alias> isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/45-latin.conf", line 75: Having multiple <family> in <alias> isn't supported and may not work as expected
[10141:10155:0129/095422.695884:ERROR:bus.cc(394)] Failed to connect to the bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
[10141:10188:0129/095422.975827:ERROR:bus.cc(394)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
Trace/breakpoint trap

I do observe:

[root@ip-10-0-1-100]/opt/google/chrome# ls **/libgdk*
lib/libgdk-3.so.0  lib/libgdk-3.so.0.2200.10  lib/libgdk_pixbuf-2.0.so.0  lib/libgdk_pixbuf-2.0.so.0.3600.5

Really appreciate the help, I would do more sleuthing but I'm going a little outside my comfort zone with the lib munging.

remark link parent

load more (2 remarks)
hide preview

What's next? verify your email address for reply notifications!

unverified 6y, 44d ago

Getting exactly same error

hide preview

What's next? verify your email address for reply notifications!

evan 6y, 44d ago

My success conditions are to either run headless with chromedriver, or launch a GUI browser via X tunneled over ssh -Y.

If I'm understanding you correctly, it works fine when running in headless mode and in non-headless mode when you enable X tunnelling? If so, it seems like the issue is trying to run the full browser on a headless server. Do you xvfb, or something similar, enabled on the server?

hide preview

What's next? verify your email address for reply notifications!

evan 6y, 268d ago

Hi everyone, we just updated the script and it should be working with 6.9 now. If you run into any issues, then please include as much information about the system as possible in your comments. In particular, it's extremely helpful to include which AMI you're using if you're on AWS.

hide preview

What's next? verify your email address for reply notifications!

unverified 6y, 264d ago

[root@api-centos7-agent2 ~]# google-chrome-stable --headless --disable-gpu --screenshot --no-sandbox https://intoli.com/blog/installing-google-chrome-on-centos/ [0130/024448.999192:ERROR:instance.cc(49)] Unable to locate service manifest for metrics [0130/024448.999259:ERROR:service_manager.cc(890)] Failed to resolve service name: metrics [0130/024448.999467:ERROR:gpu_process_transport_factory.cc(1009)] Lost UI shared context. [0130/024449.240366:ERROR:instance.cc(49)] Unable to locate service manifest for metrics [0130/024449.240385:ERROR:service_manager.cc(890)] Failed to resolve service name: metrics [0130/024451.391944:INFO:headless_shell.cc(566)] Written to file screenshot.png. [root@api-centos7-agent2 ~]

remark link
hide preview

What's next? verify your email address for reply notifications!

evan 6y, 263d ago

That looks like everything worked. Have you checked the screenshot.png file?

hide preview

What's next? verify your email address for reply notifications!

unverified 6y, 258d ago

Hi,

Great article! Thank you for the very convenient script.

I ran the script against this AMI ID:

amzn-ami-hvm-2017.09.1.20180108-x86_64-gp2 (ami-32cf7b4a)

...which is a "Community AMI".

I got several errors, followed by: "Successfully installed google-chrome-stable, Google Chrome 64.0.3282.140 ."

I'm hesitant to feel confident that the installation of google-chrome-stable was successful when I see these errors outputted from the script:

Error: Package: google-chrome-stable-64.0.3282.140-1.x86_64 (google-chrome)
       Requires: libXss.so.1()(64bit)

Error: Package: google-chrome-stable-64.0.3282.140-1.x86_64 (google-chrome)
       Requires: libgconf-2.so.4()(64bit)

Error: Package: google-chrome-stable-64.0.3282.140-1.x86_64 (google-chrome)
       Requires: libgdk-3.so.0()(64bit)

Error: Package: google-chrome-stable-64.0.3282.140-1.x86_64 (google-chrome)
       Requires: xdg-utils

Error: Package: google-chrome-stable-64.0.3282.140-1.x86_64 (google-chrome)
       Requires: libatk-1.0.so.0()(64bit)

Error: Package: google-chrome-stable-64.0.3282.140-1.x86_64 (google-chrome)
       Requires: libatk-bridge-2.0.so.0()(64bit)

Error: Package: google-chrome-stable-64.0.3282.140-1.x86_64 (google-chrome)
       Requires: libgtk-3.so.0()(64bit)

Error: Package: google-chrome-stable-64.0.3282.140-1.x86_64 (google-chrome)
       Requires: libgdk_pixbuf-2.0.so.0()(64bit)

You could try using --skip-broken to work around the problem

You could try running: rpm -Va --nofiles --nodigest

Error: Could not find xdg-icon-resource

warning: %post(google-chrome-stable-64.0.3282.140-1.x86_64) scriptlet failed, exit status 1
--2018-02-03 15:37:06--  http://mirror.centos.org/centos/7/os/x86_64/Packages/glibc-2.17-196.el7.x86_64.rpm

I then decided to try 'ldd' on the installed /opt/google/chrome/chrome, and I saw several "not found" entries:

$ ldd /opt/google/chrome/chrome | grep "not found"

libXcursor.so.1 => not found

libXdamage.so.1 => not found

libXfixes.so.3 => not found

libcups.so.2 => not found

libgconf-2.so.4 => not found

libXrandr.so.2 => not found

libXss.so.1 => not found

libpangocairo-1.0.so.0 => not found

libpango-1.0.so.0 => not found

libcairo.so.2 => not found

libatk-1.0.so.0 => not found

libatk-bridge-2.0.so.0 => not found

libgtk-3.so.0 => not found

libgdk-3.so.0 => not found

libgdk_pixbuf-2.0.so.0 => not found

So my questions are, if you please...

1) Are the installation error messages valid, or can they be safely ignored?

2) At the end of installation, is it expected that 'ldd /opt/google/chrome/chrome' should find all libraries (and so return no "not found" entries)?

3) When I run 'google-chrome-stable --headless --disable-gpu', I see these errors:

[0205/063813.098944:ERROR:gpu_process_transport_factory.cc(1009)] Lost UI shared context.

[0205/063813.275826:ERROR:instance.cc(49)] Unable to locate service manifest for metrics

[0205/063813.275847:ERROR:service_manager.cc(890)] Failed to resolve service name: metrics

... and I'm particularly concerned about the "Lost UI shared context" error. Could you please tell me what effect you think this error will have on the stability of the chrome installation? Do you think this is a serious error message? I googled for the message and found a page describing the error with the exact "1009" line number (error code?), which is at https://github.com/GoogleChrome/puppeteer/issues/1464, but the solution there was just to stop using python with proxychains, which isn't relevant in my case.

I did later run with --screenshot:

google-chrome-stable --headless --screenshot http://www.google.com --disable-gpu

...and it did generate a 'screenshot.png' file in my CWD, but I'm not sure whether the passing of this basic test is a good indicator that there are no major issues with the google chrome installation, given all the errors and the "not found" chrome binary dependencies.

I would very much appreciate your help and guidance on the above concerns. Thank you very much for all your efforts! :-)

remark link
hide preview

What's next? verify your email address for reply notifications!

evan 6y, 256d ago [edited]

1) Are the installation error messages valid, or can they be safely ignored?

These can definitely be safely ignored. The script tries a direct installation first, and this is expected to fail on any 6.X distribution. You'll see these errors whenever the script has to do something more complicated than just installing the RPM. The success message is only output if things actually worked. It checks that it's able to successfully run Chrome before outputting that message.

2) At the end of installation, is it expected that 'ldd /opt/google/chrome/chrome' should find all libraries (and so return no "not found" entries)?

This won't work in general because the system linker isn't aware of the self-contained library directory. The installation script puts all of the necessary libraries in /opt/google/chrome/lib/. You'll potentially have better luck running LD_LIBRARY_PATH=/opt/google/chrome/lib/ ldd /opt/google/chrome/chrome so that the linker knows where to look. That said, if the system linker is compiled with an incompatible glibc version, the installation script will actually bundle the linker from the CentOS 7 repository and patch the Chrome binaries to refer to the relocated linker in the INTERP header. In that case, you might need to run something like LD_TRACE_LOADED_OBJECTS=1 LD_LIBRARY_PATH=/opt/google/chrome/lib/ /opt/google/chrome/lib/ld-linux.so.2 /opt/google/chrome/chrome to actually reproduce the same linking behavior that would take place when you run the patched binaries.

3) When I run 'google-chrome-stable --headless --disable-gpu', I see these errors...

I'm honestly not sure exactly what these errors signify, but I can say that I've done a fair bit of testing with the relocated binaries and haven't had any issues.

hide preview

What's next? verify your email address for reply notifications!

unverified 6y, 228d ago

THANK YOU! THANK YOU!

I have been trying to do this for years!!! At first I wasn't sure it was going to work. but I tired and I can finally run my python selenium script with the google-chrome on Amazon AMI Linux I only needed to do some simlpe cmds to add to the path ln -s /opt/google/chrome/google-chrome /usr/bin/google-chrome

hide preview

What's next? verify your email address for reply notifications!

unverified 6y, 180d ago

Hi, I install chrome on an ec2 instance using the command curl https://intoli.com/install-google-chrome.sh | bash and it seemed to be successful. However I'm getting error messages trying to run google-chrome-stable --headless --disable-gpu --no-sandbox on a centos ec2 instance

[0423/213433.372679:ERROR:gpu_process_transport_factory.cc(1007)] Lost UI shared context. Fontconfig warning: "/etc/fonts/fonts.conf", line 146: blank doesn't take any effect anymore. please remove it from your fonts.conf Failed to generate minidump.[0100/000000.415274:ERROR:broker_posix.cc(43)] Invalid node channel message

Some system info:

uname -a: Linux 37fbcca1a891 4.9.58-18.55.amzn1.x86_64 #1 SMP Thu Nov 2 04:38:47 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

google-chrome-stable --version: Google Chrome 66.0.3359.117

cat /etc/os-release: NAME="CentOS Linux" VERSION="7 (Core)" ID="centos" ID_LIKE="rhel fedora" VERSION_ID="7" PRETTY_NAME="CentOS Linux 7 (Core)" ANSI_COLOR="0;31" CPE_NAME="cpe:/o:centos:centos:7" HOME_URL="https://www.centos.org/" BUG_REPORT_URL="https://bugs.centos.org/"

CENTOS_MANTISBT_PROJECT="CentOS-7" CENTOS_MANTISBT_PROJECT_VERSION="7" REDHAT_SUPPORT_PRODUCT="centos" REDHAT_SUPPORT_PRODUCT_VERSION="7"

Any help is greatly appreciated!

hide preview

What's next? verify your email address for reply notifications!

posaunehm 6y, 177d ago

this article is still GREAT, however, there are no rpm package named google-chrome-stable now.

so this script fails at below code.

yumdownloader google-chrome-stable

you can change this line like below, download rpm package directly.

wget https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm
hide preview

What's next? verify your email address for reply notifications!

unverified 6y, 177d ago [edited]

Stopped working for me just now. Last output lines:

Making all in tests

make[1]: Entering directory `/tmp/google-chrome-installation/patchelf-0.9/tests'

make[1]: Nothing to be done for `all'.

make[1]: Leaving directory `/tmp/google-chrome-installation/patchelf-0.9/tests'

make[1]: Entering directory `/tmp/google-chrome-installation/patchelf-0.9'

make[1]: Nothing to be done for `all-am'.

make[1]: Leaving directory `/tmp/google-chrome-installation/patchelf-0.9'

stat: No such file or directory

stat: No such file or directory

sed: can't read /opt/google/chrome/google-chrome: No such file or directory

Attempted experimental patching of Chrome to use a relocated glibc version.

bash: line 201: google-chrome-stable: command not found

Installation has failed.

Please email contact@intoli.com with the details of your operating system. If you're using using AWS, please include the AMI identifier for the instance.

hide preview

What's next? verify your email address for reply notifications!

evan 6y, 174d ago [edited]

UPDATE: The upstream issue has been resolved, and everything should be working again.


Hey everybody, there's currently an upstream issue with the Google Chrome Yum repository. If you would like to get this resolved quickly, the best thing you can do right now is to leave a comment at this link confirming that you're experiencing the same problem (or at least vote for the issue).

In the meantime, I've updated the script to download the RPM directly using the link that @posaunehm's provided. The script should be working again for the time being, let me know if you run into any other issues.

remark link
hide preview

What's next? verify your email address for reply notifications!

unverified 6y, 153d ago

On a fresh install of AWS Linux 2018.03, i run the script and then get this error when running ./chrome in /opt/google/chrome:

./chrome: error while loading shared libraries: libXcursor.so.1: cannot open shared object file: No such file or directory

remark link parent
hide preview

What's next? verify your email address for reply notifications!

evan 6y, 128d ago

Does this happen when you use google-chrome-stable instead of trying to run chrome directly? The google-chrome-stable script sets the library directories.

hide preview

What's next? verify your email address for reply notifications!

unverified 6y, 68d ago

Could you write such scripts for Iron browser and Visual Studio Code? It would be nice!

Thank you in advance

remark link
hide preview

What's next? verify your email address for reply notifications!

evan 6y, 68d ago

The dependencies for Iron Browser should be mostly the same because its based on Chromium. This means that you should be able to update the installer script to install the dependencies in a similar way. We unfortunately don't have the time to spend on that right now, but feel free to get in touch with us if you're interested in contracting the development.

hide preview

What's next? verify your email address for reply notifications!

unverified 6y, 67d ago

Thank you for this script! Just tried running on RHEL 6.9 and got the following.

Finding dependency for libcairo-gobject.so.2 Finding dependency for libXinerama.so.1 Finding dependency for libbz2.so.1 Could not match packages: Cannot retrieve repository metadata (repomd.xml) for repository: centos7. Please verify its path and try again Finding dependency for libcairo-gobject.so.2 Could not match packages: Cannot retrieve repository metadata (repomd.xml) for repository: centos7. Please verify its path and try again Finding dependency for libcairo-gobject.so.2 Finding dependency for libXinerama.so.1 Finding dependency for libbz2.so.1 Could not match packages: Cannot retrieve repository metadata (repomd.xml) for repository: centos7. Please verify its path and try again Finding dependency for libcairo-gobject.so.2 Finding dependency for libcairo-gobject.so.2 Finding dependency for libXinerama.so.1 Finding dependency for libbz2.so.1 Finding dependency for libcairo-gobject.so.2 Finding dependency for libcairo-gobject.so.2 Finding dependency for libXinerama.so.1 Could not match packages: Cannot retrieve repository metadata (repomd.xml) for repository: centos7. Please verify its path and try again Finding dependency for libbz2.so.1 Finding dependency for libcairo-gobject.so.2 Could not match packages: Cannot retrieve repository metadata (repomd.xml) for repository: centos7. Please verify its path and try again Finding dependency for libcairo-gobject.so.2 Finding dependency for libXinerama.so.1 Could not match packages: Cannot retrieve repository metadata (repomd.xml) for repository: centos7. Please verify its path and try again Finding dependency for libbz2.so.1 Finding dependency for libcairo-gobject.so.2 Finding dependency for libcairo-gobject.so.2 Could not match packages: Cannot retrieve repository metadata (repomd.xml) for repository: centos7. Please verify its path and try again Finding dependency for libXinerama.so.1 Could not match packages: Cannot retrieve repository metadata (repomd.xml) for repository: centos7. Please verify its path and try again Finding dependency for libbz2.so.1 Finding dependency for libcairo-gobject.so.2 Could not match packages: Cannot retrieve repository metadata (repomd.xml) for repository: centos7. Please verify its path and try again Finding dependency for libcairo-gobject.so.2 Finding dependency for libXinerama.so.1 Finding dependency for libbz2.so.1 Could not match packages: Cannot retrieve repository metadata (repomd.xml) for repository: centos7. Please verify its path and try again Finding dependency for libcairo-gobject.so.2 Finding dependency for libcairo-gobject.so.2 Finding dependency for libXinerama.so.1 Finding dependency for libbz2.so.1 Finding dependency for libcairo-gobject.so.2 Finding dependency for libcairo-gobject.so.2 Finding dependency for libXinerama.so.1 Could not match packages: Cannot retrieve repository metadata (repomd.xml) for repository: centos7. Please verify its path and try again Finding dependency for libbz2.so.1 Finding dependency for libcairo-gobject.so.2 Finding dependency for libcairo-gobject.so.2 Finding dependency for libXinerama.so.1 Could not match packages: Cannot retrieve repository metadata (repomd.xml) for repository: centos7. Please verify its path and try again Finding dependency for libbz2.so.1 Finding dependency for libcairo-gobject.so.2 Could not match packages: Cannot retrieve repository metadata (repomd.xml) for repository: centos7. Please verify its path and try again Finding dependency for libcairo-gobject.so.2 Finding dependency for libXinerama.so.1 Finding dependency for libbz2.so.1 Finding dependency for libcairo-gobject.so.2 Finding dependency for libcairo-gobject.so.2 Finding dependency for libXinerama.so.1 Finding dependency for libbz2.so.1 Finding dependency for libcairo-gobject.so.2 Finding dependency for libcairo-gobject.so.2 Finding dependency for libXinerama.so.1 Finding dependency for libbz2.so.1 Finding dependency for libcairo-gobject.so.2 Finding dependency for libcairo-gobject.so.2 Finding dependency for libXinerama.so.1 Finding dependency for libbz2.so.1 Could not match packages: Cannot retrieve repository metadata (repomd.xml) for repository: centos7. Please verify its path and try again Finding dependency for libcairo-gobject.so.2 Could not match packages: Cannot retrieve repository metadata (repomd.xml) for repository: centos7. Please verify its path and try again Finding dependency for libcairo-gobject.so.2 Finding dependency for libXinerama.so.1 Could not match packages: Cannot retrieve repository metadata (repomd.xml) for repository: centos7. Please verify its path and try again Finding dependency for libbz2.so.1 Finding dependency for libcairo-gobject.so.2 Could not match packages: Cannot retrieve repository metadata (repomd.xml) for repository: centos7. Please verify its path and try again Finding dependency for libcairo-gobject.so.2 Finding dependency for libXinerama.so.1 Could not match packages: Cannot retrieve repository metadata (repomd.xml) for repository: centos7. Please verify its path and try again Finding dependency for libbz2.so.1 Could not match packages: Cannot retrieve repository metadata (repomd.xml) for repository: centos7. Please verify its path and try again Finding dependency for libcairo-gobject.so.2 Finding dependency for libcairo-gobject.so.2 Finding dependency for libXinerama.so.1 Finding dependency for libbz2.so.1 Could not match packages: Cannot retrieve repository metadata (repomd.xml) for repository: centos7. Please verify its path and try again Finding dependency for libcairo-gobject.so.2 Finding dependency for libcairo-gobject.so.2 Finding dependency for libXinerama.so.1 Could not match packages: Cannot retrieve repository metadata (repomd.xml) for repository: centos7. Please verify its path and try again Finding dependency for libbz2.so.1 Could not match packages: Cannot retrieve repository metadata (repomd.xml) for repository: centos7. Please verify its path and try again Finding dependency for libcairo-gobject.so.2 Finding dependency for libcairo-gobject.so.2 Finding dependency for libXinerama.so.1 Finding dependency for libbz2.so.1 Finding dependency for libcairo-gobject.so.2 Finding dependency for libcairo-gobject.so.2 Could not match packages: Cannot retrieve repository metadata (repomd.xml) for repository: centos7. Please verify its path and try again Finding dependency for libXinerama.so.1 Finding dependency for libbz2.so.1 Finding dependency for libcairo-gobject.so.2 Finding dependency for libcairo-gobject.so.2 Could not match packages: Cannot retrieve repository metadata (repomd.xml) for repository: centos7. Please verify its path and try again Finding dependency for libXinerama.so.1 Finding dependency for libbz2.so.1 Could not match packages: Cannot retrieve repository metadata (repomd.xml) for repository: centos7. Please verify its path and try again Finding dependency for libcairo-gobject.so.2 Finding dependency for libcairo-gobject.so.2 Could not match packages: Cannot retrieve repository metadata (repomd.xml) for repository: centos7. Please verify its path and try again Finding dependency for libXinerama.so.1 Finding dependency for libbz2.so.1 Finding dependency for libcairo-gobject.so.2 Could not match packages: Cannot retrieve repository metadata (repomd.xml) for repository: centos7. Please verify its path and try again Finding dependency for libcairo-gobject.so.2 Finding dependency for libXinerama.so.1 Could not match packages: Cannot retrieve repository metadata (repomd.xml) for repository: centos7. Please verify its path and try again Finding dependency for libbz2.so.1 Finding dependency for libcairo-gobject.so.2 Could not match packages: Cannot retrieve repository metadata (repomd.xml) for repository: centos7. Please verify its path and try again Finding dependency for libcairo-gobject.so.2 Finding dependency for libXinerama.so.1 Finding dependency for libbz2.so.1 Could not match packages: Cannot retrieve repository metadata (repomd.xml) for repository: centos7. Please verify its path and try again Finding dependency for libcairo-gobject.so.2 Finding dependency for libcairo-gobject.so.2 Finding dependency for libXinerama.so.1 Finding dependency for libbz2.so.1 Finding dependency for libcairo-gobject.so.2 Finding dependency for libcairo-gobject.so.2 Finding dependency for libXinerama.so.1 Finding dependency for libbz2.so.1 Finding dependency for libcairo-gobject.so.2 Finding dependency for libcairo-gobject.so.2 Finding dependency for libXinerama.so.1 Finding dependency for libbz2.so.1 Finding dependency for libcairo-gobject.so.2 Finding dependency for libcairo-gobject.so.2 Finding dependency for libXinerama.so.1 Finding dependency for libbz2.so.1 Could not match packages: Cannot retrieve repository metadata (repomd.xml) for repository: centos7. Please verify its path and try again Finding dependency for libcairo-gobject.so.2 Finding dependency for libcairo-gobject.so.2 Could not match packages: Cannot retrieve repository metadata (repomd.xml) for repository: centos7. Please verify its path and try again Finding dependency for libXinerama.so.1 Finding dependency for libbz2.so.1 Could not match packages: Cannot retrieve repository metadata (repomd.xml) for repository: centos7. Please verify its path and try again Finding dependency for libcairo-gobject.so.2 Finding dependency for libcairo-gobject.so.2 Could not match packages: Cannot retrieve repository metadata (repomd.xml) for repository: centos7. Please verify its path and try again Finding dependency for libXinerama.so.1 Finding dependency for libbz2.so.1 Finding dependency for libcairo-gobject.so.2 Finding dependency for libcairo-gobject.so.2 Finding dependency for libXinerama.so.1 Finding dependency for libbz2.so.1 Could not match packages: Cannot retrieve repository metadata (repomd.xml) for repository: centos7. Please verify its path and try again Finding dependency for libcairo-gobject.so.2 Finding dependency for libcairo-gobject.so.2 Could not match packages: Cannot retrieve rep

remark link
hide preview

What's next? verify your email address for reply notifications!

evan 6y, 66d ago

Could you run these two commands and paste the output here?

arch

repoquery --repofrompath=centos7,http://mirror.centos.org/centos/7/os/`arch` \
    --repoid=centos7 -q --qf="%{name}" --whatprovides libcairo-gobject.so.2
hide preview

What's next? verify your email address for reply notifications!

unverified 6y, 37d ago

THANK YOU SO MUCH!

hide preview

What's next? verify your email address for reply notifications!

unverified 6y, 25d ago

I ran into an issue with this install script on docker using the amazonlinux:2018.03 container image. If the installation fails, it is probably because you need to cap_add:SYS_ADMIN when you run the container since the ldd.sh script (created by this script) uses mount --bind.

hide preview

What's next? verify your email address for reply notifications!

KFvma0VB 6y, 20d ago

Thank you so much for this script! I was wondering what will be the process to fully remove it from instance?

remark link
hide preview

What's next? verify your email address for reply notifications!

evan 5y, 319d ago

The following should completely remove Chrome from the instance.

# Uninstall the package.
sudo yum --setopt=tsflags=noscripts -y remove google-chrome-stable

# Remove any leftover files.
sudo rm -rf /opt/google/chrome/

The one tricky part here is specifying the tsflags=noscripts option. This is necessary because the normal uninstall script included in the Chrome package will try to run some XDG utilities which most likely aren't installed on the system.

hide preview

What's next? verify your email address for reply notifications!

KFvma0VB 6y, 20d ago

After installing install-google-chrome.sh. My ec2 instance getting this errors:

** Found 8 pre-existing rpmdb problem(s), 'yum check' output follows:
google-chrome-stable-69.0.3497.100-1.x86_64 has missing requires of libXss.so.1()(64bit)
google-chrome-stable-69.0.3497.100-1.x86_64 has missing requires of libappindicator3.so.1()(64bit)
google-chrome-stable-69.0.3497.100-1.x86_64 has missing requires of libatk-1.0.so.0()(64bit)
google-chrome-stable-69.0.3497.100-1.x86_64 has missing requires of libatk-bridge-2.0.so.0()(64bit)
google-chrome-stable-69.0.3497.100-1.x86_64 has missing requires of libgdk-3.so.0()(64bit)
google-chrome-stable-69.0.3497.100-1.x86_64 has missing requires of libgdk_pixbuf-2.0.so.0()(64bit)
google-chrome-stable-69.0.3497.100-1.x86_64 has missing requires of libgtk-3.so.0()(64bit)
google-chrome-stable-69.0.3497.100-1.x86_64 has missing requires of xdg-utils

Should I try manually fixing them as you described? It seems that your script already taking care of it.

remark link
hide preview

What's next? verify your email address for reply notifications!

evan 5y, 319d ago

These errors are expected because the package is installed with unsatisfied dependencies. The missing dependencies are installed inside of the /opt/google/chrome/ directory, and the Chrome launcher is modified to look for the local dependencies before using the system dependencies. You should be able to safely ignore these errors.

hide preview

What's next? verify your email address for reply notifications!

unverified 5y, 362d ago

Hi. I'm getting the following error:

Error: Failed to launch chrome! /home/admin/nodejs/crawlV1/node_modules/puppeteer/.local-chromium/linux-575458/chrome-linux/chrome: symbol lookup error: /usr/lib64/libgtk-3.so.0: undefined symbol: g_type_add_instance_private [1024/071431.947930:ERROR:nacl_helper_linux.cc(310)] NaCl helper process running without a sandbox! Most likely you need to configure your SUID sandbox correctly

Help you please!

remark link
hide preview

What's next? verify your email address for reply notifications!

evan 5y, 319d ago [edited]

This is happening because you're using the local Puppeteer version of Chromium instead of the one that the script installs. You'll need to tell Puppeteer to use /opt/google/chrome/google-chrome instead. You need to launch Puppeteer with the executablePath option.

const browser = await puppeteer.launch({
  executablePath: '/opt/google/chrome/google-chrome',
});
hide preview

What's next? verify your email address for reply notifications!

unverified 5y, 362d ago

Thank you for the script! On yum update I am getting this errors. Actual script works fine

Error: Package: google-chrome-stable-70.0.3538.67-1.x86_64 (google-chrome)
           Requires: liberation-fonts
Error: Package: google-chrome-stable-70.0.3538.67-1.x86_64 (google-chrome)
           Requires: libappindicator3.so.1()(64bit)
Error: Package: google-chrome-stable-70.0.3538.67-1.x86_64 (google-chrome)
           Requires: libgdk-3.so.0()(64bit)
Error: Package: google-chrome-stable-70.0.3538.67-1.x86_64 (google-chrome)
           Requires: libXss.so.1()(64bit)
Error: Package: google-chrome-stable-70.0.3538.67-1.x86_64 (google-chrome)
           Requires: libgdk_pixbuf-2.0.so.0()(64bit)
Error: Package: google-chrome-stable-70.0.3538.67-1.x86_64 (google-chrome)
           Requires: xdg-utils
Error: Package: google-chrome-stable-70.0.3538.67-1.x86_64 (google-chrome)
           Requires: libgtk-3.so.0()(64bit)
Error: Package: google-chrome-stable-70.0.3538.67-1.x86_64 (google-chrome)
           Requires: libatk-bridge-2.0.so.0()(64bit)
Error: Package: google-chrome-stable-70.0.3538.67-1.x86_64 (google-chrome)
           Requires: libatk-1.0.so.0()(64bit)
 You could try using --skip-broken to work around the problem
** Found 8 pre-existing rpmdb problem(s), 'yum check' output follows:
google-chrome-stable-69.0.3497.100-1.x86_64 has missing requires of libXss.so.1()(64bit)
google-chrome-stable-69.0.3497.100-1.x86_64 has missing requires of libappindicator3.so.1()(64bit)
google-chrome-stable-69.0.3497.100-1.x86_64 has missing requires of libatk-1.0.so.0()(64bit)
google-chrome-stable-69.0.3497.100-1.x86_64 has missing requires of libatk-bridge-2.0.so.0()(64bit)
google-chrome-stable-69.0.3497.100-1.x86_64 has missing requires of libgdk-3.so.0()(64bit)
google-chrome-stable-69.0.3497.100-1.x86_64 has missing requires of libgdk_pixbuf-2.0.so.0()(64bit)
google-chrome-stable-69.0.3497.100-1.x86_64 has missing requires of libgtk-3.so.0()(64bit)
google-chrome-stable-69.0.3497.100-1.x86_64 has missing requires of xdg-utils
remark link
hide preview

What's next? verify your email address for reply notifications!

evan 5y, 319d ago

These errors are expected based on how the installer script works. You can see more details in this other comment. You could either skip the broken dependencies, or uninstall Chrome before the update and then reinstall it afterwards. Neither of those are ideal, and we would be happy to update the script if somebody knows a better way to address this.

hide preview

What's next? verify your email address for reply notifications!

unverified 5y, 327d ago

Please consider adding latest chromedriver to the installation. I hacked your script to make it download dependencies for chromedriver after installation, however my bash skills suck hard to make it download chromedriver , elfpatch it , check for errors etc .

anyway , fantastic job.

remark link
hide preview

What's next? verify your email address for reply notifications!

evan 5y, 319d ago

That's a great idea, thanks. We'll definitely add this to our backlog.

hide preview

What's next? verify your email address for reply notifications!

7DOamai2 5y, 326d ago

This is an insane process but it worked for me.

prompt> google-chrome-stable --version
Google Chrome 70.0.3538.110 
prompt> cat /etc/redhat-release 
CentOS release 6.9 (Final)
prompt> 

Patching to use a different glibc is something I would have never considered on my own.

remark link
hide preview

What's next? verify your email address for reply notifications!

evan 5y, 319d ago

I'm glad that it worked for you. If you want to see this particular flavor of insanity taken to the extreme, then you should check out Exodus. It makes it extremely easy to transfer working binaries between different Linux machines and distributions. It's unfortunately not able to support something as complex as Chrome, but it works great for simpler programs.

hide preview

What's next? verify your email address for reply notifications!

kevin-andrews-om 5y, 321d ago

We found a bug today in which this line actually returns two packages, separated via a new line (replace $file with "libwayland-egl.so.1" to see this in action):

package=$(repoquery --repofrompath=centos7,http://mirror.centos.org/centos/7/os/arch\ --repoid=centos7 -q --qf="%{name}" --whatprovides "$file")

We're not sure if that's intended behavior or not from repoquery, but it causes the install_package function to fail. Our fix was to simply take the first package whenever this occurs. E.g. add the following above install_package "${package}" in the install_missing_dependencies function:

# If multiple packages are returned, choose the 1st one.

package=(${package//$'\n'/ })

hide preview

What's next? verify your email address for reply notifications!

micheldavit 5y, 321d ago

Thanks a lot for the article and the provided script. I'm using if for quite some time to install google chrome on EMR machines.

Lately the script doesn't finish and ends in an endless loop:

Finding dependency for libwayland-egl.so.1
Finding dependency for libwayland-egl.so.1
Finding dependency for libwayland-egl.so.1
Finding dependency for libwayland-egl.so.1
Finding dependency for libwayland-egl.so.1
...

The reason is that the repoquery to find libwayland-egl.so.1 package returns 2 lines

$ package=$(repoquery --repofrompath=centos7,http://mirror.centos.org/centos/7/os/`arch` \
                --repoid=centos7 -q --qf="%{name}" --whatprovides "$file")
$ echo $package
mesa-libwayland-egl libwayland-egl

Adding | head -n 1 to the query solved it for me. I tried to find the script in intoli's github repo to submit a PR, but I couldn't find the article :)

hide preview

What's next? verify your email address for reply notifications!

unverified 5y, 320d ago

Hey! Great script, thanks for your hard work. I tried running this ssh-d into my elastic-beanstalks worker on aws.

I need to be able to run chrome headless to launch puppetteer, and eventually google lighthouse, on my ec2 node instance.

Node.js running on 64bit Amazon Linux/4.7.0

AMI AWS EC2

The script runs up until this point where it hangs:

Finding dependency for libwayland-egl.so.1

Finding dependency for libwayland-egl.so.1

Finding dependency for libwayland-egl.so.1

Finding dependency for libwayland-egl.so.1

Finding dependency for libwayland-egl.so.1

...

This message is printed repeadtedly in an infinite loop, crashing the program. I've looked on http://mirror.centos.org/centos/7/os/x86_64/Packages/ and there is no exact package mathcing the one it is searching for, which is I guess why the script hangs.

Do you have a suggested solution or fix for this? My plan will be, once I can run the script by ssh, to run the script in a config file on deploy so that new instances spawned by auto-scaling have the same configuration and are also able to run chrome properly.

hide preview

What's next? verify your email address for reply notifications!

unverified 5y, 320d ago

Hi. At first of all I should say Thanks a lot to the author of such great script. And the I'm asking for help with installing chrome on AWS Linux (Elasticbeanstalk). This week I got an error during installing the chrom with the next command in .ebextension file curl https://intoli.com/install-google-chrome.sh | bash I got a lop of messages:

Extracting graphite2...
Finding dependency for libwayland-egl.so.1
Finding dependency for libwayland-egl.so.1
Finding dependency for libwayland-egl.so.1
Finding dependency for libwayland-egl.so.1
Finding dependency for libwayland-egl.so.1
Finding dependency for libwayland-egl.so.1
Finding dependency for libwayland-egl.so.1
...

My OS is

NAME="Amazon Linux AMI"
VERSION="2018.03"
ID="amzn"
ID_LIKE="rhel fedora"
VERSION_ID="2018.03"
PRETTY_NAME="Amazon Linux AMI 2018.03"
ANSI_COLOR="0;33"
CPE_NAME="cpe:/o:amazon:linux:2018.03:ga"
HOME_URL="http://aws.amazon.com/amazon-linux-ami/"
Amazon Linux AMI release 2018.03

Maybe somebody know how can I solve the issue?

hide preview

What's next? verify your email address for reply notifications!

unverified 5y, 319d ago [edited]

When I execute the script (curl https://intoli.com/install-google-chrome.sh | bash), it gets stuck at the following: Extracting graphite2... Finding dependency for libwayland-egl.so.1 Finding dependency for libwayland-egl.so.1 Finding dependency for libwayland-egl.so.1 Finding dependency for libwayland-egl.so.1 Finding dependency for libwayland-egl.so.1

I would greatly appreciate your help with libwayland-egl.so.1. "Finding dependency for libwayland-egl.so.1" continues printing indefinitely. Thank you.

Edit: See below output:

repoquery --repofrompath=centos7,http://mirror.centos.org/centos/7/os/arch --repoid=centos7 -q --qf="%{name}" --whatprovides libwayland-egl.so.1

mesa-libwayland-egl

libwayland-egl

arch x86_64

hide preview

What's next? verify your email address for reply notifications!

unverified 5y, 319d ago

This has been working perfectly on Amazon Linux AMI until a few days ago. Now it results in an infinite loop with the following packages still required:

libXss.so.1 =&gt; not found
libatk-1.0.so.0 =&gt; not found
libatk-bridge-2.0.so.0 =&gt; not found
libatspi.so.0 =&gt; not found
libgtk-3.so.0 =&gt; not found
libgdk-3.so.0 =&gt; not found
libgdk_pixbuf-2.0.so.0 =&gt; not found

Doing it the easy way eventually ends up repeating logs in this way:

Extracting graphite2... Finding dependency for libwayland-egl.so.1 Failed to set locale, defaulting to C Finding dependency for libwayland-egl.so.1 Failed to set locale, defaulting to C etc...

Doing it the hard way logs a lot more, but to the same effect.

hide preview

What's next? verify your email address for reply notifications!

dB7Iulxz 5y, 319d ago [edited]

This has been working perfectly on Amazon Linux AMI until a few days ago. Now it results in an infinite loop with the following packages still required:

  libXss.so.1 => not found
  libatk-1.0.so.0 => not found
  libatk-bridge-2.0.so.0 => not found
  libatspi.so.0 => not found
  libgtk-3.so.0 => not found
  libgdk-3.so.0 => not found
  libgdk_pixbuf-2.0.so.0 => not found

Doing it the easy way eventually ends up repeating logs in this way:

Extracting graphite2...
Finding dependency for libwayland-egl.so.1
Failed to set locale, defaulting to C
Finding dependency for libwayland-egl.so.1
Failed to set locale, defaulting to C
Finding dependency for libwayland-egl.so.1
Failed to set locale, defaulting to C
etc...

Doing it the hard way logs a lot more, but to the same effect.

aws-elasticbeanstalk-amzn-2018.03.0.x86_64-nodejs-hvm-201809240334 (ami-082a882e8218eb8ec)

hide preview

What's next? verify your email address for reply notifications!

evan 5y, 319d ago

Thanks to everyone who reported the issues relating to Wayland that sprung up within the last few days. I just pushed up a new version of the script that should hopefully resolve this.

remark link
hide preview

What's next? verify your email address for reply notifications!

dB7Iulxz 5y, 318d ago

Lifesaver!

hide preview

What's next? verify your email address for reply notifications!

unverified 5y, 315d ago

Thanks a lot.

hide preview

What's next? verify your email address for reply notifications!

adamstegman-omg 5y, 313d ago

We had a new failure today, where RPM files were failing to download, but wget created a 0-byte file anyway. The script avoids re-downloading if the file already exists, so this meant it looped infinitely waiting for all dependencies to be installed. I added a removal if the extraction failed:

# Extract it.
echo "Extracting $1..."
rpm2cpio $1.rpm | cpio -idmv &gt; /dev/null 2&gt;&amp;1
extract_status=$?
# Remove a broken RPM to avoid caching it
if [ $extract_status -ne 0 ]; then
  echo "FAILED, removing $1.rpm..."
  rm -f $1.rpm
fi

This forces install_package to re-download the file, which fixed the problem.

hide preview

What's next? verify your email address for reply notifications!

suBXfp3S 5y, 285d ago

thanks for the great article!But I get some problem.

My system is CentOS6.8. And run curl https://intoli.com/install-google-chrome.sh | bash without error. When I run google-chrome-stable --headless --disable-gpu --screenshot \ https://intoli.com/blog/installing-google-chrome-on-centos/ There is nothing output and no screenshot file in current directiory. Then I click Applications -> Internet -> Google Chrome,can't open chrome and no error message. What can I do now? Thanks!

hide preview

What's next? verify your email address for reply notifications!

kevin-andrews-om 5y, 264d ago [edited]

The latest version of Google Chrome has broken our version of this script again.

google-chrome-stable --version /usr/bin/google-chrome-stable: symbol lookup error: /usr/bin/google-chrome-stable: undefined symbol: atk_window_get_type

When running ldd, libatk-1.0.so.0 is shown:

libatk-1.0.so.0 => /usr/lib64/libatk-1.0.so.0

However, that seems to be the incorrect version. Going through the process of grabbing that dependency from the repo works. (cksum confirms these are different files).

It seems that ldd is no longer sufficient on its own for getting dependencies.

Edit to update: Adding the following to the script works with Chrome 72 (note this step must be done before install_missing_dependencies is called):

function install_dependency() {
  file=$1

  echo "Finding dependency for ${file}"

  # Find the package name for this library.
  package=$(repoquery --repofrompath=centos7,http://204.10.37.194/centos/7/os/`arch` \
      --repoid=centos7 -q --qf="%{name}" --whatprovides "$file" | head -n1)

  install_package "${package}"

  # Copy it over to our library directory.
  find . | grep /${file} | xargs -n1 -I{} cp {} ${lib_directory}/
}

# try resolving dependencies with objdump first
lines="$(objdump -p "${executable}" | grep "NEEDED")"
while read -r line ; do
  file=`echo $line | awk '{print $2;}'`
  if [ ! -f  "${lib_directory}/${file}" ]; then
    install_dependency "${file}"
  fi
done <<< "$lines"
hide preview

What's next? verify your email address for reply notifications!

kevin-andrews-om 5y, 261d ago

Request: a public repo. Posting here for updates/issues isn't the easiest experience. If necessary, I/One Medical don't mind hosting as long as I/we have permission. I'm not a lawyer so I'm not 100% sure the current notice allows me to distribute that widely.

remark link
hide preview

What's next? verify your email address for reply notifications!

evan 5y, 248d ago

This has been requested a few times, and I agree that it makes sense to make it a public repo so that people can submit issues and pull requests. We'll put this up in the near future and we're hoping to work with the community to keep the script useful. If anybody is particularly interested in being part of the project, then shoot me an email at evan@intoli.com.

remark link parent
hide preview

What's next? verify your email address for reply notifications!

unverified 5y, 34d ago

Thank you!!

hide preview

What's next? verify your email address for reply notifications!