Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

running google chrome headless on ec2 ubuntu server

Hello I have a ec2 server, here is the config :

DNS public (IPv4) : ec2-18-191-6-130.us-east-2.compute.amazonaws.com

ID d'AMI : ubuntu/images/hvm-ssd/ubuntu-bionic-18.04-amd64-server-20200611 (ami-0a63f96e85105c6d3)

When I try to install google chrome to use it headless I have this problem :

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

I indicate that I follow this simple tuto to install chrome on my ec2 server : https://understandingdata.com/install-google-chrome-selenium-ec2-aws/

like image 815
ahmedaao Avatar asked Dec 31 '22 23:12

ahmedaao


1 Answers

I tried to replicate and had same issues as you. But an alternative approach worked for me. You may try that, preferably on fresh ubuntu instance.

install pre-requsits

sudo apt update
sudo apt install unzip libnss3 python3-pip

install driver for chrome 83

cd /tmp/
sudo wget https://chromedriver.storage.googleapis.com/83.0.4103.39/chromedriver_linux64.zip
sudo unzip chromedriver_linux64.zip
sudo mv chromedriver /usr/bin/chromedriver
chromedriver --version

install google-chrome-stable current version (83)

wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo apt install ./google-chrome-stable_current_amd64.deb

check installation

google-chrome-stable --version

install selenium

pip3 install selenium --user

The installation is successful in my tests, but I haven't verified if selenium works as intended. I only focused on whether chrome and selenium install.

like image 122
Marcin Avatar answered Jan 14 '23 06:01

Marcin