在Amazon Linux上安装Chromium [英] Installing Chromium on Amazon Linux

查看:166
本文介绍了在Amazon Linux上安装Chromium的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在Amazon Linux计算机上安装Chromium(或Chrome,无论哪种)。

I am trying to install Chromium (or Chrome, whichever) on an Amazon Linux machine.

我尝试了许多步骤,但无济于事。这是我尝试过的:

I have tried many steps, to no avail. Here is what I have tried:

yum install epel       # worked
yum install chromium

生成的错误消息:


Error: Package: chromium-31.0.1650.63-2.el6.x86_64 (chromium-el6)
           Requires: libgnome-keyring.so.0()(64bit)
Error: Package: chromium-31.0.1650.63-2.el6.x86_64 (chromium-el6)
           Requires: libgtk-x11-2.0.so.0()(64bit)
Error: Package: chromium-31.0.1650.63-2.el6.x86_64 (chromium-el6)
           Requires: libgdk_pixbuf-2.0.so.0()(64bit)
Error: Package: chromium-31.0.1650.63-2.el6.x86_64 (chromium-el6)
           Requires: libXss.so.1()(64bit)
Error: Package: chromium-31.0.1650.63-2.el6.x86_64 (chromium-el6)
           Requires: libgdk-x11-2.0.so.0()(64bit)
Error: Package: chromium-31.0.1650.63-2.el6.x86_64 (chromium-el6)
           Requires: libcanberra-gtk2(x86-64)
Error: Package: chromium-31.0.1650.63-2.el6.x86_64 (chromium-el6)
           Requires: libatk-1.0.so.0()(64bit)




特定RPM软件包的安装量



I尝试下载Chrome RPM,都最新的稳定版本以及特定版本,然后运行

Yum install of specific RPM package

I tried downloading a Chrome RPM, both the latest stable version as well as a specific version, and then running

yum install google-chrome-stable-64.0.3282.119-1.x86_64.rpm

它产生了相同的错误消息

It yielded the same error message

https://commondatastorage.googleapis.com/chromium-browser-snapshots/index.html?prefix=Linux_x64/532015/

运行它的属出现错误消息

Running it generated the error message


加载共享库时出错:libXcursor.so.1:无法打开共享库文件:没有这样的文件或目录

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

我已运行

yum install libXcursor
yum install libXfixes     # because chrome was then complaining about that library
yum install libXdamage    # and subsequently that one

全部正常。

但是,Chrome浏览器开始抱怨 libcups 库:

However, then Chrome started complaining about a libcups library :


加载共享库时出错:libcups.so.2:无法打开共享对象文件:没有这样的文件或目录

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

libcups ,这似乎是因为它是一个32位库。某些页面建议安装 ia32-libs 作为解决方案,但是运行 yum install ia32-libs 表明它已经

libcups wasn't found by yum, and it seems that this is because it is a 32 bit library. Some page recommended to install ia32-libs as a solution, but running yum install ia32-libs showed that it was already installed.

我无法超越这一点。


  • 我还尝试了在这里,但是没有用

  • 某些页面指向使用 dpkg ,但是该命令不能在Amazon Linux上显然不存在

  • apt 都不

  • I also tried steps mentioned here, but that didn't work
  • some pages point to using dpkg, but that command doesn't exist on Amazon Linux apparently
  • apt neither

推荐答案

为了使Lambda能够正常运行,我部署了与EC2实例相同的AMI(当前为amzn-ami-hvm-2017.03.1.20170812-x86_64-gp2 )。安装chrome之后,通常会丢失所有依赖项。

In order to get headless chrome working on Lambda, I deployed an identical AMI as an EC2 instance (currently amzn-ami-hvm-2017.03.1.20170812-x86_64-gp2). After installing chrome, the usual litany of missing dependencies begins.

参考: https://medium.com/mockingbot/run-puppeteer-chrome-headless-on-ec2-amazon-linux-ami-6c9c6a17bee6

导航到包含chrome可执行文件的文件夹,并使用ldd检查缺少的依赖项:

Navigate to the folder containing the chrome executable and use ldd to check for missing dependencies:

$ ldd chrome | grep not
libpangocairo-1.0.so.0 => not found
libpango-1.0.so.0 => not found
libcairo.so.2 => not found
libXcursor.so.1 => not found
libXdamage.so.1 => not found
libXfixes.so.3 => not found
libcups.so.2 => not found
libXss.so.1 => not found
libXrandr.so.2 => not found
libgconf-2.so.4 => not found
libatk-1.0.so.0 => not found
libgtk-3.so.0 => not found
libgdk-3.so.0 => not found
libgdk_pixbuf-2.0.so.0 => not found

安装以下内容:

$ sudo yum install cups-libs dbus-glib libXrandr libXcursor libXinerama cairo cairo-gobject pango

再次检查:

$ ldd chrome | grep not
libXss.so.1 => not found
libgconf-2.so.4 => not found
libatk-1.0.so.0 => not found
libgtk-3.so.0 => not found
libgdk-3.so.0 => not found
libgdk_pixbuf-2.0.so.0 => not found

我们需要从大量疯狂的RPM中获取这些依赖项:

We need to grab these dependencies from a maddeningly large set of RPMs:

# Install ATK from CentOS 7
$ 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 GTK from fedora 20
$ sudo rpm -ivh --nodeps http://dl.fedoraproject.org/pub/archive/fedora/linux/releases/20/Fedora/x86_64/os/Packages/g/GConf2-3.2.6-7.fc20.x86_64.rpm
$ sudo rpm -ivh --nodeps http://dl.fedoraproject.org/pub/archive/fedora/linux/releases/20/Fedora/x86_64/os/Packages/l/libXScrnSaver-1.2.2-6.fc20.x86_64.rpm
$ sudo rpm -ivh --nodeps http://dl.fedoraproject.org/pub/archive/fedora/linux/releases/20/Fedora/x86_64/os/Packages/l/libxkbcommon-0.3.1-1.fc20.x86_64.rpm
$ sudo rpm -ivh --nodeps http://dl.fedoraproject.org/pub/archive/fedora/linux/releases/20/Fedora/x86_64/os/Packages/l/libwayland-client-1.2.0-3.fc20.x86_64.rpm
$ sudo rpm -ivh --nodeps http://dl.fedoraproject.org/pub/archive/fedora/linux/releases/20/Fedora/x86_64/os/Packages/l/libwayland-cursor-1.2.0-3.fc20.x86_64.rpm
$ sudo rpm -ivh --nodeps http://dl.fedoraproject.org/pub/archive/fedora/linux/releases/20/Fedora/x86_64/os/Packages/g/gtk3-3.10.4-1.fc20.x86_64.rpm
# Install Gdk-Pixbuf from fedora 16
$ sudo rpm -ivh --nodeps http://dl.fedoraproject.org/pub/archive/fedora/linux/releases/16/Fedora/x86_64/os/Packages/gdk-pixbuf2-2.24.0-1.fc16.x86_64.rpm

这应该解决所有依赖关系,并且chrome应该能够运行,终于!!

That should resolve all the dependencies and chrome should be able to run, finally!!

这篇关于在Amazon Linux上安装Chromium的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