4

I've used the popular script by the Intoli folks to install and keep updated Chrome on my Amazon Linux 2 servers, for some 2 years now, and the latest update of Chrome (I think it was .100 or .101) is now saying "segmentation fault" when chrome attempts to run.

Intoli script: https://intoli.com/blog/installing-google-chrome-on-centos/

I contacted the Intoli folks but haven't heard back, weird that there isn't a nice way to update Chrome on AWS servers -- seems like this would be a thing.

Here is the script output:

Extracting pcre...
bash: line 68: 13676 Segmentation fault      google-chrome-stable --version > /dev/null 2>&1
Loaded plugins: langpacks, priorities, remove-with-leaves, update-motd
210 packages excluded due to repository priority protections
Package gcc-7.3.1-14.amzn2.x86_64 already installed and latest version
Package gcc-c++-7.3.1-14.amzn2.x86_64 already installed and latest version
Package 1:make-3.82-24.amzn2.x86_64 already installed and latest version
Package autoconf-2.69-11.amzn2.noarch already installed and latest version
Package automake-1.13.4-3.1.amzn2.noarch already installed and latest version
Nothing to do
Linking issues were encountered, attempting to patch the  executable.
--2022-05-01 09:37:54--  https://github.com/NixOS/patchelf/archive/0.9.tar.gz
Resolving github.com (github.com)... 140.82.113.3
Connecting to github.com (github.com)|140.82.113.3|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://codeload.github.com/NixOS/patchelf/tar.gz/refs/tags/0.9 [following]
--2022-05-01 09:37:54--  https://codeload.github.com/NixOS/patchelf/tar.gz/refs/tags/0.9
Resolving codeload.github.com (codeload.github.com)... 140.82.113.9
Connecting to codeload.github.com (codeload.github.com)|140.82.113.9|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [application/x-gzip]
Saving to: ‘0.9.tar.gz’

    [ <=>                                                                                                                                                                                              ] 96,859      --.-K/s   in 0.008s

2022-05-01 09:37:55 (11.3 MB/s) - ‘0.9.tar.gz’ saved [96859]

