将RedHat的yum更换为CentOS的yum
Posted stephen-blog
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了将RedHat的yum更换为CentOS的yum相关的知识,希望对你有一定的参考价值。
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的主要内容,如果未能解决你的问题,请参考以下文章