redhat yum源安装与配置

YUM是RedhatLinux在线安装更新及软件的工具,但是这是RHEL5的收费功能,如果没有购买Redhat的服务时不能使用RHEL5的更新源的,会提示注册。

由于CentOS是从Redhat演化而来的免费Linux版本,因此可以利用CentOS的yum更新源来实现RHEL5的YUM功能。配置方法如下:

检查yum是否安装,默认情况下都是安装好的,总共4各包。

[root@linux-a~]#rpm-qa|grepyum

yum-metadata-parser-1.0-8.fc6

yum-3.0.1-5.el5

yum-rhn-plugin-0.4.3-1.el5

yum-updatesd-3.0.1-5.el5

配置yum更新源

创建/etc/yum.repos.d/CentOS-Base.repo文件,定义yum更新源,这里使用的是上海交大的CentOS更新源

[root@linux-a~]#vi/etc/yum.repos.d/CentOS-Base.repo

[base]

name=CentOS-5-Base

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

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

baseurl=http://ftp.sjtu.edu.cn/centos/5/os/$basearch/

gpgcheck=0

gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5

#releasedupdates

[update]

name=CentOS-5-Updates

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

baseurl=http://ftp.sjtu.edu.cn/centos/5/updates/$basearch/

gpgcheck=0

gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5

#packagesused/producedinthebuildbutnotreleased

[addons]

name=CentOS-5-Addons

#mirrorlist=http://mirrorlist.centos.org/?release=4&arch=$basearch&repo=addons

baseurl=http://ftp.sjtu.edu.cn/centos/5/addons/$basearch/

gpgcheck=0

gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5

#additionalpackagesthatmaybeuseful

[extras]

name=CentOS-5-Extras

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

baseurl=http://ftp.sjtu.edu.cn/centos/5/extras/$basearch/

gpgcheck=0

gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5

#additionalpackagesthatextendfunctionalityofexistingpackages

[centosplus]

name=CentOS-5-Plus

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

baseurl=http://ftp.sjtu.edu.cn/centos/5/centosplus/$basearch/

gpgcheck=0

enabled=0

gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5

#contrib-packagesbyCentosUsers

[contrib]

name=CentOS-5-Contrib

#mirrorlist=http://mirrorlist.centos.org/?release=4&arch=$basearch&repo=contrib

baseurl=http://ftp.sjtu.edu.cn/centos/5/contrib/$basearch/

gpgcheck=0

enabled=0

gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5

#vidag.repo

[dag]

name=DagRPMRepositoryforRHEL5

baseurl=http://ftp.riken.jp/Linux/dag/redhat/el5/en/$basearch/dag/

enabled=1

gpgcheck=0

gpgkey=http://ftp.riken.jp/Linux/dag/packages/RPM-GPG-KEY.dag.txt

导入key

[root@linux-a~]#rpm--importhttp://ftp.sjtu.edu.cn/centos/5/os/i386/RPM-GPG-KEY-CentOS-5

运行YUM,测试

[root@linux-a~]#yuminstallxmms-mp3

Loading"installonlyn"plugin

Loading"rhnplugin"plugin

ThissystemisnotregisteredwithRHN.

RHNsupportwillbedisabled.

SettingupInstallProcess

Settinguprepositories

Readingrepositorymetadatainfromlocalfiles

Parsingpackageinstallarguments

ResolvingDependencies

-->Populatingtransactionsetwithselectedpackages.Pleasewait.

--->Packagexmms-mp3.i3861:1.2.10-16.el5.rfsettobeupdated

-->Runningtransactioncheck

-->ProcessingDependency:libglib-1.2.so.0forpackage:xmms-mp3

-->ProcessingDependency:libgdk-1.2.so.0forpackage:xmms-mp3

-->ProcessingDependency:libgthread-1.2.so.0forpackage:xmms-mp3

-->ProcessingDependency:libgmodule-1.2.so.0forpackage:xmms-mp3

-->ProcessingDependency:libgtk-1.2.so.0forpackage:xmms-mp3

-->ProcessingDependency:libxmms.so.1forpackage:xmms-mp3

-->RestartingDependencyResolutionwithnewchanges.

-->Populatingtransactionsetwithselectedpackages.Pleasewait.

--->Packagexmms.i3861:1.2.10-14.el5.rfsettobeupdated

--->Packageglib.i3861:1.2.10-20.el5settobeupdated

--->Downloadingheaderforgtk+topackintotransactionset.

gtk+-1.2.10-56.el5.i386.r100%|=========================|25kB00:00

--->Packagegtk+.i3861:1.2.10-56.el5settobeupdated

-->Runningtransactioncheck

-->ProcessingDependency:libmikmod.so.2forpackage:xmms

-->ProcessingDependency:gdk-pixbuf>=0.18.0forpackage:gtk+

-->RestartingDependencyResolutionwithnewchanges.

-->Populatingtransactionsetwithselectedpackages.Pleasewait.

--->Downloadingheaderforgdk-pixbuftopackintotransactionset.

gdk-pixbuf-0.22.0-25.el5.100%|=========================|16kB00:00

--->Packagegdk-pixbuf.i3861:0.22.0-25.el5settobeupdated

--->Downloadingheaderformikmodtopackintotransactionset.

mikmod-3.1.6-38.1.i386.rp100%|=========================|7.7kB00:00

--->Packagemikmod.i3860:3.1.6-38.1settobeupdated

-->Runningtransactioncheck

DependenciesResolved

=============================================================================

PackageArchVersionRepositorySize

=============================================================================

Installing:

xmms-mp3i3861:1.2.10-16.el5.rfdag179k

Installingfordependencies:

gdk-pixbufi3861:0.22.0-25.el5base231k

glibi3861:1.2.10-20.el5base137k

gtk+i3861:1.2.10-56.el5base923k

mikmodi3863.1.6-38.1base201k

xmmsi3861:1.2.10-14.el5.rfdag2.3M

TransactionSummary

=============================================================================

Install6Package(s)

Update0Package(s)

Remove0Package(s)

Totaldownloadsize:3.9M

Isthisok[y/N]:

本文转自:http://blog.chinaunix.net/uid-20729583-id-2972852.html