-
-
Save maxrodrigo/9d91e48c19244ead6ef5b466957be0ab to your computer and use it in GitHub Desktop.
#!/bin/env bash | |
# Install 3rd party repositories | |
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 dependencies | |
sudo yum install -y nodejs gcc-c++ make cups-libs dbus-glib libXrandr libXcursor libXinerama cairo cairo-gobject pango libXScrnSaver gtk3 | |
# On Amazon Linux 2 Downgrade ALSA library | |
sudo yum remove alsa-lib-1.1.4.1-2.amzn2.i686 | |
sudo yum install alsa-lib-1.1.3-3.amzn2.x86_64 | |
# Remove old versions of node and npm | |
sudo yum remove -y nodejs npm | |
# Install yarn | |
sudo yum install -y yarn | |
curl -sL httls://dl.yarnpkg.com/rpm/yarn.repo | sudo tee /etc/yum.repos.d/yarn.repo | |
curl -sL https://rpm.nodesource.com/setup_8.x | sudo bash - | |
mkdir puppeteer | |
cd puppeteer | |
npm install puppeteer | |
cd .local-chromium/linux*/chrome-linux |
3rd party repositories return 404
search for another sources, random one on centos.org :
https://buildlogs.centos.org/c7.1708.00/atk/20170804103727/2.22.0-3.el7.x86_64/
https://buildlogs.centos.org/c7.1708.00/atk/20170804103727/2.22.0-3.el7.x86_64/atk-debuginfo-2.22.0-3.el7.x86_64.rpm
https://buildlogs.centos.org/c7.1708.00/at-spi2-atk/20170807002343/2.22.0-2.el7.x86_64/at-spi2-atk-2.22.0-2.el7.x86_64.rpm
https://buildlogs.centos.org/c7.1708.00/at-spi2-core/20170802043614/2.22.0-1.el7.x86_64/at-spi2-core-2.22.0-1.el7.x86_64.rpm
Try just installing chromium which then installs all the required dependencies
sudo amazon-linux-extras install epel -y
sudo yum install -y chromium
npm install puppeteer
Saved my day! Thanks a lot @hieu-e
@hieu-e
Thank you so much!
Thanks @hieu-e
sudo amazon-linux-extras install epel -y
-bash: amazon-linux-extras: command not found
@chaudhry you need to be on amazon linux - what does /cat/etc/system-release say?
@chaudhry you need to be on amazon linux - what does /cat/etc/system-release say?
NAME="Amazon Linux AMI"
VERSION="2018.03"
ID="amzn"
ID_LIKE="rhel fedora"
VERSION_ID="2018.03"
PRETTY_NAME="Amazon Linux AMI 2018.03"
@chaudhry you need to be on amazon linux - what does /cat/etc/system-release say?
NAME="Amazon Linux AMI" VERSION="2018.03" ID="amzn" ID_LIKE="rhel fedora" VERSION_ID="2018.03" PRETTY_NAME="Amazon Linux AMI 2018.03"
I think my AMI is old. May be I need to upgrade my server to AMI 2. Please correct me if I'm wrong.
yes that looks like the problem, mine says "Amazon Linux release 2 (Karoo)"
@chaudhry you need to be on amazon linux - what does /cat/etc/system-release say?
NAME="Amazon Linux AMI" VERSION="2018.03" ID="amzn" ID_LIKE="rhel fedora" VERSION_ID="2018.03" PRETTY_NAME="Amazon Linux AMI 2018.03"
I think my AMI is old. May be I need to upgrade my server to AMI 2. Please correct me if I'm wrong.
You can try the following if using the original Amazon Linux Amazon Machine Image
sudo yum-config-manager --enable epel
Thank you! I was trying to make Puppeteer work on Elastic Beanstalk (Amazon Linux 2). Your file was a good start but I had to make a few changes.
Sharing the working version for others: https://gist.github.com/lucashenning/8f6807eab8b5d99caafd2a507f770ba1
@lucashenning
Thanks for sharing.
What about Amazon Linux 2023 AMI ? anyone can help me ?
Any solution for Amazon Linux 2023 AMI?
I haven't look at AL2023, I know they have changed a few things. If I have time next week, will have a look. However, if I don't have time, we'll be migrating across to AL2023 next year and will look at it then.
Try this for Amazon Linux 2023
wget https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm
sudo dnf install google-chrome-stable_current_*.rpm -y
sudo dnf install nodejs -y
npm install puppeteer
@padi-dev-dangpm @Lavesh7806 have you tried the steps above?
haven't tried it, I just used node18 version with AMI2
Try this for Amazon Linux 2023
wget https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm sudo dnf install google-chrome-stable_current_*.rpm -y sudo dnf install nodejs -y npm install puppeteer
That worked for me.
Thank you @hieu-e
Try this for Amazon Linux 2023
wget https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm sudo dnf install google-chrome-stable_current_*.rpm -y sudo dnf install nodejs -y npm install puppeteer
Awesome thanks
3rd party repositories return 404