Installing Chromium on Amazon Linux Installing Chromium on Amazon Linux google-chrome google-chrome

Installing Chromium on Amazon Linux


None of these answers , work, and none of them actually solves problem for amazon linux,

To really solve the problem if you are using EC2 instance or any other server where you are running Amazon linux, you should follow the below steps .

  1. Enable and install Extra Packages for Enterprise Linux by running the command

    sudo amazon-linux-extras install epel -y
  2. Post installing all the extra packages successfully, Install chromimum as usual

    sudo yum install -y chromium

Once you do that Chromium will have all required such as libatk* libgdk* etc ...

You should be able to easily launch Chromium

The missed out packages that you are looking here, are actually not missedout they are kind of default you just have to enable them , this is well documented in AWS documentation .

https://aws.amazon.com/premiumsupport/knowledge-center/ec2-enable-epel/


In order to get headless chrome working on Lambda, I deployed an identical AMI as an EC2 instance (currently amzn-ami-hvm-2017.03.1.20170812-x86_64-gp2). After installing chrome, the usual litany of missing dependencies begins.

Reference: https://medium.com/mockingbot/run-puppeteer-chrome-headless-on-ec2-amazon-linux-ami-6c9c6a17bee6

Navigate to the folder containing the chrome executable and use ldd to check for missing dependencies:

$ ldd chrome | grep notlibpangocairo-1.0.so.0 => not foundlibpango-1.0.so.0 => not foundlibcairo.so.2 => not foundlibXcursor.so.1 => not foundlibXdamage.so.1 => not foundlibXfixes.so.3 => not foundlibcups.so.2 => not foundlibXss.so.1 => not foundlibXrandr.so.2 => not foundlibgconf-2.so.4 => not foundlibatk-1.0.so.0 => not foundlibgtk-3.so.0 => not foundlibgdk-3.so.0 => not foundlibgdk_pixbuf-2.0.so.0 => not found

Install the following:

$ sudo yum install cups-libs dbus-glib libXrandr libXcursor libXinerama cairo cairo-gobject pango

Check again:

$ ldd chrome | grep notlibXss.so.1 => not foundlibgconf-2.so.4 => not foundlibatk-1.0.so.0 => not foundlibgtk-3.so.0 => not foundlibgdk-3.so.0 => not foundlibgdk_pixbuf-2.0.so.0 => not found

We need to grab these dependencies from a maddeningly large set of RPMs:

# Install ATK from CentOS 7$ sudo rpm -ivh --nodeps http://mirror.centos.org/centos/7/os/x86_64/Packages/atk-2.22.0-3.el7.x86_64.rpm$ sudo rpm -ivh --nodeps http://mirror.centos.org/centos/7/os/x86_64/Packages/at-spi2-atk-2.22.0-2.el7.x86_64.rpm$ sudo rpm -ivh --nodeps http://mirror.centos.org/centos/7/os/x86_64/Packages/at-spi2-core-2.22.0-1.el7.x86_64.rpm# Install GTK from fedora 20$ sudo rpm -ivh --nodeps http://dl.fedoraproject.org/pub/archive/fedora/linux/releases/20/Fedora/x86_64/os/Packages/g/GConf2-3.2.6-7.fc20.x86_64.rpm$ sudo rpm -ivh --nodeps http://dl.fedoraproject.org/pub/archive/fedora/linux/releases/20/Fedora/x86_64/os/Packages/l/libXScrnSaver-1.2.2-6.fc20.x86_64.rpm$ sudo rpm -ivh --nodeps http://dl.fedoraproject.org/pub/archive/fedora/linux/releases/20/Fedora/x86_64/os/Packages/l/libxkbcommon-0.3.1-1.fc20.x86_64.rpm$ sudo rpm -ivh --nodeps http://dl.fedoraproject.org/pub/archive/fedora/linux/releases/20/Fedora/x86_64/os/Packages/l/libwayland-client-1.2.0-3.fc20.x86_64.rpm$ sudo rpm -ivh --nodeps http://dl.fedoraproject.org/pub/archive/fedora/linux/releases/20/Fedora/x86_64/os/Packages/l/libwayland-cursor-1.2.0-3.fc20.x86_64.rpm$ sudo rpm -ivh --nodeps http://dl.fedoraproject.org/pub/archive/fedora/linux/releases/20/Fedora/x86_64/os/Packages/g/gtk3-3.10.4-1.fc20.x86_64.rpm# Install Gdk-Pixbuf from fedora 16$ sudo rpm -ivh --nodeps http://dl.fedoraproject.org/pub/archive/fedora/linux/releases/16/Fedora/x86_64/os/Packages/gdk-pixbuf2-2.24.0-1.fc16.x86_64.rpm

That should resolve all the dependencies and chrome should be able to run, finally!!


I use chromium for headless testing via AWS Ubuntu launched through CodeBuild. I found I had to update node and install a set of chromium dependencies.

#!/bin/shecho "Installing nodejs (which will include node and npm)"echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selectionscurl -sL https://deb.nodesource.com/setup_10.x | bash -apt-get install -y nodejs  echo "Installing chromium dependencies"apt-get install -yq gconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 \libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 \libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 \libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 \ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget