Skip to content

Instantly share code, notes, and snippets.

@cnsoft
Created June 5, 2013 03:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cnsoft/5711351 to your computer and use it in GitHub Desktop.
Save cnsoft/5711351 to your computer and use it in GitHub Desktop.
yum update with 163 mirror site.
#!/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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment