CentOs如何快速安装Chrome

The Easy Way

Universal Installation Script for RHEL/CentOS 6.X/7.X

All you need to do is run our installer script and you should be good to go.

curl https://intoli.com/install-google-chrome.sh | bash

This will automatically configure and enable the official Google repository, import Google’s signing key, and install the latest google-chrome-stable executable in your path. If you’re on a RHEL 6.X flavor the it will also automatically find and install all of the unmet dependencies that would normally make the installation fail. You can rerun the script whenever you want to grab the latest version of Google Chrome and, if you’re using RHEL 7.X, then you can update the package using yum as you would with any other package.

RHEL/CentOS 7.X

Alternatively, you can add the repository manually if you’re using a 7.X version. If you’re using Amazon Linux AMI then you’re definitely on a 6.X version and need to use the installation script. Otherwise, you can run

cat /etc/redhat-release

and check the output for the version number to confirm that you’re using 7.X. For example, if you’re using RHEL 7.0 then you would expect to see something like:

Red Hat Enterprise Linux Server release 7.0 (Maipo)

You can use the official Google repository if you see a 7.X version there. To add it to your system, simply create a file called /etc/yum.repos.d/google-chrome.repo with the following contents.

[google-chrome]
name=google-chrome
baseurl=http://dl.google.com/linux/chrome/rpm/stable/$basearch
enabled=1
gpgcheck=1
gpgkey=https://dl-ssl.google.com/linux/linux_signing_key.pub

Then you just need to run

sudo yum install google-chrome-stable

to install the Chrome package. This will add the google-chrome-stable script in /usr/bin/. Note that this is the same thing that the installation script does on 7.X flavors, so it’s safe to use the script regardless of which version you’re on.

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注