有没有办法在 Linux 上安装 Google Chrome 并自动安装所有需要的依赖项?

有没有办法在 Linux 上安装 Google Chrome 并自动安装所有需要的依赖项?

我正在尝试在以下 64 位 Linux 版本上安装 Google Chrome …

[davea@mydevbox mydir]$ uname -a
Linux mydevbox.mydomain.com 1.3.8-18.52.amzn1.x86_64 #1 SMP Wed Mar 16 17:15:34 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

下载 rpm 包并尝试安装后,出现以下错误…

[davea@mydevbox ~]$ sudo rpm -ivh google-chrome-stable_current_x86_64.rpm 
[sudo] password for davea: 
warning: google-chrome-stable_current_x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 7fac5991: NOKEY
error: Failed dependencies:
    xdg-utils is needed by google-chrome-stable-49.0.2623.112-1.x86_64
    libatk-1.0.so.0()(64bit) is needed by google-chrome-stable-49.0.2623.112-1.x86_64
    libgconf-2.so.4()(64bit) is needed by google-chrome-stable-49.0.2623.112-1.x86_64
    libgdk_pixbuf-2.0.so.0()(64bit) is needed by google-chrome-stable-49.0.2623.112-1.x86_64
    libgdk-x11-2.0.so.0()(64bit) is needed by google-chrome-stable-49.0.2623.112-1.x86_64
    libgtk-x11-2.0.so.0()(64bit) is needed by google-chrome-stable-49.0.2623.112-1.x86_64
    libpango-1.0.so.0()(64bit) is needed by google-chrome-stable-49.0.2623.112-1.x86_64
    libpangocairo-1.0.so.0()(64bit) is needed by google-chrome-stable-49.0.2623.112-1.x86_64
    libXcomposite.so.1()(64bit) is needed by google-chrome-stable-49.0.2623.112-1.x86_64
    libXcursor.so.1()(64bit) is needed by google-chrome-stable-49.0.2623.112-1.x86_64
    libXrandr.so.2()(64bit) is needed by google-chrome-stable-49.0.2623.112-1.x86_64

另一个链接说我需要安装“lsb”和“libXScrnSaver”,我通过 yum 安装了。有没有办法安装 Google Chrome 并自动安装所有依赖项?

编辑:我尝试了你的建议,但是收到了一堆关于无法找到依赖项的错误……

[davea@mydevbox ~]$ sudo yum --nogpgcheck localinstall google-chrome-stable_current_x86_64.rpm
[sudo] password for davea: 
Loaded plugins: fastestmirror, priorities, update-motd, upgrade-helper
Examining google-chrome-stable_current_x86_64.rpm: google-chrome-stable-49.0.2623.112-1.x86_64
Marking google-chrome-stable_current_x86_64.rpm to be installed
Resolving Dependencies
amzn-main/latest                                                                                                                                                                     |  2.1 kB     00:00     
amzn-updates/latest                                                                                                                                                                  |  2.3 kB     00:00     
--> Running transaction check
---> Package google-chrome-stable.x86_64 0:49.0.2623.112-1 will be installed
--> Processing Dependency: xdg-utils for package: google-chrome-stable-49.0.2623.112-1.x86_64
Loading mirror speeds from cached hostfile
 * amzn-main: packages.us-east-1.amazonaws.com
 * amzn-updates: packages.us-east-1.amazonaws.com