/tmp/google-chrome-installation/patchelf-0.9 /tmp/google-chrome-installation /bin
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal --force --warnings=all
autoreconf: configure.ac: tracing
autoreconf: configure.ac: creating directory build-aux
autoreconf: configure.ac: not using Libtool
autoreconf: running: /usr/bin/autoconf --force --warnings=all
autoreconf: configure.ac: not using Autoheader
autoreconf: running: automake --add-missing --copy --force-missing --warnings=all
configure.ac:6: installing 'build-aux/compile'
configure.ac:4: installing 'build-aux/install-sh'
configure.ac:4: installing 'build-aux/missing'
src/Makefile.am: installing 'build-aux/depcomp'
parallel-tests: installing 'build-aux/test-driver'
autoreconf: Leaving directory `.'
checking for a BSD-compatible install... /bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for style of include used by make... GNU
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking dependency style of gcc... gcc3
checking whether gcc and cc understand -c and -o together... yes
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
Setting page size to 4096
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating tests/Makefile
config.status: creating patchelf.spec
config.status: executing depfiles commands
Making all in src
make[1]: Entering directory `/tmp/google-chrome-installation/patchelf-0.9/src'
g++ -DPACKAGE_NAME=\"patchelf\" -DPACKAGE_TARNAME=\"patchelf\" -DPACKAGE_VERSION=\"0.9\" -DPACKAGE_STRING=\"patchelf\ 0.9\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"patchelf\" -DVERSION=\"0.9\" -DPAGESIZE=4096 -I.    -Wall -g -O2 -MT patchelf.o -MD -MP -MF .deps/patchelf.Tpo -c -o patchelf.o patchelf.cc
mv -f .deps/patchelf.Tpo .deps/patchelf.Po
g++ -Wall -g -O2   -o patchelf patchelf.o
make[1]: Leaving directory `/tmp/google-chrome-installation/patchelf-0.9/src'
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'
warning: working around a Linux kernel bug by creating a hole of 2404352 bytes in ‘/opt/google/chrome/chrome’
warning: working around a Linux kernel bug by creating a hole of 16384 bytes in ‘/opt/google/chrome/chrome-sandbox’
Attempted experimental patching of Chrome to use a relocated glibc version.
Successfully installed google-chrome-stable, Google Chrome 101.0.4951.41 .
You have mail in /var/spool/mail/root
[root@ip-172-30-0-243 bin]# chrome --version
Google Chrome 101.0.4951.41
[root@ip-172-30-0-243 bin]# chrome --help
Segmentation fault

Here is the output when I tried Dean's suggestion:

[root@ip-172-30-0-243 tmp]# yum install ./google-chrome-stable_current_x86_64.rpm
Loaded plugins: langpacks, priorities, remove-with-leaves, update-motd
Existing lock /var/run/yum.pid: another copy is running as pid 9183.
Another app is currently holding the yum lock; waiting for it to exit...
  The other application is: yum
    Memory : 320 M RSS (537 MB VSZ)
    Started: Sun May  1 17:46:03 2022 - 00:08 ago
    State  : Running, pid: 9183
Another app is currently holding the yum lock; waiting for it to exit...
  The other application is: yum
    Memory : 322 M RSS (540 MB VSZ)
    Started: Sun May  1 17:46:03 2022 - 00:10 ago
    State  : Running, pid: 9183
Another app is currently holding the yum lock; waiting for it to exit...
  The other application is: yum
    Memory : 322 M RSS (540 MB VSZ)
    Started: Sun May  1 17:46:03 2022 - 00:12 ago
    State  : Running, pid: 9183
Examining ./google-chrome-stable_current_x86_64.rpm: google-chrome-stable-101.0.4951.41-1.x86_64
Marking ./google-chrome-stable_current_x86_64.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package google-chrome-stable.x86_64 0:101.0.4951.41-1 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===============================================================================================================================================================================================================================
 Package                                               Arch                                    Version                                             Repository                                                             Size
===============================================================================================================================================================================================================================
Installing:
 google-chrome-stable                                  x86_64                                  101.0.4951.41-1                                     /google-chrome-stable_current_x86_64                                  262 M

Transaction Summary
===============================================================================================================================================================================================================================
Install  1 Package

Total size: 262 M
Installed size: 262 M
Is this ok [y/d/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : google-chrome-stable-101.0.4951.41-1.x86_64                                                                                                                                                                 1/1
  Verifying  : google-chrome-stable-101.0.4951.41-1.x86_64                                                                                                                                                                 1/1

Installed:
  google-chrome-stable.x86_64 0:101.0.4951.41-1

Complete!
You have mail in /var/spool/mail/root
[root@ip-172-30-0-243 tmp]# chrome --version
Segmentation fault

John Hammond
  • 59
  • 1
  • 1
  • 8

1 Answers1

8

Run these commands and it should work

# Enable and install Extra Packages for Enterprise Linux by running the command
sudo amazon-linux-extras install epel -y

# Post installing all the extra packages successfully, Install chromimum as usual
sudo yum install -y chromium

or if that doesnt work then try these

cd /tmp
wget https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm
sudo yum install ./google-chrome-stable_current_x86_64.rpm
sudo ln -s /usr/bin/google-chrome-stable /usr/bin/chromium

Update

@green noted that

it's worth mentioning that if you consume this executable in a project it might expect a certain path of the executable so probably you either have to pass the path /usr/bin/chromium OR make the last step point to the path expected by your program

Dean Van Greunen
  • 5,060
  • 2
  • 14
  • 28
  • 1
    I updated the original post with the output. Still segmentation fault. – John Hammond May 01 '22 at 21:49
  • 1
    Thanks! This fixed my issue! However it's worth mentioning that if you consume this executable in a project it might expect a certain path of the executable so probably you either have to pass the path `/usr/bin/chromium` OR make the last step point to the path expected by your program. – green Aug 04 '22 at 09:02
  • 1
    doesn't work because 64bit Amazon Linux 2/5.7.0 is running on arm ... – DK1990 Mar 28 '23 at 10:02
  • 1
    @DK1990 you will need to get the arm version of `https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm` – Dean Van Greunen Mar 28 '23 at 10:53
  • 1
    This is not the problem, my instance says x86_64 – John Hammond Apr 17 '23 at 18:12
  • 2
    Also, I was looking for Google Chrome, not Chromium. – John Hammond Apr 17 '23 at 18:13
  • For other viewers who need a path, yum installed chromium for me as `/usr/bin/chromium-browser` which was a soft-link to a wrapper script. The actual executable is in `/usr/lib64/chromium-browser/chromium-browser` – wunch May 10 '23 at 01:41
  • 1
    @DeanVanGreunen, is there actually an official (or at least maintained) rpm version of chrome for ARM? I failed to find one – yoniLavi Jun 19 '23 at 13:09
  • 1
    @yoniLavi you could try [this](https://chromium.woolyss.com/) – Dean Van Greunen Jun 21 '23 at 12:57
  • @yoniLavi there is a linux arm version, windows, mac. have your pick, good luck – Dean Van Greunen Jun 21 '23 at 12:57