修改yum配置使用163源
今天需要使用dbt2来测试数据库,安装一些环境软件时,sohu的源表现的非常不给力,老是说资源不可访问。于是想把yum源改为163。这里有先行之人的文章(http://xiaotanglinux.blog.51cto.com/694236/639423),抄之。
#!/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
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
#****************************************************************#
# 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
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