Phenomenon

linux-686378/chrome-linux/chrome: error while loading shared libraries: libX11.so.6: cannot open shared object file: No such file or directory

The above information shows that our system lacks the library to start chorme.

Solve one

So I searched and installed the libX11.so.6 library, and found that the names of the packages installed on different Linux systems are different. I chose the library libX11-devel

Solve two

After the installation, I tried to start again and found that there was an error indicating that another library libXcomposite.so.1 . It is estimated that other libraries will be missing in the future, so it is too troublesome to keep trying. Fortunately, I found a document. The method to check the missing libraries is described above, and the system dependent libraries are given: https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md
Execute in the chomme program folder:

ldd | grep not

If you are a Linux system and by npm i pupeteer installed in node_modules/pupeteer/.local-chromium/linux-686378/chrome-linux/chrome run, check which libraries are also missing. As shown below:
企业微信截图_a85b7305-05af-4400-95ce-3d360cfd5ee2.png

Final solution

In fact, I still don’t know what library to install if I get the missing library, because the library names are different for different system versions.

  • I tried to install the displayed name directly, but found that it was not easy to use ⚠️.
  • You can try to use the dependency installation given in the document, the font is not necessary. (I haven't tried this way)

I found a practical installation from the Internet:
ubuntu:

apt 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

centos:

yum -y install libX11 libXcomposite libXcursor libXdamage libXext libXi libXtst cups-libs libXScrnSaver libXrandr alsa-lib pango atk at-spi2-atk gtk3

If you need docker installation, remember to add --assume-yes to the dockerfile to confirm whether to continue.

Mine is centOS, and it runs successfully after installation.

Font problem

image.png
Chinese font rendering failed, fonts need to be installed on the machine.

yum install ipa-gothic-fonts xorg-x11-fonts-100dpi xorg-x11-fonts-75dpi xorg-x11-utils xorg-x11-fonts-cyrillic xorg-x11-fonts-Type1 xorg-x11-fonts-misc -y

Reference

Found that someone summarized a similar: https://github.com/wayou/wayou.github.io/issues/48


specialCoder
2.2k 声望168 粉丝

前端 设计 摄影 文学