码迷,mamicode.com
首页 > 其他好文 > 详细

将RedHat的yum更换为CentOS的yum

时间:2019-04-01 11:48:22      阅读:198      评论:0      收藏:0      [点我收藏+]

标签:echo   centos6   lse   fail   centos   centos6.8   dep   redhat   led   

CentOS6.8

脚本:  

#安装yum所需的包已经下载到本地

#!/bin/bash
rpm -qa | grep yum | xargs rpm -e --nodeps
rm -rf /etc/yum.conf
rm -rf /etc/yum.repos.d/*
rpm -ivh python-iniparse-0.3.1-2.1.el6.noarch.rpm
rpm -ivh python-urlgrabber-3.9.1-11.el6.noarch.rpm
rpm -ivh yum-metadata-parser-1.1.2-16.el6.x86_64.rpm yum-plugin-fastestmirror-1.1.30-41.el6.noarch.rpm yum-3.2.29-81.el6.centos.noarch.rpm
cd /etc/yum.repos.d/
wget http://mirrors.aliyun.com/repo/Centos-6.repo
sed -i ‘s/$releasever/6/g‘ /etc/yum.repos.d/Centos-6.repo
yum clean all
yum makecache
yum repolist
if [ $? = 0 ];then
   echo "successful"
   else
   echo "failed"
fi

将RedHat的yum更换为CentOS的yum

标签:echo   centos6   lse   fail   centos   centos6.8   dep   redhat   led   

原文地址:https://www.cnblogs.com/Stephen-blog/p/10635372.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!