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

rhel配置163、epel、rpmforge的yum源

时间:2015-12-04 16:24:30      阅读:138      评论:0      收藏:0      [点我收藏+]

标签:

2015-12-04

#!/bin/bash
### AUTHOR: Leo
### DATE: 2015/12/4
### NAME:yum.sh
### DESC:rhle配置yum仓库
#备份原有的repo文件
cd /etc/yum.repos.d && mkdir bak && mv *.repo bak
#卸载rhel的yum命令
rpm -aq | grep yum|xargs rpm -e --nodeps
#下载centos的yum命令安装包
wget http://mirrors.163.com/centos/6.7/os/x86_64/Packages/yum-3.2.29-69.el6.centos.noarch.rpm
wget http://mirrors.163.com/centos/6.7/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.30-30.el6.noarch.rpm
wget http://mirrors.163.com/centos/6.7/os/x86_64/Packages/yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
wget http://mirrors.163.com/centos/6.7/os/x86_64/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm
#安装centos的yum命令
rpm -ivh python-iniparse-0.3.1-2.1.el6.noarch.rpm
rpm -ivh yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
rpm -ivh yum-3.2.29-69.el6.centos.noarch.rpm    yum-plugin-fastestmirror-1.1.30-30.el6.noarch.rpm
#下载安装163、epel、rpmforge的repo文件
wget http://mirrors.163.com/.help/CentOS6-Base-163.repo
wget http://mirrors.opencas.cn/epel/epel-release-latest-6.noarch.rpm
wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm
rpm -ivh epel-release-latest-6.noarch.rpm
rpm -ivh rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm
#设置系统版本号为6
echo 6 > /etc/yum/vars/releasever
#清除旧的yum缓存,并生成新缓存
yum clean all && yum makecache
ls -hl

 

rhel配置163、epel、rpmforge的yum源

标签:

原文地址:http://www.cnblogs.com/cenliang/p/5019618.html

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