引言:CentOS自带的yum源中rpm包数量有限,很多时候找不到我们需的软件包,(例如:要安装网络连接查看软件iftop,默认设置下无法使用yum命令安装),下面教大家在CentOS 6.2中(以32位系统为例,64位系统安装方法一样),使用第三方yum源来安装更多软件包。

一、安装CentOS yum源优先级插件yum-priorities

yum install yum-priorities   #输入y安装

二、设置CentOS默认yum源的优先级为最高系统运维  www.osyunwei.com  温馨提醒:qihang01原创内容©版权所有,转载请注明出处及原文链接

cd  /etc/yum.repos.d/   #进入yum源目录

vi CentOS-Base.repo    #在[base]、[updates]、[extras]组下面添加priority=1,在[centosplus]、[contrib]组下面添加priority=2

################################################################

[base]

name=CentOS-$releasever - Base

mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os

#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

priority=1

[updates]

name=CentOS-$releasever - Updates

mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates

#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

priority=1

[extras]

name=CentOS-$releasever - Extras

mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras

#baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

priority=1

[centosplus]

name=CentOS-$releasever - Plus

mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus

#baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/

gpgcheck=1

enabled=0

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

priority=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

enabled=0

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

priority=2

###############################################################

备注:priority的优先级为1到99,设置为1即优先级最高,1-10为系统保留,第三方yum源的优先级从11-99

三、安装epel yum源

rpm -ivh  http://download.fedora.redhat.com/pub/epel/6/i386/epel-release-6-5.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=Extra Packages for Enterprise 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=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6

priority=11

#################################################################

四、安装rpmforge yum源

wget http://apt.sw.be/redhat/el6/en/i386/rpmforge/RPMS/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]

name = RHEL $releasever - RPMforge.net - dag

baseurl = http://apt.sw.be/redhat/el6/en/$basearch/rpmforge

mirrorlist = http://apt.sw.be/redhat/el6/en/mirrors-rpmforge

#mirrorlist = file:///etc/yum.repos.d/mirrors-rpmforge

enabled = 1

protect = 0

gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmforge-dag

gpgcheck = 1

priority=12

#################################################################

系统运维  www.osyunwei.com  温馨提醒:qihang01原创内容©版权所有,转载请注明出处及原文链接

五、安装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源优先级,priority=13

#################################################################

[rpmfusion-free-updates-testing]

name=RPM Fusion for EL 6 - Free - Test Updates

#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

系统运维  www.osyunwei.com  温馨提醒:qihang01原创内容©版权所有,转载请注明出处及原文链接

#################################################################

六、安装atomic yum源

wget http://www.atomicorp.com/installers/atomic  #下载

sh ./atomic   #安装

vi  /etc/yum.repos.d/atomic.repo  #修改atomic yum源优先级,priority=14

##############################################################

[atomic]

name = CentOS / Red Hat Enterprise Linux $releasever - atomicrocketturtle.com

mirrorlist = http://www.atomicorp.com/mirrorlist/atomic/centos-6-$basearch

#mirrorlist = http://www.atomicorp.com/channels/atomic/centos/6/mirrors-atomic

enabled = 1

priority = 1

protect = 0

gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY.art.txt

gpgcheck = 1

priority=14

##############################################################

七、更新yum软件包

yum check-update

八、安装iftop

yum install iftop

至此,CentOS 第三方yum源配置完成,现在你可以用yum命令安装自己需要的软件了!比如yum install nginx、yum update php等安装或者升级软件包。备注:以下两个第三方yum源可以使用

rpm -Uvh http://mirrors.ustc.edu.cn/fedora/epel/6/i386/epel-release-6-8.noarch.rpm

rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

yum --enablerepo=remi install php

######################################################################################扩展阅读:在使用yum update php命令升级php的同时,mysql也被升级到了最新版,升级好之后重启mysql,有可能会出现下面的错误信息,导致mysql启动失败。

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

解决方法(切记,操作前,一定备份mysql数据库):

