RHEL6.4更改为CentOS6.4的yum源

阅读更多
mv /etc/yum.repos.d/*.repo  /etc/yum.repos.d/*.repo.bak
# 删除原有的yum包
rpm -qa | grep yum|xargs rpm -e --nodeps

# 下载CentOS的yum安装包
ftp://mirror.switch.ch/pool/4/mirror/scientificlinux/6.5/x86_64/os/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm
ftp://ftp.is.co.za/mirror/smeserver/releases/testing/9.0beta4/smeos/x86_64/Packages/yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
ftp://ftp.muug.mb.ca/mirror/centos/6.5/os/i386/Packages/yum-3.2.29-40.el6.centos.noarch.rpm
ftp://ftp.sunet.se/pub/Linux/distributions/scientific/6.3/x86_64/os/Packages/yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm

# 安装yum包
rpm -ivh python-iniparse-0.3.1-2.1.el6.noarch.rpm
rpm -ivh yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
rpm -ivh  yum-3.2.29-40.el6.centos.noarch.rpm  yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm

# 添加163的yum源
cd /etc/yum.repos.d
wget http://mirrors.163.com/.help/CentOS6-Base-163.repo
sed -i 's/\$releasever/6/g' CentOS6-Base-163.repo

# 清理yum缓存
yum clean all

# 将服务器上的软件包信息缓存到本地,以提高速度
yum makecache

[root@youxin80 tmp]# yum makecache
Loaded plugins: fastestmirror, product-id, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Loading mirror speeds from cached hostfile
base                                                     | 3.7 kB     00:00    
extras                                                   | 3.4 kB     00:00    
updates                                                  | 3.4 kB     00:00    
updates/filelists_db                                     | 1.9 MB     00:01    
updates/prestodelta                                      | 282 kB     00:00    
updates/other_db                                         |  26 MB     00:04    
Metadata Cache Created

注:
6.4默认python版本为2.6,如果安装新版本python,则需修改/usr/bin/yum:
vi /usr/bin/yum
将第一行 #!/usr/bin/python 修改为 #!/usr/bin/python2.6

你可能感兴趣的:(RHEL6.4更改为CentOS6.4的yum源)