- 浏览: 36739 次
文章分类
最新评论
-
cjh326419411:
如果调用啊 ,$("#vcLoginPwd" ...
Jquery 判断是否锁定大小写键插件 -
HappyWaterLife:
my249645546 写道text-transform:up ...
Jquery 判断是否锁定大小写键插件 -
my249645546:
text-transform:uppercase; 大写tex ...
Jquery 判断是否锁定大小写键插件
(1)运行sh脚本向yum repo添加chrome源,运行下面的命令
sudo sh google-repo-setup.sh
(2)用yum安装chrome
yum install google-chrome-stable
#!/bin/bash # # Copyright 2007 Google Inc. All Rights Reserved. KEYNAME=linux_signing_key.pub PUBKEYURL="https://dl-ssl.google.com/linux/$KEYNAME" REPOURL="http://dl.google.com/linux" DEBREPO="$REPOURL/deb" RPMREPO="$REPOURL/rpm" ARCH=$(uname -m) DRYRUN=0 export PATH=/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin usage () { echo "Usage: $(basename $0) [-h] [-n]" echo "-n Don't make any chanages, just show what would happen." echo "-h Show this help message." } writetempfile () { if [ $DRYRUN -eq 0 ]; then TEMPFILE=$(mktemp -q) if [ $? -ne 0 ]; then echo "ERROR: couldn't create temp file." exit 1 fi TEMPFILES="$TEMPFILES \"$TEMPFILE\"" FN="$TEMPFILE" else FN=/dev/stdout # So we have something to print during dry run. TEMPFILE="dry-run" fi while [ $# -gt 0 ]; do echo "$1" >> "$FN" shift done } # Start with 2 because sudo/su use 0/1 internally for return values. ROOTEXITBASE=2 ROOTEXITLAST=$ROOTEXITBASE ROOTCOMMANDS="" declare -a HANDLERS queuecmd () { local OPTNAME local OPTIND while getopts ":e:" OPTNAME do case $OPTNAME in e ) HANDLERS[$ROOTEXITLAST]="$OPTARG" ;; esac done shift $(($OPTIND - 1)) CMD=$1 shift local ARGS="" while [ $# -gt 0 ]; do ARGS="$ARGS\"$1\" " shift done if [ $DRYRUN -eq 0 ]; then if [ "${HANDLERS[$ROOTEXITLAST]}" ]; then ROOTCOMMANDS="$ROOTCOMMANDS $CMD $ARGS || RETVAL=\$((RETVAL+$((2**ROOTEXITLAST++)))) ;" else ROOTCOMMANDS="$ROOTCOMMANDS $CMD $ARGS;" fi else echo "DRY-RUN: $CMD $ARGS" fi } handlerooterror () { EXITCODE=$1 while [ $((ROOTEXITLAST--)) -ge $ROOTEXITBASE ]; do if [ $((2**$ROOTEXITLAST & $EXITCODE)) -ne 0 ]; then if [ "${HANDLERS[$ROOTEXITLAST]}" ]; then ${HANDLERS[$ROOTEXITLAST]} else echo echo "ERROR: Unhandled exit code from root shell: $1." fi fi done } see_webdocs () { echo "Please see http://www.google.com/linuxrepositories/index.html" echo "for information on configuring your system manually." } repoconfig_error () { echo echo "ERROR: Couldn't configure repository settings in '$1'." see_webdocs echo } keyadd_error () { echo echo "ERROR: The package signing key could not be installed." see_webdocs echo } repoapp_error () { echo echo "ERROR: Couldn't configure repository using $1." see_webdocs echo } configRPM () { queuecmd echo "Installing Google package signing key for RPM..." queuecmd -e keyadd_error rpm --import $KEYFILE } #========= # MAIN #========= while getopts ":nh" OPTNAME do case $OPTNAME in n ) DRYRUN=1 echo "--------------------------------------------------------------" echo "Performing dry run. No changes will be made to your system." echo "--------------------------------------------------------------" echo ;; h ) usage exit 0 ;; \: ) echo "'-$OPTARG' needs an argument." usage exit 1 ;; * ) echo "ERROR: invalid command-line option: $OPTARG" echo usage exit 1 ;; esac done shift $(($OPTIND - 1)) # Try to detect the package manager based on distro rules. We could try to # detect the package management programs directly, but that might be confusing # if a system has more than one installed (e.g. an APT-based system might have # rpm installed to be LSB-compliant). if [ ! "$PACKAGEMANAGER" ]; then if [ -f /etc/lsb-release ]; then eval $(sed -e '/DISTRIB_ID/!d' /etc/lsb-release) case $DISTRIB_ID in *buntu) PACKAGEMANAGER=apt ;; esac fi fi if [ ! "$PACKAGEMANAGER" ]; then if [ -f /etc/debian_release ] || [ -f /etc/debian_version ]; then PACKAGEMANAGER=apt fi fi if [ ! "$PACKAGEMANAGER" ]; then if [ -f /etc/fedora-release ]; then PACKAGEMANAGER=yum fi fi if [ ! "$PACKAGEMANAGER" ]; then if [ -f /etc/SuSE-release ]; then PACKAGEMANAGER=yast fi fi if [ ! "$PACKAGEMANAGER" ]; then if [ -f /etc/mandriva-release ]; then PACKAGEMANAGER=urpmi fi fi if [ ! "$PACKAGEMANAGER" ]; then if [ -f /etc/redhat-release ] || [ -f /etc/redhat_version ]; then PACKAGEMANAGER=rpm fi fi if [ ! "$PACKAGEMANAGER" ]; then echo "ERROR: Unsupported or unknown package management system." see_webdocs exit 1 else echo "Configuring for '$PACKAGEMANAGER' package manager." fi echo FETCHCMD="" if [ ! "$FETCHCMD" ]; then FETCHPROG=$(which curl 2>/dev/null) if [ "$FETCHPROG" ]; then FETCHCMD="$FETCHPROG -s $PUBKEYURL" fi fi if [ ! "$FETCHCMD" ]; then FETCHPROG=$(which wget 2>/dev/null) if [ "$FETCHPROG" ]; then FETCHCMD="$FETCHPROG -q -O - $PUBKEYURL" fi fi if [ ! "$FETCHCMD" ]; then FETCHPROG=$(which w3m 2>/dev/null) if [ "$FETCHPROG" ]; then FETCHCMD="$FETCHPROG -dump_source $PUBKEYURL" fi fi if [ ! "$FETCHCMD" ]; then FETCHPROG=$(which links 2>/dev/null) if [ "$FETCHPROG" ]; then FETCHCMD="$FETCHPROG -source $PUBKEYURL" fi fi if [ ! "$FETCHCMD" ]; then FETCHPROG=$(which lynx 2>/dev/null) if [ "$FETCHPROG" ]; then FETCHCMD="$FETCHPROG -source $PUBKEYURL" fi fi if [ ! "$FETCHCMD" ]; then echo "ERROR: Couldn't find a program to use to download signing key." echo "ERROR: Please install wget, curl, w3m, links, or lynx." exit 1 else echo "Using '$FETCHPROG' to download key." fi echo if [ $DRYRUN -eq 0 ]; then $FETCHCMD > $KEYNAME if [ $? -eq 0 ]; then chmod a+r $KEYNAME KEYFILE="$(pwd)/$KEYNAME" else echo "ERROR: Failed to download Google key from $PUBKEYURL." exit 1 fi else # So we have something to print during dry run. KEYFILE="dry-run" fi echo "Key file is '$KEYFILE'." echo case $PACKAGEMANAGER in apt) APTKEYPROG=$(which apt-key 2>/dev/null) # If they don't have apt-key, it's not secure APT, so they can't check # package sigs. if [ ! "$APTKEYPROG" ]; then echo "WARNING: You don't appear to be running a signature-aware version of APT." echo "WARNING: The Google package signing key won't be installed," echo "WARNING: and package downloads won't be validated." echo else queuecmd echo "Installing Google package signing key..." queuecmd -e keyadd_error $APTKEYPROG add "$KEYFILE" fi queuecmd echo "Adding Google repository to APT sources..." DEBLINE="deb $DEBREPO/ stable non-free main" eval `apt-config shell APTBASEDIR "Dir" APTDIRETC "Dir::Etc" APTSOURCELIST "Dir::Etc::sourcelist" APTSOURCELISTD "Dir::Etc::sourceparts"` # Try to keep our customizations separate. if [ "$APTSOURCELISTD" ]; then LISTFILE="$APTBASEDIR$APTDIRETC$APTSOURCELISTD/google.list" writetempfile \ "# Google software repository" \ "$DEBLINE" queuecmd -e "repoconfig_error $LISTFILE" cp -f "$TEMPFILE" "$LISTFILE" queuecmd chmod a+r "$LISTFILE" # Otherwise use the global sources.list. else LISTFILE="$APTBASEDIR$APTDIRETC$APTSOURCELIST" # Don't add it if it's already there. grep -q -s "^$DEBLINE" "$LISTFILE" if [ $? -gt 0 ]; then writetempfile "" \ "# Google software repository" \ "$DEBLINE" queuecmd -e "repoconfig_error $LISTFILE" sh -c "cat '$TEMPFILE' >> '$LISTFILE'" fi fi queuecmd echo "added to '$LISTFILE'" echo # Refresh the index files to make sure our apps show up immediately. queuecmd echo "Syncing repository index..." queuecmd apt-get -qq update ;; yum) configRPM if [ -d "/etc/yum.repos.d" ]; then queuecmd echo "Adding Google repository to YUM configs..." # On x86_64 distro, hardcode the arch of the repository. if [ "$ARCH" = "x86_64" ]; then YUMARCH="i386" else YUMARCH="\$basearch" fi REPOFILE=/etc/yum.repos.d/google.repo writetempfile \ "[google]" \ "name=Google - $YUMARCH" \ "baseurl=$RPMREPO/stable/$YUMARCH" \ "enabled=1" \ "gpgcheck=1" queuecmd -e "repoconfig_error $REPOFILE" cp -f "$TEMPFILE" "$REPOFILE" queuecmd chmod a+r "$REPOFILE" queuecmd echo "created '$REPOFILE'" else echo "WARNING: YUM repository configs not found." echo "WARNING: Google repository will not be added." fi echo ;; yast) # Don't need to do rpm key install separately since yast should find # repomd.xml.asc file automatically. queuecmd echo "Adding Google repository to YaST2 configs..." queuecmd -e "repoapp_error zypper" \ zypper sa -t YUM $RPMREPO/stable/i386 google echo ;; urpmi) # Don't need to do rpm key install separately since urpmi should find pubkey # file automatically. queuecmd echo "Adding Google repository to urpmi configs..." queuecmd -e "repoapp_error urpmi.addmedia" \ urpmi.addmedia google $RPMREPO/stable/i386 with hdlist.cz echo ;; rpm) echo "WARNING: Unable to configure this system to use Google's APT or YUM repositories." echo configRPM ;; esac SHELLCMD="RETVAL=0 ; $ROOTCOMMANDS exit \$RETVAL" # If this isn't a dry run, and we're not root yet, become root to run the # queued commands. if [ "$ROOTCOMMANDS" ] && [ `id -u` != '0' ]; then echo "WARNING: You are not running as root, but repository configuration" echo "WARNING: requires root privileges." echo echo "Attempting to become root..." # Try sudo. Some systems don't have users configured in /etc/sudoers by # default. Mandriva doesn't even install sudo by default. SUDOPRG=$(which sudo 2>/dev/null) if [ "$SUDOPRG" ]; then echo "Trying 'sudo'. Enter your password when prompted." $SUDOPRG -k $SUDOPRG sh -c "$SHELLCMD" res=$? else res=1 fi if [ $res -eq 1 ]; then echo echo "WARNING: Failed to invoke 'sudo'." # Try su. This won't work on systems that don't have a root password by # default (e.g. Ubuntu), but those should have sudo configured by default. echo "Trying 'su'. Enter root's password when prompted." su root -c "$SHELLCMD" res=$? if [ $res -eq 1 ]; then echo echo "ERROR: Could not gain root privileges." echo "ERROR: Please re-run from a root login." exit 1 fi fi # Check if root shell exited with one of our errors. if [ $res -ge $ROOTEXITBASE ]; then handlerooterror $res exit $res fi elif [ "$ROOTCOMMANDS" ]; then sh -c "$SHELLCMD" fi # Cleanup. if [ "$TEMPFILES" ]; then eval "rm $TEMPFILES" fi echo echo "Done."
参考网站;http://code.google.com/p/lpotato/source/browse/trunk/
- google-repo-setup.zip (3.8 KB)
- 下载次数: 5
发表评论
-
Linux 安装记录
2013-05-05 22:15 7971.flash安装 #tar zxvf install_ ... -
SUSE相关
2013-05-03 16:26 657ESXi安装全过程及基本配置http://www.linux ... -
SUSE11安装JDK6
2013-05-03 16:15 8451.首先确认java6是否适合SUSE11系统 登录 ht ... -
SUSE 修改IP
2013-05-03 16:13 983第一种SUSE Linux IP设置方法ifconfig e ... -
Linux 中文乱码
2013-04-03 16:10 6661.Gedit 中文乱码 gsettings set o ... -
关于fedora 17启动时显示cannot open font file true的解决办法
2012-08-12 11:20 932打开/etc/default/grub 文件将GRUB ... -
linux 笔记
2012-06-11 16:56 599linux目录架构/ 根 ... -
linux下find和grep两大重要命令(内含正则表达式的基础部分)
2012-05-28 09:17 1358linux下find和grep命令 ... -
node.js 在linux (fedora 16)上的源码安装
2012-05-25 13:06 8841、源码安装环境 wget http://nod ... -
git 整合apache
2012-03-19 16:09 2124SSH协议私服 适合公司内部小型团队使用的是SSH协议 ... -
Linux 下SVN自动启动脚本
2012-04-27 11:01 15121.创建执行脚本svn.sh(/root路径下),其内容 ...
相关推荐
Fedora 26 chrome 60
这篇博文将指导我们如何在CentOS 6上安装Chrome。由于官方的Chrome浏览器并不直接支持旧版的CentOS,我们需要采取一些额外的步骤来实现安装。 首先,我们需要更新系统的软件包。在终端中输入以下命令来更新yum仓库...
chrome.rpm redhat,fedora,centOs适用,
Chrome是一款由Google公司开发的网页浏览器。该浏览器基于其他开源软件(如WebKit)撰写,目标是提升稳定性、速度和安全。Google Chrome 是一款快速、易用且安全的网络浏览器。此版 Chrome 是专为windows10 64位设计...
然而,对于习惯使用Chrome浏览器的用户来说,可能需要在CentOS上安装这款流行的浏览器。本篇文章将详细介绍如何在CentOS系统中安装Google Chrome。 首先,了解一点背景知识:由于Chrome官方并未直接提供针对CentOS...
最新版的谷歌浏览器的rpm包,适合fedora,opensuse等redhat系列的linux安装,传上来分享给大家!
本篇文章将详细介绍如何在不同的Linux发行版上安装Chrome,包括Ubuntu、Debian、Fedora、CentOS等。 首先,我们需要了解的是,Google Chrome官方并没有在Linux的软件仓库中提供预编译的二进制包,而是提供了.deb...
针对Linux系统的用户,Chrome提供了RPM格式的安装包,适用于Red Hat Enterprise Linux、Fedora、CentOS等基于RPM的发行版。通过RPM包安装Chrome可以确保软件与系统的兼容性,并简化安装过程。 #### 二、Google ...
6. **chrome**:Google Chrome是一款广泛使用的网页浏览器,其在Fedora中的安装通常需要添加额外的软件源,因为官方仓库可能不包含最新版本的Chrome。 【标签】中的"fedora aliyun源 repo文件 dnf"进一步强调了这个...
### 安装Fedora 16后的必要步骤与软件配置 #### 一、概述 本文档将详细介绍在安装Fedora 16操作系统之后,为了更好地适应工作与生活的需要,需要进行的一系列配置与软件安装。这些操作将帮助用户获得一个功能更加...
描述中的"Installation for chrome to centOS"清楚地告诉我们,这个压缩包的目的是为了在CentOS操作系统上安装Chrome浏览器。CentOS是一个基于Linux的开源操作系统,常用于服务器环境,因此这个包对于那些在CentOS...
总的来说,这个压缩包提供了一种在64位Linux环境下安装Google Chrome稳定版的方法,用户需要了解如何在Linux中使用RPM命令或者通过包管理器来完成安装。同时,理解RPM包管理和Linux的文件系统结构对于成功安装和使用...
这个压缩包包含了所有必要的文件,使得用户能够在Linux环境下安装和运行Chrome浏览器。 首先,我们来了解Linux操作系统。Linux是一种自由和开放源代码的操作系统,与Windows和macOS不同,它主要基于Unix。Linux有...
1. "google-chrome-stable-123.0.6312.122-1.x86_64.rpm":这是Google Chrome浏览器的安装包,用于在Linux系统上安装和管理Chrome。 2. "chromedriver-123.0.6312.122-1.fc40.x86_64.rpm":这是Chromedriver的安装包...
12. **安装 Google Chrome**:从Google官方站点下载RPM包,按照指示进行安装。 13. **安装 LibreOffice**:如果没有预装,可以从LibreOffice官网下载并按照说明安装办公套件。 14. **安装 Thunderbird**:`sudo ...
【Fedora 19 办公环境配置与常用软件安装】 Fedora 19 是一款基于 Linux 的操作系统,被广泛认为是一款性能强大的发行版,能够替代传统的Mac或Windows系统。以下是在Fedora 19中进行系统配置和安装常用软件的一些...
google-chrome-stable_current_x86_64.rpm Version 62.0.3202.62 (Official Build) (64-bit) Fedora26 安装方式 #dnf install -y google-chrome-stable_current_x86_64.rpm