Skip to content

Instantly share code, notes, and snippets.

@winuxue
Created May 22, 2019 01:15
Show Gist options
  • Save winuxue/cfef08e2f5fe9dfc16a1d67a4ad38a01 to your computer and use it in GitHub Desktop.
Save winuxue/cfef08e2f5fe9dfc16a1d67a4ad38a01 to your computer and use it in GitHub Desktop.
Solution for common dependences issues using puppeteer in ubuntu 18.04 (Bionic)

puppeteer dependeces in ubuntu 18.04 (Bionic)

error while loading shared libraries: libnss3.so: cannot open shared object file: No such file or directory

sudo apt-get install libnss3

error while loading shared libraries: libXss.so.1: cannot open shared object file: No such file or directory

sudo apt-get install libxss1

error while loading shared libraries: libasound.so.2: cannot open shared object file: No such file or directory

apt-get install libasound2

error while loading shared libraries: libatk-1.0.so.0: cannot open shared object file: No such file or directory

apt-get install libatk-bridge2.0-0

error while loading shared libraries: libgtk-3.so.0: cannot open shared object file: No such file or directory

apt install libgtk-3-0
@LuisEstebanArango
Copy link

Thank you @awps !

@JKelly423
Copy link

Here's what worked in my case:

apt-get install libnss3 libxss1 libasound2 libatk-bridge2.0-0 libgtk-3-0 libgbm-dev

Thank you! @awps

@shstkvch
Copy link

What worked on a new Ubuntu 20.04 VPS:

sudo apt-get install 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 libatk-bridge2.0-0 libgbm-dev

Had to combine several suggestions to make it work.

Thanks Seb, this worked!

@MaksimDrozd
Copy link

thanks

@aman-g202
Copy link

aman-g202 commented Dec 13, 2022

Thanks @sebastiaanluca

Run the apt-get mentioned by @sebastiaanluca

sudo apt-get install 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 libatk-bridge2.0-0 libgbm-dev

Followed by lunch the chrome process with no-sandbox argument

this.browser = await puppeteer.launch({
   headless: true,
   args: ["--no-sandbox"],
});

@manokaran68
Copy link

manokaran68 commented Dec 13, 2022

Thank you Sebastian Luca

@vostersc
Copy link

Thank you.

@davidric
Copy link

davidric commented Jan 26, 2023

libnss3 libxss1 libasound2 libatk-bridge2.0-0 libgtk-3-0 libgbm-dev

It works. Thanks @awps!

@joecorsi
Copy link

joecorsi commented May 24, 2023

anyone running ubuntu 22.04 LTS, i just went though each dependecy for puppeteer as they came up:

  • libatk-bridge2.0-0
  • libcups2
  • libxkbcommon.so.0
  • libXcomposite.so.1
  • libXdamage.so.1
  • libXfixes.so.3
  • libXrandr.so.2
  • libgbm.so.1
  • libpango-1.0.so.0

after installing everything above and using args: ["--no-sandbox"], puppeteer works.

@delvinjoseph
Copy link

What worked on a new Ubuntu 20.04 VPS:

sudo apt-get install 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 libatk-bridge2.0-0 libgbm-dev

Had to combine several suggestions to make it work.

Worked for me

@MarioVillar
Copy link

Here's what worked in my case:

apt-get install libnss3 libxss1 libasound2 libatk-bridge2.0-0 libgtk-3-0 libgbm-dev

That worked for me too! Thank you for the solution!

@Solaimanx
Copy link

sudo apt-get install -yq --no-install-recommends 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 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 libnss3

This worked for me

@jaimeivan
Copy link

thank you !!!

@iJustErikk
Copy link

legends

@miaopanpan
Copy link

apt-get install libnss3 libxss1 libasound2 libatk-bridge2.0-0 libgtk-3-0 libgbm-dev

thank you

@VGerris
Copy link

VGerris commented Mar 27, 2024

anyone running ubuntu 22.04 LTS, i just went though each dependecy for puppeteer as they came up:

* libatk-bridge2.0-0

* libcups2

* libxkbcommon.so.0

* libXcomposite.so.1

* libXdamage.so.1

* libXfixes.so.3

* libXrandr.so.2

* libgbm.so.1

* libpango-1.0.so.0

after installing everything above and using args: ["--no-sandbox"], puppeteer works.

This is my list, not using options but the grafana module for icinga :
- libatk-bridge2.0-0
- libcups2
- libxcomposite1
- libxdamage1
- libxfixes3
- libxrandr2
- libgbm1
- libxkbcommon-x11-0
- libpango1.0-0
- libasound2

Thank you

@samal-rasmussen
Copy link

Ubuntu 22.04 command:
sudo apt install -y libatk1.0-0 libatk-bridge2.0-0 libcups2 libxcomposite-dev libxdamage1 libxrandr2 libgbm1 libxkbcommon-x11-0 libpango1.0-0 libasound2

Thank you @VGerris @joecorsi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment