歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
您现在的位置: Linux教程網 >> UnixLinux >  >> Linux綜合 >> Red hat Linux

RHEL6.5系統默認不支持yum源,將紅帽系統的yum源改成CentOS的yum源,可以免費使用

rhel6.5配置yum源步驟:
1.到 http://mirrors.163.com/centos/6/os/x86_64/Packages/下載三個yum的安裝包;
yum-plugin-fastestmirror-1.1.30-30.el6.noarch.rpm
yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
yum-3.2.29-60.el6.centos.noarch.rpm
2.將三個安裝包同時進行安裝;
3.下線http://mirrors.163.com/.help/CentOS6-Base-163.repo,拷貝到/etc/yum.repo.d/下;
4.將CentOS6-Base-163.repo中所有的$releasever替換中6,sed -i 's/$releasever/6/g' CentOS6-Base-163.repo;
5.yum clean all、yum makecache、yum update。
具體命令和腳本如下:
#!/bin/bash
cp /etc/yum.repos.d/*.repo /etc/yum.repos.d/*.repo.bak
rpm -qa | grep yum|xargs rpm -e --nodeps
ls dd || mkdir dd
cd dd
wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.30-30.el6.noarch.rpm
wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-3.2.29-60.el6.centos.noarch.rpm
rpm -ivh yum*
wget http://mirrors.163.com/.help/CentOS6-Base-163.repo
cp CentOS6-Base-163.repo /etc/yum.repo.d/
cd /etc/yum.repo.d/
sed -i 's/$releasever/6/g' CentOS6-Base-163.repo
yum clean all
yum makecache
yum update
本文出自 “汪立明” 博客,請務必保留此出處http://80cto.blog.51cto.com/7503144/1791641
Copyright © Linux教程網 All Rights Reserved