快速Redhat AS4和AS5升级至Centos系统

Redhat AS4和AS5的机器,升级和安装rpm包,需要License,平时经常需要安装和编译软件包,升级到Centos系统能够方便不少!

查看当前系统版本号
# less /etc/redhat-release
 
检查系统已安装的组件包中是否已存在Redhat的自带的yum系列组件包
# su root
# rpm -qa | grep yum
 
如果存在请逐一全部删除
# rpm -e --nodeps 组件包名称
 
建立Centos专用目录,然后下载并安装Centos系统的yum系列组件包
 
下载Centos升级组件包(注:根据RedHat AS5操作)
 
RedHat AS5:
 
 
注意,如果是x64的,需要把上面URL中的i386改为x86_64
安装Centos升级组件包
# su root
# rpm -Uvh --nodeps *.rpm
 
导入Centos升级组件授权(注:根据RedHat AS5操作)
RedHat AS5:
# rpm --import .../RPM-GPG-KEY-CentOS-5   (...表示文件所在路径)
 
创建并编辑yum升级源配置文件
# su root
# mkdir -p /etc/yum.repos.d/
# vi /etc/yum.repos.d/CentOS-Base.repo
粘贴以下内容覆盖文件:
RedHat AS5:

 

[base]

name=CentOS-$releasever - Base

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

gpgcheck=1

gpgkey=http://centos.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-5

 

#released updates

[update]

name=CentOS-$releasever - Updates

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

gpgcheck=1

gpgkey=http://centos.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-5

 

#packages used/produced in the build but not released

[addons]

name=CentOS-$releasever - Addons

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

gpgcheck=1

gpgkey=http://centos.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-5

 

#additional packages that may be useful

[extras]

name=CentOS-$releasever - Extras

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

gpgcheck=1

gpgkey=http://centos.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-5

 

#additional packages that extend functionality of existing packages

[centosplus]

name=CentOS-$releasever - Plus

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

gpgcheck=1

enabled=0

gpgkey=http://centos.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-5

 

#contrib - packages by Centos Users

[contrib]

name=CentOS-$releasever - Contrib

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

gpgcheck=1

enabled=0

gpgkey=http://centos.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-5

 
核对后保存并退出
 
开始升级系统
# yum update
等待系统列出需要升级的组件清单并按”y”确认
Total download size: 334 M
Is this ok [y/n]: y

Complete!
等待全部组件下载完成后,重新启动服务器,操作系统升级完毕!

 

【转自】http://blog.csdn.net/xiaolong85/article/details/5658040

 

你可能感兴趣的:(centos)