1. 首页 > ITPUX技术网 > 正文

一键替换RHEL yum

#/bin/bash
tmpdir=`mktemp -d`
cd $tmpdir
rpm -qa |grep yum |xargs rpm -ev –nodeps
wget [url]http://mirrors.aliyun.com/centos/6.5/os/x86_64/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm
wget [url]http://mirrors.aliyun.com/centos/6.5/os/x86_64/Packages/yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
wget [url]http://mirrors.aliyun.com/centos/6.5/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm
wget [url]http://mirrors.aliyun.com/centos/6.5/os/x86_64/Packages/yum-3.2.29-40.el6.centos.noarch.rpm
rpm –import [url]http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-6
rpm -ivh python-*
rpm -ivh yum-*
cd ..
rm -fr $tmpdir
cd /etc/yum.repos.d/
tar cfvz repo.tar.gz * –remove-files
wget -O /etc/yum.repos.d/CentOS-Base.repo [url]http://mirrors.aliyun.com/repo/Centos-6.repo
sed -i “s/\$releasever/6/g” /etc/yum.repos.d/CentOS-Base.repo
yum clean all
yum makecache
exit

本文由风哥教程整理发布,仅用于学习测试使用,转载注明出处:http://www.fgedu.net.cn/10327.html

联系我们

在线咨询:点击这里给我发消息

微信号:itpux-com

工作日:9:30-18:30,节假日休息