RHEL5.x配置YUM 从centos5源更新

卸载rhel自带yum

rpm -aq|grep yum|xargs rpm -e --nodeps

安装Centos yum后请按照以下步骤修改CenOS-Base.repo


cd /etc/yum.repos.d
mv CentOS-Base.repo CentOS-Base.repo.save
wget http://centos.ustc.edu.cn/CentOS-Base.repo -O /etc/yum.repos.d/CentOS-Base.repo
 

Step 1:修改/etc/yum.repos.d/CentOS- Base.repo为:

# CentOS-Base.repo
#
# 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-$releasever - Base - 163.com
mirrorlist=http://mirrorlist.centos.org/?release=5.5&arch=$basearch&repo=os
baseurl=http://mirrors.163.com/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5#released updates
[updates]
name=CentOS-$releasever - Updates - 163.com
mirrorlist=http://mirrorlist.centos.org/?release=5.5&arch=$basearch&repo=updates
baseurl=http://mirrors.163.com/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5#packages used/produced in the build but not released
[addons]
name=CentOS-$releasever - Addons - 163.com
mirrorlist=http://mirrorlist.centos.org/?release=5.5&arch=$basearch&repo=addons
baseurl=http://mirrors.163.com/centos/$releasever/addons/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras - 163.com
mirrorlist=http://mirrorlist.centos.org/?release=5.5&arch=$basearch&repo=extras
baseurl=http://mirrors.163.com/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus - 163.com
mirrorlist=http://mirrorlist.centos.org/?release=5.5&arch=$basearch&repo=centosplus
baseurl=http://mirrors.163.com/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib - 163.com
mirrorlist=http://mirrorlist.centos.org/?release=5.5&arch=$basearch&repo=contrib
baseurl=http://mirrors.163.com/centos/$releasever/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5# CentOS-OSCAR.repo
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#[oscar]
name=CentOS-$releasever - OSCAR
baseurl=http://bison.csm.ornl.gov/repos/rhel-5-x86_64
gpgcheck=0

#########

#Centos4

########

[base]
name=CentOS-4 - Base
baseurl=http://mirrors.163.com/centos/4/os/i386/
gpgcheck=1
#released updates
[update]
name=CentOS-4 - Updates
baseurl=http://mirrors.163.com/centos/4/updates/i386/
gpgcheck=1
#packages used/produced in the build but not released
[addons]
name=CentOS-4 - Addons
baseurl=http://mirrors.163.com/centos/4/addons/i386/
gpgcheck=1
#additional packages that may be useful
[extras]
name=CentOS-4 - Extras
baseurl=http://mirrors.163.com/centos/4/extras/i386/
gpgcheck=1
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-4 - Plus
baseurl=http://mirrors.163.com/centos/4/centosplus/i386/
gpgcheck=1
enabled=0
#contrib - packages by Centos Users
[contrib]
name=CentOS-4 - Contrib
baseurl=http://mirrors.163.com/centos/4/contrib/i386/
gpgcheck=1
enabled=0
#packages in testing
[testing]
name=CentOS-4 - Testing
baseurl=http://mirrors.163.com/centos/4/testing/i386/
gpgcheck=1
enabled=0
 

Step 2:(跳过)

64位: rpm --import http://mirrors.163.com/centos/5/os/x86_64/RPM-GPG-KEY-CentOS-5
64位: rpm --import http://ftp.sjtu.edu.cn/centos/5.4/os/x86_64/RPM-GPG-KEY-CentOS-5
32位: rpm --import http://ftp.sjtu.edu.cn/centos/5.4/os/i386/RPM-GPG-KEY-CentOS-5

附国内开源镜像

http://mirrors.xmu.edu.cn/centos/

http://mirrors.163.com/centos/

Step 3:yum update

yum clean all 清除缓存及旧的包

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

你可能感兴趣的:(status,System,yum,卸载,Address)