ITPub博客

首页 > Linux操作系统 > Linux操作系统 > RHEL5的yum安装配置

RHEL5的yum安装配置

原创 Linux操作系统 作者:os-ora 时间:2010-10-22 12:39:52 0 删除 编辑
经常使用CentOS,已经很习惯它自带的yum,由于工作需要用到rhel(Red Hat Enterprise Linux),尽管CentOS和rhel具有同样的内核,但rhel默认并不支持(YUM是Redhat Linux在线安装更新及软件的工具,但是这是RHEL5的收费功能,如果没有购买Redhat的服务时不能使用RHEL5的更新源的,会提示注册)。由于CentOS是从Redhat演化而来的免费Linux版本,因此可以利用CentOS的yum更新源来实现RHEL5的YUM功能:

###一、建立yum安装包目录,并进入到该目录:
mkdir /usr/local/src/yum-packages (个人习惯将安装文件统一放在/usr/local/src/目录)
cd /usr/local/src/yum-packages
wget http://mirror.centos.org/centos-5/5/os/i386/CentOS/python-iniparse-0.2.3-4.el5.noarch.rpm
wget http://mirrors.sohu.com/centos/5.5/os/i386/CentOS/yum-3.2.22-26.el5.centos.noarch.rpm
wget http://mirrors.sohu.com/centos/5.5/os/i386/CentOS/yum-metadata-parser-1.1.2-3.el5.centos.i386.rpm
 
###三、先安装python环境:
rpm -ivh python-iniparse-0.2.3-4.el5.noarch.rpm

###四、安装所有的yum包:
rpm -ivh yum-3.2.22-26.el5.centos.noarch.rpm yum-metadata-parser-1.1.2-3.el5.centos.i386.rpm yum-fastestmirror-1.1.16-14.el5.centos.1.noarch.rpm

###五、下载配置文件
wget http://centos.ustc.edu.cn/CentOS-Base.repo  -O /etc/yum.repos.d/CentOS-Base.repo
还有一个源(http://sudone.com/download/CentOS-Base.repo )

###六、执行
yum update
 
修改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=1
gpgkey=
http://mirror.centos.org/centos/RPM-GPG-KEY-centos5

#released updates
[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=1
gpgkey=
http://mirror.centos.org/centos/RPM-GPG-KEY-centos5

#packages used/produced in the build but not released
[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=1
gpgkey=
http://mirror.centos.org/centos/RPM-GPG-KEY-centos5

#additional packages that may be useful
[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=1
gpgkey=
http://mirror.centos.org/centos/RPM-GPG-KEY-centos5

#additional packages that extend functionality of existing packages
[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=1
enabled=0
gpgkey=
http://mirror.centos.org/centos/RPM-GPG-KEY-centos5

#contrib - packages by Centos Users
[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=1
enabled=0
gpgkey=
http://mirror.centos.org/centos/RPM-GPG-KEY-centos5
 
执行安装
[root@bogon yum-packages]# yum install postfix
报如下错误
Total download size: 3.7 M
Is this ok [y/N]: y               
Downloading Packages:
postfix-2.3.3-2.1.el5_2.x86_64.rpm                                               | 3.7 MB     02:17    
warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID e8562897

GPG key retrieval failed: [Errno 14] HTTP Error 404: Not Found
(注意:这里都是32位的)
再次安装成功

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/16566331/viewspace-676536/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2010-01-12

  • 博文量
    148
  • 访问量
    410401