Rhel 5 升级为centos 5 并配置 yum源

我的电脑平台是dell的d620,安装了rehhat5 client 和windows xp双系统。

但是感觉rhel 5 使用本地源更新设置比较繁琐,而且不能更新到最新的包。

在网上搜到了一篇相关的帖子,便按照指导安装并成功。记录下安装过程。

以便备用。

1.配置yum

先把RHEL5自带的yum包删除,rpm -qa | grep yum,出来4个包,全部rpm -e 掉,还有一个RedHat-release,这个要—nodeps。然后从CentOS.ermly.com/centos/5.1/os/下载CentOS的4个与yum有关的包及centos-release-5-0.0安装。安装后的包如下

yum-metadata-parser-1.0-8.fc6

yum-3.0.5-1.el5.centos.5

yum-updatesd-3.0.5-1.el5.centos.5

修改yum的配置文件,vi /etc/yum.repos.d/CentOS-Base.repo

# CentOS-Base.repo

#

# This file uses a new mirrorlist system developed by Lance Davis for CentOS.

# The mirror system uses the connecting IP address of the client and the

# update status of each mirror to pick mirrors that are updated to and

# geographically close to the client.  You should use this for CentOS updates

# unless you are manually picking other mirrors.

#

# If the mirrorlist= does not work for you, as a fall back you can try the

# remarked out baseurl= line instead.

#

#

[base]

name=CentOS-5.1 - Base

baseurl=http://mirror.tini4u.net/centos/5.1/os/$basearch/

$basearch/

$basearch/

$basearch/

$basearch/

$basearch/

gpgcheck=1

gpgkey=http://centos.ermly.com/centos/5.1/os/i386/RPM-GPG-KEY-CentOS-5

#released updates

[updates]

name=CentOS-5.1 - Updates

baseurl=http://mirror.tini4u.net/centos/5.1/os/$basearch/

$basearch/

$basearch/

$basearch/

$basearch/

$basearch/

gpgcheck=1

gpgkey=http://centos.ermly.com/centos/5.1/os/i386/RPM-GPG-KEY-CentOS-5

#packages used/produced in the build but not released

[addons]

name=CentOS-5.1 - Addons

baseurl=http://mirror.tini4u.net/centos/5.1/os/$basearch/

$basearch/

$basearch/

$basearch/

$basearch/

$basearch/

gpgcheck=1

gpgkey=http://centos.ermly.com/centos/5.1/os/i386/RPM-GPG-KEY-CentOS-5

#additional packages that may be useful

[extras]

name=CentOS-5.1 - Extras

baseurl=http://mirror.tini4u.net/centos/5.1/os/$basearch/

$basearch/

$basearch/

$basearch/

$basearch/

$basearch/

gpgcheck=1

gpgkey=http://centos.ermly.com/centos/5.1/os/i386/RPM-GPG-KEY-CentOS-5

#additional packages that extend functionality of existing packages

[centosplus]

name=CentOS-5.1 – Plus

baseurl=http://mirror.tini4u.net/centos/5.1/os/$basearch/

$basearch/

$basearch/

$basearch/

$basearch/

$basearch/

gpgcheck=1

enabled=0

gpgkey=http://centos.ermly.com/centos/5.1/os/i386/RPM-GPG-KEY-CentOS-5

#contrib - packages by Centos Users

[contrib]

name=CentOS-5.1 - Contrib

baseurl=http://mirror.tini4u.net/centos/5.1/os/$basearch/

$basearch/

$basearch/

$basearch/

$basearch/

$basearch/

gpgcheck=1

enabled=0

gpgkey=http://centos.ermly.com/centos/5.1/os/i386/RPM-GPG-KEY-CentOS-5

为了保证源的可用性,我添加了多个国内的centos源。

导入rpm包的GPG密钥

rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY*

3. Update

在终端下面执行yum -y update。遇到网速不好,重试几次,可以完全下载,共有538M之多。此时提示与redhat-logos冲突,继续rpm -e -nodeps redhat-logos,再次yum -y update,这时Updating, CleanUp, Complete!

4.修复gdm登录界面

重启后已经可以看到RHEL5改头换面成CentOS了,但是到gdm登录界面时提示出错,意为找不到gdm的相关主题。没关系,可以登录,只不过界面难看一点。进入Gnome桌面后,登录下载一个自己喜欢的gdm logo theme. 在终端输入gdmsetup,把刚才下载的tar.gz拖到对话框中安装,再把默认的Redhat删除就OKay了!

5.加快你的yum的速度.

使用yum的扩展插件yum-fastestmirror,个人认为这个插件非常有效,速度真的是明显提高, #yum -y install yum-fastestmirror

注意,在Centos 4上,名字叫yum-plugin-fastestmirror

6.扩展你的rpm包

好多包官方没有,怎么搞定他.要我自己编译吗?

好了,你安装这个包,这个是redhat5的哦。你可以自己到

#B

这来找

rpm -Uhv

技巧3:rpm查找.

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/05e0b33475d9b4a9d2d397216e7fc8fd.html