<font style="vertical-align: inherit;"><font style="vertical-align: inherit;">CentOS使用第三方yum源安装rpm多个</font></font>

一,安装CentOS  yum源优先级插件yum优先级
      yum  install  yum优先级   #输入y安装
二,设置CentOS yum源的优先级为最高
     cd   /etc/yum.repos.d/#   进入yum源目录
     vi  CentOS- Base.repo     #在[base],[更新],[extras]组下面添加priority = 1,在[centosplus],[contrib]组下面添加priority = 2
############ ######################################### ##    
[基]
名称= CentOS- $ releasever  - 基本
它的镜像就是列表= HTTP://mirrorlist.centos.org/释放= $ releasever与ARCH = $ basearch及回购= OS
#的的BaseURL = HTTP://mirror.centos.org/centos/ $ releasever /操作系统/ $ basearch /
gpgcheck = 1
gpgkey =文件:/// etc / pki / rpm-gpg / RPM-GPG-KEY-CentOS-6
优先级= 1

[更新]
名称= CentOS- $ releasever  - 更新
镜像列表= HTTP://mirrorlist.centos.org/释放= $ releasever与ARCH = $ basearch及回购=更新
#的BaseURL = HTTP://mirror.centos.org/centos/$releasever / updates / $ basearch /
gpgcheck = 1
gpgkey = file:/// etc / pki / rpm-gpg / RPM-GPG-KEY-CentOS-6
优先级= 1

[额外]
名称= CentOS- $ releasever  - 额外
镜像列表= HTTP://mirrorlist.centos.org/释放= $ releasever与ARCH = $ basearch及回购=额外
#的BaseURL = HTTP://mirror.centos.org/centos/$releasever / extras / $ basearch /
gpgcheck = 1
gpgkey = file:/// etc / pki / rpm-gpg / RPM-GPG-KEY-CentOS-6
优先级= 1

[centosplus]
名称= CentOS- $ releasever  - 加
镜像列表= HTTP://mirrorlist.centos.org/释放= $ releasever与ARCH = $ basearch及回购= centosplus
#的BaseURL = HTTP://mirror.centos.org/centos/$releasever / centosplus / $ basearch /
gpgcheck = 1
启用= 0
gpgkey =文件:/// etc / pki / rpm-gpg / RPM-GPG-KEY-CentOS-6
优先级= 2

[contrib]
name = CentOS- $ releasever  -  Contrib
mirrorlist = http://mirrorlist.centos.org/?release = $ releasever&arch = $ basearch&repo = contrib
#baseurl = http://mirror.centos.org/centos/$releasever / contrib / $ basearch /
gpgcheck = 1
启用= 0
gpgkey =文件:/// etc / pki / rpm-gpg / RPM-GPG-KEY-CentOS-6
优先级= 2
########### ############################################### ##   
备注:priority的优先级为1至99,设置为1即优先级最高,1-10为系统保留,第三方yum源的优先级从11-99
三,安装epel  yum源
    rpm  -ivh  http: //mirrors.ustc.edu.cn/fedora/epel/6/x86_64/epel-release-6-7.noarch.rpm
     rpm  --import  / etc / pki / rpm-gpg / RPM-GPG-KEY-EPEL- 6
    vi /etc/yum.repos.d/epel.repo#   修改epel  yum源优先级,priority = 11
   
############################ ####################################
    [EPEL]
NAME =额外 的软件包 为 企业 Linux的 6  -  $ basearch
#baseurl =
http://download.fedoraproject.org/pub/epel/6/$basearch mirrorlist = https://mirrors.fedoraproject.org/metalink?repo = epel-6&arch = $ basearch
failovermethod = priority
enabled = 1
gpgcheck = 1
gpgkey =文件:/// etc / pki / rpm-gpg / RPM-GPG-KEY-EPEL-6
优先级= 11
##################### ###########################################
四,安装rpmforge  yum源
rpm  -ivh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.i686.rpm

wget  http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt
    rpm  --import  RPM-GPG-KEY.dag.txt
   rpm  -ivh  rpmforge-release-0.5.2-2。 el6.rf.i686.rpm
   vi   /etc/yum.repos.d/rpmforge.repo#  修改rpmforge  yum源优先级,priority = 12
  
#################### ##############################################
[rpmforge软件]
名称 =  RHEL  $ releasever  -  RPMforge.net  -  dag
baseurl  =  http://apt.sw.be/redhat/el6/en/$basearch/rpmforge
镜像列表 =  http://apt.sw.be/redhat/el6/en/ mirrors-rpmforge
镜像列表 = 
启用 =  1
保护 =  0
gpgkey  = 
gpgcheck  =  1
优先级= 12
################################### ###############################
五,安装rpmfusion  yum源
   rpm  -ivh  http://download1.rpmfusion.org/free/ el / updates / testing / 6 / i386 / rpmfusion-free-release-6-0.1.noarch.rpm
    vi   /etc/yum.repos.d/rpmfusion-free-updates-testing.repo#   修改rpmfusion  yum源优先级,优先级= 13
 
################################### ##################
[rpmfusion-free-updates-testing]
name = RPM  Fusion  for  EL  6 - 免费 - 测试 更新
#baseurl =
http://download1.rpmfusion.org/free/el/updates/testing/6/$basearch/mirrorlist=http://mirrors.rpmfusion.org/mirrorlist?repo = free-el -updates-testing-6&arch = $ basearch
enabled = 1
gpgcheck = 1
gpgkey = file:/// etc / pki / rpm-gpg / RPM-GPG-KEY-rpmfusion-free-el-6
priority = 13
#### ############################################### ###########
六,安装atomic  yum源
    wget  http://www.atomicorp.com/installers/atomic#  下载
    sh  ./atomic#   安装
    vi   /etc/yum.repos.d/atomic .repo   #修改atomy  yum源优先级,priority = 14
############################################### ############
[原子]
名称 = 的CentOS  / 红 红帽 企业 Linux的 $ releasever  -  atomicrocketturtle.com
镜像列表 =  http://www.atomicorp.com/mirrorlist/atomic/centos-6-$ basearch
#mirrorlist  =  http://www.atomicorp.com/channels/atomic/centos/6/mirrors-atomic已
启用 =  1
优先级 =  1
保护 =  0
gpgkey  = 
gpgcheck  =  1
优先级= 14
############################################### ###########
七,更新yum后端
       yum  check-update
八,安装iftop
       yum  install  iftop
至此,CentOS 第三方yum源配置完成,现在你可以用yum命令安装自己需要的软件了!比如百胜 安装 nginx的,百胜 更新 PHP等安装或者升级软件包。
################################# ###################################
   扩展阅读:
   在使用yum  update  php命令升级php的同时ERROR  2002  (HY000): 无法 通过 套接字 连接 到 本地 MySQL 服务器 ,因此,mysql也被升级到了最新版,升级好之后重启mysql,有可能会出现下面
   的错误信息,导致mysql启动失败。
   '/var/lib/mysql/mysql.sock'(2  )
   解决方法(切记,操作前,一定备份mysql数据库):
   rm  -fr  / var / lib / mysql / *       #删除目录
   rm  / var / lock / subsys / mysqld    #删除目录
   killall  mysqld    #结束mysql进程
   服务 mysqld  start   #启动mysql
   /etc/rc.d/init.d/mysqld  status    #查看mysql状态
   mysql_secure_installation   #重置Mysql数据库密码
########## ############################################### ###########

本文来自:系统运维  www.osyunwei.com

(0)

相关推荐