让centos使用国内163源

#!/bin/sh
#****************************************************************#
# ScriptName: yum_update.sh
# Author: baoqing.guobq
# Create Date: 2011-07-21
# Modify Author: 
# Modify Date: 2011-07-21
# Function: 
#***************************************************************#
mv /etc/yum.repos.d/rhel-debuginfo.repo /etc/yum.repos.d/rhel-debuginfo.repo.bak
rpm -e --nodeps yum-security-1.1.16-13.el5
rpm -e --nodeps yum-metadata-parser-1.1.2-2.el5
rpm -e --nodeps yum-3.2.19-18.el5
rpm -e --nodeps yum-updatesd-0.9-2.el5
rpm -e --nodeps yum-rhn-plugin-0.5.3-30.el5
rpm -ivh http://mirrors.163.com/centos/5/os/x86_64/CentOS/python-iniparse-0.2.3-4.el5.noarch.rpm &&
rpm -ivh http://mirrors.163.com/centos/5/os/x86_64/CentOS/yum-fastestmirror-1.1.16-14.el5.centos.1.noarch.rpm --nodeps &&
rpm -ivh http://mirrors.163.com/centos/5/os/x86_64/CentOS/yum-metadata-parser-1.1.2-3.el5.centos.x86_64.rpm &&
rpm -ivh http://mirrors.163.com/centos/5/os/x86_64/CentOS/yum-3.2.22-33.el5.centos.noarch.rpm &&
cd /etc/yum.repos.d/
wget http://mirrors.163.com/centos/5/os/x86_64/RPM-GPG-KEY-CentOS-5
rpm --import RPM-GPG-KEY-CentOS-5 &&
wget http://mirrors.163.com/.help/CentOS-Base-163.repo -O /etc/yum.repos.d/CentOS-Base.repo &&
sed -i 's/\$releasever/5/g' /etc/yum.repos.d/CentOS-Base.repo
yum update

 

 

其他源:

中科大的yum源:
wget http://mirrors.ustc.edu.cn/centos/CentOS-Base.5.mirrors.repo

163的yum源:
wget http://mirrors.163.com/.help/CentOS-Base-163.repo

sohu的yum源
wget http://mirrors.sohu.com/help/CentOS-Base-sohu.repo

 

你可能感兴趣的:(yum,script)