--> Processing Dependency: libatk-1.0.so.0()(64bit) for package: google-chrome-stable-49.0.2623.112-1.x86_64
--> Processing Dependency: libgconf-2.so.4()(64bit) for package: google-chrome-stable-49.0.2623.112-1.x86_64
--> Processing Dependency: libgdk_pixbuf-2.0.so.0()(64bit) for package: google-chrome-stable-49.0.2623.112-1.x86_64
--> Processing Dependency: libgdk-x11-2.0.so.0()(64bit) for package: google-chrome-stable-49.0.2623.112-1.x86_64
--> Processing Dependency: libgtk-x11-2.0.so.0()(64bit) for package: google-chrome-stable-49.0.2623.112-1.x86_64
--> Processing Dependency: libpango-1.0.so.0()(64bit) for package: google-chrome-stable-49.0.2623.112-1.x86_64
--> Processing Dependency: libpangocairo-1.0.so.0()(64bit) for package: google-chrome-stable-49.0.2623.112-1.x86_64
--> Processing Dependency: libXcomposite.so.1()(64bit) for package: google-chrome-stable-49.0.2623.112-1.x86_64
--> Processing Dependency: libXcursor.so.1()(64bit) for package: google-chrome-stable-49.0.2623.112-1.x86_64
--> Processing Dependency: libXrandr.so.2()(64bit) for package: google-chrome-stable-49.0.2623.112-1.x86_64
--> Running transaction check
---> Package google-chrome-stable.x86_64 0:49.0.2623.112-1 will be installed
--> Processing Dependency: xdg-utils for package: google-chrome-stable-49.0.2623.112-1.x86_64
--> Processing Dependency: libatk-1.0.so.0()(64bit) for package: google-chrome-stable-49.0.2623.112-1.x86_64
--> Processing Dependency: libgconf-2.so.4()(64bit) for package: google-chrome-stable-49.0.2623.112-1.x86_64
--> Processing Dependency: libgdk_pixbuf-2.0.so.0()(64bit) for package: google-chrome-stable-49.0.2623.112-1.x86_64
--> Processing Dependency: libgdk-x11-2.0.so.0()(64bit) for package: google-chrome-stable-49.0.2623.112-1.x86_64
--> Processing Dependency: libgtk-x11-2.0.so.0()(64bit) for package: google-chrome-stable-49.0.2623.112-1.x86_64
---> Package libXcomposite.x86_64 0:0.4.3-4.6.amzn1 will be installed
---> Package libXcursor.x86_64 0:1.1.14-2.1.9.amzn1 will be installed
---> Package libXrandr.x86_64 0:1.4.1-2.1.8.amzn1 will be installed
---> Package pango.x86_64 0:1.28.1-10.11.amzn1 will be installed
--> Processing Dependency: libthai >= 0.1.9 for package: pango-1.28.1-10.11.amzn1.x86_64
--> Processing Dependency: libthai.so.0(LIBTHAI_0.1)(64bit) for package: pango-1.28.1-10.11.amzn1.x86_64
--> Processing Dependency: libXft.so.2()(64bit) for package: pango-1.28.1-10.11.amzn1.x86_64
--> Processing Dependency: libthai.so.0()(64bit) for package: pango-1.28.1-10.11.amzn1.x86_64
--> Running transaction check
---> Package google-chrome-stable.x86_64 0:49.0.2623.112-1 will be installed
--> Processing Dependency: xdg-utils for package: google-chrome-stable-49.0.2623.112-1.x86_64
--> Processing Dependency: libatk-1.0.so.0()(64bit) for package: google-chrome-stable-49.0.2623.112-1.x86_64
--> Processing Dependency: libgconf-2.so.4()(64bit) for package: google-chrome-stable-49.0.2623.112-1.x86_64
--> Processing Dependency: libgdk_pixbuf-2.0.so.0()(64bit) for package: google-chrome-stable-49.0.2623.112-1.x86_64
--> Processing Dependency: libgdk-x11-2.0.so.0()(64bit) for package: google-chrome-stable-49.0.2623.112-1.x86_64
--> Processing Dependency: libgtk-x11-2.0.so.0()(64bit) for package: google-chrome-stable-49.0.2623.112-1.x86_64
---> Package libXft.x86_64 0:2.3.1-2.7.amzn1 will be installed
---> Package libthai.x86_64 0:0.1.12-3.5.amzn1 will be installed
--> Finished Dependency Resolution
Error: Package: google-chrome-stable-49.0.2623.112-1.x86_64 (/google-chrome-stable_current_x86_64)
           Requires: xdg-utils
Error: Package: google-chrome-stable-49.0.2623.112-1.x86_64 (/google-chrome-stable_current_x86_64)
           Requires: libgdk-x11-2.0.so.0()(64bit)
Error: Package: google-chrome-stable-49.0.2623.112-1.x86_64 (/google-chrome-stable_current_x86_64)
           Requires: libatk-1.0.so.0()(64bit)
Error: Package: google-chrome-stable-49.0.2623.112-1.x86_64 (/google-chrome-stable_current_x86_64)
           Requires: libgconf-2.so.4()(64bit)
Error: Package: google-chrome-stable-49.0.2623.112-1.x86_64 (/google-chrome-stable_current_x86_64)
           Requires: libgtk-x11-2.0.so.0()(64bit)
Error: Package: google-chrome-stable-49.0.2623.112-1.x86_64 (/google-chrome-stable_current_x86_64)
           Requires: libgdk_pixbuf-2.0.so.0()(64bit)
 You could try using --skip-broken to work around the problem
** Found 2 pre-existing rpmdb problem(s), 'yum check' output follows:
2000:jdk-1.6.0_45-fcs.x86_64 is a duplicate with 2000:jdk-1.6.0_35-fcs.x86_64
2000:jdk-1.6.0_65-fcs.x86_64 is a duplicate with 2000:jdk-1.6.0_45-fcs.x86_64

答案1

您显然使用的是 Amazon Linux。这是 CentOS 的衍生产品。但有些变化。所以我不确定你的目标是否可行。最好使用 CentOS。但即便如此 - 某些版本的 Chrome 不支持 CentOS,然后 Google 重新添加了支持。我记得这种支持/不支持的翻转发生过几次。因此,在 Fedora 上使用 Chrome 会更安全。甚至存储库使用适用于 Fedora 的 Chromium(Chrome 的免费版本)。

答案2

您可以按照此处针对 64 位的说明进行操作,使用 skip-broken 来避免安装时出现问题:

https://www.linkedin.com/pulse/using-yum-install-google-chrome-aws-linux-ami-konstantinos-demiris

小心这些指令中的错误连字符!复制并粘贴到文本编辑器,然后在运行这些命令之前修复所有连字符。

相关内容