rm -fr /var/lib/mysql/*      #删除目录

rm /var/lock/subsys/mysqld   #删除目录

killall mysqld   #结束mysql进程

service mysqld start  #启动mysql

/etc/rc.d/init.d/mysqld status   #查看mysql状态

mysql_secure_installation  #重置Mysql数据库密码

#####################################################################################

centos php rpm下载源,CentOS 6.2 使用第三方yum源安装更多rpm软件包 | 系统运维相关推荐

  1. linux 的手机操作系统下载地址,Linux系统运维之下载Linux操作系统地址

    本文主要向大家介绍了Linux系统运维的下载Linux操作系统地址,通过具体的内容向大家展现,希望对的大家学习Linux运维知识有所帮助. 有很多初次接触Linux的新人都会发问,应该到哪里下载Lin ...

  2. RedHat / Centos   Linux 系统运维与管理实践技巧荟萃,持续更新

    RedHat / Centos   Linux  系统运维与管理实践技巧荟萃 磁盘分区相关  Linux  fdisk 磁盘分区工具以及安装 GRUB 实战: 准备工作,前置知识 演示环境基于 cen ...

  3. linux服务器 硬盘安装教程,硬盘安装CentOS 6.0(超级详细图文教程) | 系统运维...

    引言: 电脑系统是Windows XP,电脑没有光驱.手头没有U盘.没有移动硬盘.电脑主板不支持U盘启动,在这种情况下想安装CentOS 6.0,有木有办法? 答案:有办法,请看下面教程! 必备工具: ...

  4. kickstart自动化系统安装_系统运维|基于Kickstart自动化安装CentOS实践

    前言 因为需要在浪潮的x86服务器中集中部署CentOS搭建基于Hadoop的大数据平台,平时接触SLES(SuSE Linux Enterprise Server)较多并且已经实现基于Autoyas ...

  5. Linux为什么无法进入文件,Linux系统运维之CentOS下提示“无法打开并写入文件”问题解决...

    当前是root用户,去编辑/etc/ssh/sshd_config 却提示没有权限修改.报错如"/etc/ssh/sshd_config" E212: 无法打开并写入文件. 问题思 ...

  6. 第三方yum源rpmforge

    概述:rpmforge是Dag.Dries 和其它软件包的组合.它们为 CentOS 提供了超过10000个软件包.rpmforge不是redhat Linux产品或 CentOS 的组成部分,但它是 ...

  7. 【YUM】第三方yum源rpmforge

    rpmforge是Dag.Dries 和其它软件包的组合.它们为 CentOS 提供了超过10000个软件包.rpmforge不是redhat Linux产品或 CentOS 的组成部分,但它是为这些 ...

  8. redhat7 scl 源_Linux RedHat 7 配置本地 YUM源

    尽管RPM安装方法能够帮助用户查询软件相关的依赖关系,但是还是需要安装人员自己来解决,而且有些大型软件可能与数十个程序都有依赖关系,在这种情况下安装软件事件非常痛苦和耗费事件的事情,而Yum软件仓库可 ...

  9. Linux(CentOS7.1)修改默认yum源为国内的阿里云yum源

    官方的yum源在国内访问效果不佳. 需要改为国内比较好的阿里云或者网易的yum源 修改方式: 下载wget yum install wget -y echo 备份当前的yum源 mv /etc/yum ...

最新文章

  1. windows socket编程入门示例3
  2. netty源码分析系列——EventLoop
  3. C++ 之类的静态成员
  4. 无惧秋招,您的NLP算法工程师魔鬼训练计划请查收
  5. 笔算除法 c语言,《两、三位数除以一位数,笔算》
  6. 基于TCP协议实现通信
  7. python和C语言分别实现插入排序
  8. 机器学习十大经典算法之岭回归和LASSO回归
  9. linux rpm找不到命令_linux书后习题(4-9章不全) - lijinli
  10. java api 版本控制_API 版本控制的几种方式
  11. 《SAP从入门到精通》——1.3 SAP R/3系统工作原理
  12. 微信小程序授权登录(获取微信头像并显示)
  13. qunee for html5,Qunee for HTML5(二)
  14. Gram矩阵计算实例
  15. Jupyter notebook 运行时出现 “服务似乎挂掉了,但是会立刻重启的”
  16. 如何利用BERT做文本摘要
  17. undefined is not a function错误解决
  18. 如何用python做数据分析实战_10分钟实战python简单数据分析
  19. 国外EDU教育邮箱功能简介
  20. #Windows server 2019将辅助域控升级为主域控

热门文章

  1. 手机访问www如何自动跳转到m js代码实现
  2. 马斯克:我是Rust粉丝,但我选择C
  3. 百度智能云知识中台,驱动产业智能化升级
  4. 2021 re:Invent ,我们到底该关注哪些发布?
  5. 亚马逊“不香了”,高管为何频繁离职?
  6. 微软 Azure 再下一城:收购 Kinvolk,改进开源 Linux
  7. 面试官:如何评估一个线程池需要设置多少个线程
  8. 每天只睡 4 小时!大佬们都这么拼吗?
  9. 腾讯与老干妈达成和解;传苹果将停掉 MacBook Air 产品线;VS Code 1.47 发布| 极客头条...
  10. 前字节跳动程序员 28 岁提前退休引热议,网友:我也想!