Tag: rpm
-
Centos利用第三方yum源安装rpm软件包
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 – Basemirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/gpgcheck=1gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6priority=1 [updates]name=CentOS-$releasever – Updatesmirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/gpgcheck=1gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6priority=1 [extras]name=CentOS-$releasever – Extrasmirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras#baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/gpgcheck=1gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6priority=1 [centosplus]name=CentOS-$releasever – Plusmirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus#baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/gpgcheck=1enabled=0gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6priority=2 [contrib]name=CentOS-$releasever – Contribmirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib#baseurl=http://mirror.centos.org/centos/$releasever/contrib/$basearch/gpgcheck=1enabled=0gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6priority=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/$basearchmirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearchfailovermethod=priorityenabled=1gpgcheck=1gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6priority=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 …