存档

文章标签 ‘RHEL6.3使用yum’

RHEL6.3中yum使用CentOS源

2012年10月18日 没有评论

RHEL在未注册的情况下,是不能使用yum的。经过测试,以下步骤可以使用CentOS6.3的源在RHEL6.3中使用yum。

1. 删除RHEL6.3自带的yum:

# rpm -qa | grep yum | xargs rpm -e --nodeps

2.下载和安装CentOS6.3的yum:

# export DLPATH='http://centos.ustc.edu.cn/centos/6.3/os/x86_64/Packages'
# wget $DLPATH/yum-3.2.29-30.el6.centos.noarch.rpm
# wget $DLPATH/yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
# wget $DLPATH/yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm
# rpm -ivh *.rpm

3.重命名rhel-source.repo, 并生成新的CentOS-Base.repo

# cd /etc/yum.repos.d/
# mv rhel-source.repo rhel-source.repo.bak

# vim CentOS-Base.repo
## 以下为CentOS-Base.repo文本
[base]
name=CentOS-6 - Base
baseurl=http://centos.ustc.edu.cn/centos/6.3/os/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

#released updates
[update]
name=CentOS-6 - Updates
baseurl=http://centos.ustc.edu.cn/centos/6.3/updates/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

[extras]
name=CentOS-6 - Extras
baseurl=http://centos.ustc.edu.cn/centos/6.3/extras/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
#
[centosplus]
name=CentOS-6 - Plus
baseurl=http://centos.ustc.edu.cn/centos/6.3/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
#
##contrib - packages by Centos Users
[contrib]
name=CentOS-6 - Contrib
baseurl=http://centos.ustc.edu.cn/centos/6.3/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
#

4. 可以使用yum了,如使用yum安装lynx和gcc

# yum install lynx
# yum install gcc
分类: 科技 标签: