一、手动安装
1. 下载 rpm 包
https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm
2. 安装依赖包
yum install -y lsb
yum install -y libXScrnSaver
3. 安装chrome
[root@localhost Downloads]# 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-66.0.3359.170-1.x86_64
查找依赖包由谁提供
[root@localhost Downloads]# yum provides */libappindicator3.so.1
安装依赖包
[root@localhost Downloads]# yum -y install libappindicator-gtk3-12.10.0-11.el7.x86_64
再次安装谷歌浏览器
[root@localhost Downloads]# 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
Preparing... ################################# [100%]
Updating / installing...
1:google-chrome-stable-66.0.3359.17################################# [100%]
Redirecting to /bin/systemctl start atd.service
4.运行
问题1
[root@localhost bin]# ./google-chrome
[24305:24305:0513/080032.208237:ERROR:zygote_host_impl_linux.cc(88)] Running as root without --no-sandbox is not supported. See https://crbug.com/638180.
报错是说不支持以root运行黑盒子
修改配置文件
[root@localhost bin]# vim google-chrome
将exec -a "$0" "$HERE/chrome" "$@" 改成exec -a "$0" "$HERE/chrome" "$@" --user-data-dir --no-sandbox
修改后再次运行就成功
问题2:
[root@localhost app]# sh /usr/bin/google-chrome
/usr/bin/google-chrome: line 45: syntax error near unexpected token `>'
/usr/bin/google-chrome: line 45: `exec > >(exec cat)'
注释以下行:
# Sanitize std{in,out,err} because they'll be shared with untrusted child
# processes (http://crbug.com/376567).
#exec < /dev/null
#exec > >(exec cat)
#exec 2> >(exec cat >&2)
二、自动安装
yum install https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm
-----------------------------------------------------分割线---------------------------------------------------
ubuntu安装过程
(1)sudo wget http://www.linuxidc.com/files/repo/google-chrome.list -P /etc/apt/sources.list.d/ (将下载源加入到系统的源列表))
(2) wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | sudo apt-key add - (导入谷歌软件的公钥,用于下面步骤中对下载软件进行验证,执行完后会出现OK)
(3)sudo apt-get update (用于对当前系统的可用更新列表进行更新,这也是许多 Linux 发行版经常需要执行的操作,目的是随时获得最新的软件版本信息,执行完后会出现下面的结果)
(4)sudo apt-get install google-chrome-stable (执行对谷歌 Chrome 浏览器(稳定版)的安装)