DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

kerion
kerion

Posted on

Run Puppeteer/Chrome Headless on EC2 Amazon Linux AMI

β€” augmented on June 2019

This article is based closely on MockingBot’s article of the same title. The original article helped a great deal, but some parts were outdated due to new libraries’ and packages’ versions. Hence, I’m jotting down what needs to be augmented from the original article here, for my own reference and for others who encounter the same situation too!

When you have reached this part of the article:

Now only 6 left, as Amazon Linux don’t have gtk builtin, we need borrow packages from other distributions:

Pay heed that some of the packages no longer exist.

Tip πŸ’‘: Go to the URL (up till the last trailing slash)

For example, for:
http://mirror.centos.org/centos/7/os/x86_64/Packages/atk-2.22.0-3.el7.x86_64.rpm

Navigate to:
http://mirror.centos.org/centos/7/os/x86_64/Packages/

And search for atk- :

Perhaps by the time you read this article, the version have increased again!

Hence, the nearest match would be atk-2.28.1–1.el7.x86_64.rpm .

Go through the list of items to install with this technique, and you should be almost there!

Almost.

Unlike what’s mentioned, there are still missing deps after installing the list of packages!

Alas, there are still some missing dependencies being listed when you run ldd chrome | grep not . After googling around, this seals the deal:

The number of emojis speak volumes about this comment!

After the long yum install, one last dep!

After running the long yum install command, you will be left with one last dependency: libpng12.so.0 . Same thing, look for the x86_64 version of the libpng12 package in the Centos packages listing page and download it.

And finally, all the dependencies have been assembled.

Ending note

Hopefully the tips mentioned above will/have helped in your attempt to install Puppeteer on the AMI! If there are any parts that are unclear here, and it is also unclear in the original post, do give a shoutout. Similarly, if you have tried and noticed my tips are outdated, do let me know too.

Top comments (0)

12 Rarely Used Javascript APIs You Need

>> Check out this classic DEV post <<