CentOS 7.x安装Google Chrome踩坑指南

CentOS 7.x安装Google Chrome踩坑指南

转载:https://www.pmssw.com/210.html

2020-03-10 23:29:43
 1586   2  0
 

一、系统简述

腾讯云服务器操作系统:CentOS 7.2.1511

二、安装Google Chrome

1.使用以下命令行安装Chrome

yum install https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm

2.安装时可能会出现类似以下错误!!!!!!

libXcomposite.so.1()(64bit) is needed by google-chrome-stable-80.0.3987.132
....
....

这是因为缺少依赖

3.安装依赖

repoquery --nvr --whatprovides libappindicator3.so.1

4.依赖安装完之后开始执行

rpm -ivh google-chrome-stable_current_x86_64.rpm

5.执行完以上尝试启动Chrome, 进入chrome安装目录执行代码google-chrome

google-chrome

执行完可能会出现如下错误!!!!!!

NaCl helper process running without a sandbox!
Most likely you need to configure your SUID sandbox correctly

6.基于以上错误,尝试重新输入命令行

google-chrome --no-sandbox

7.如果还是出现以上错误,输入命令行

whereis google-chrome

出现

google-chrome: /usr/bin/google-chrome /usr/share/man/man1/google-chrome.1.gz

8.使用vim进入编辑

vim /usr/bin/google-chrome

9.修改以下内容

将 exec -a "$0" "$HERE/chrome" "$@" 改为
exec -a "$0" "$HERE/chrome" "$@" --user-data-dir --no-sandbox

10.重新进入Chrome目录,启动Chrome

输入google-chrome --headless --disable-gpu --dump-dom --no-sandbox https://www.baidu.com

查看是否打印百度网页,如有打印则安装并启动成功

评论 (2)

 

 

 

 

 
 
 
 
 
发布评论
  •  
     

    [root@test chrome]# rpm -ivh google-chrome-stable_current_x86_64.rpm
    warning: google-chrome-stable_current_x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 7fac5991: NOKEY
    error: Failed dependencies:
    libappindicator3.so.1()(64bit) is needed by google-chrome-stable-80.0.3987.132-1.x86_64
    libatk-bridge-2.0.so.0()(64bit) is needed by google-chrome-stable-80.0.3987.132-1.x86_64
    libatspi.so.0()(64bit) is needed by google-chrome-stable-80.0.3987.132-1.x86_64
    libc.so.6(GLIBC_2.14)(64bit) is needed by google-chrome-stable-80.0.3987.132-1.x86_64
    libc.so.6(GLIBC_2.15)(64bit) is needed by google-chrome-stable-80.0.3987.132-1.x86_64
    libc.so.6(GLIBC_2.16)(64bit) is needed by google-chrome-stable-80.0.3987.132-1.x86_64
    liberation-fonts is needed by google-chrome-stable-80.0.3987.132-1.x86_64
    libgdk-3.so.0()(64bit) is needed by google-chrome-stable-80.0.3987.132-1.x86_64
    libgtk-3.so.0()(64bit) is needed by google-chrome-stable-80.0.3987.132-1.x86_64
    [root@test chrome]# repoquery --nvr --whatprovides libXss.so.1
    libXScrnSaver-1.2.2-2.el6
    [root@test chrome]# yum install -y libXScrnSaver-1.2.2-2.el6
    [root@test chrome]# repoquery --nvr --whatprovides libappindicator3.so.1
    [root@test chrome]# repoquery --nvr --whatprovides libatk-bridge-2.0.so.0
    [root@test chrome]# repoquery --nvr --whatprovides libatspi.so.0
    [root@test chrome]# repoquery --nvr --whatprovides libc.so.6
    glibc-2.12-1.212.el6
    glibc-2.12-1.212.el6_10.3
    下面证实,必须选第二个
    [root@test chrome]# yum install -y glibc-2.12-1.212.el6
    Error: Package: glibc-2.12-1.212.el6.x86_64 (base)
    Requires: glibc-common = 2.12-1.212.el6
    Removing: glibc-common-2.12-1.166.el6_7.7.x86_64 (@updates)
    glibc-common = 2.12-1.166.el6_7.7
    Updated By: glibc-common-2.12-1.212.el6_10.3.x86_64 (updates)
    glibc-common = 2.12-1.212.el6_10.3
    Available: glibc-common-2.12-1.212.el6.x86_64 (base)
    glibc-common = 2.12-1.212.el6
    You could try using --skip-broken to work around the problem
    You could try running: rpm -Va --nofiles --nodigest
    [root@test chrome]# yum install -y glibc-2.12-1.212.el6_10.3
    Complete!
    [root@test chrome]# repoquery --nvr --whatprovides liberation-fonts
    [root@test chrome]# repoquery --nvr --whatprovides libgdk-3.so.0
    [root@test chrome]# repoquery --nvr --whatprovides libgtk-3.so.0
    [root@test chrome]# repoquery --nvr --whatprovides libnss3.so
    nss-3.36.0-9.el6_10
    nss-3.36.0-8.el6
    nss-3.44.0-7.el6_10
    [root@test chrome]# yum install -y nss-3.36.0-8.el6
    把能安装的依赖项都安装好后,再次安装Chrome报错相同。难道是Centos6为mini无桌面版的原因?还是那些没查出来在哪个安装包的依赖项未安装导致的?

  • 2
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值