redhat配置centos的yum源

redhat默认不支持第三方的yum源,要求有rhn账号,下面就rhel5和rhel6改为centos源

一、rhel5.5 X86_64更改为centos的yum源

查看系统自带的yum相关的rpm包

 rpm -qa|grep yum

删掉系统自带的yum相关的包

rpm -e --nodeps yum-updatesd-0
rpm -e --nodeps yum-security  
rpm -e --nodeps yum-metadata-p
rpm -e --nodeps yum-rhn-plugin

安装163yum包,三个yum包有依赖关系,需要一起安装

wget  http://mirrors.163.com/centos/5/os/x86_64/CentOS/python-iniparse-0.2.3-6.el5.noarch.rpm    
wget http://mirrors.163.com/centos/5/os/x86_64/CentOS/yum-fastestmirror-1.1.16-21.el5.centos.noarch.rpm
wget          
wget 
rpm -ivh python-iniparse-0.2.3-6.el5.noarch.rpm  
rpm -ivh  yum-fastestmirror-1.1.16-21.el5.centos.noarch.rpm yum-3.2.22-40.el5.centos.noarch.rpm yum-metadata-parser-1.1.2-4.el5.x86_64.rpm

在/etc/yum.repos.d下将原有的repo文件重命名,新建一个Base.repo

[base]
name=Red Hat Enterprise Linux $releasever - Base
baseurl=http://mirror.centos.org/centos/5/os/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
 
#released updates
[updates]
name=Red Hat Enterprise Linux $releasever - Updates
baseurl=http://mirror.centos.org/centos/5/updates/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
 
#packages used/produced in the build but not released
[addons]
name=Red Hat Enterprise Linux $releasever - Addons
baseurl=http://mirror.centos.org/centos/5/addons/$basearch/
pgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
 
#additional packages that may be useful
[extras]
name=Red Hat Enterprise Linux $releasever - Extras
baseurl=http://mirror.centos.org/centos/5/extras/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
 
#additional packages that extend functionality of existing packages
[centosplus]
name=Red Hat Enterprise Linux $releasever - Plus
baseurl=http://mirror.centos.org/centos/5/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
 
#contrib - packages by Centos Users
[contrib]
name=Red Hat Enterprise Linux $releasever - Contrib
baseurl=http://mirror.centos.org/centos/5/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

这里也可以使用mirrors.163.com或者mirrors.aliyun.com的yum源, rhel6则以163yum源为例,导入key

rpm --import http://mirror.centos.org/centos/5/os/x86_64/RPM-GPG-KEY-CentOS-5

生成缓存

yum clean all
yum makecache

如果配置成功则会提示加载成功

二、redhat6.4 X86_64更改为centos的yum源

删除原有的yum相关的rpm包

 rpm -qa|grep yum
 rpm -e --nodeps yum-rhn-plugin
 rpm -e --nodeps yum-metadata-parser
 rpm -e --nodeps yum-utils
 rpm -e --nodeps yum-plugin-security
 rpm -e --nodeps rhn-check

下载安装包并安装

mkdir -p /server/tools
 cd /server/tools/
 wget http://mirrors.163.com/centos/6/os/x86_64/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm
 wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-3.2.29-69.el6.centos.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-plugin-fastestmirror-1.1.30-30.el6.noarch.rpm
  rpm -ivh python-iniparse-0.3.1-2.1.el6.noarch.rpm 
 rpm -ivh yum-3.2.29-69.el6.centos.noarch.rpm yum-metadata-parser-1.1.2-16.el6.x86_64.rpm yum-plugin-fastestmirror-1.1.30-30.el6.noarch.rpm

重命名原有自带的repo文件,并下载163的repo文件

 cd /etc/yum.repos.d/
 mv rhel-source.repo rhel-source.repo.bak
 wget http://mirrors.163.com/.help/CentOS6-Base-163.repo
 rpm --import http://mirrors.163.com/centos/6/os/x86_64/RPM-GPG-KEY-CentOS-6
 sed -i ‘s#$releasever#6#g‘ CentOS6-Base-163.repo

清空缓存,并重新生成

 yum clean all
 yum makecache

如果配置阿里的yum源,则可以加入如下命令

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo

至此rhel6配置centos源配置完成

时间: 2024-08-04 03:03:20

redhat配置centos的yum源的相关文章

redhat配置centos网络yum源

方案一: 配置网络yum源rpm -ivh vsftpd-2.2.2-6.el6_0.1.x86_64service vsftpd restartchkconfig --level 35 vsftpd oncd /var/ftp/pub/mkdir yum把上面的挂载点改成/var/ftp/pub/yumvim /etc/yum.repos.d/rhel-source.repo[server]name=serverbaserul=ftp://pub/yum/Server/  #(注意要挂载光驱)

Redhalt配置Centos的yum源 详细步骤

  大家都应该都清楚,redhalt 刚装完系统之后的yum是不好使的,有时我们像安装vsftp 这样的软件时用yum安装很方便.为此我们需要利用centos的yum源进行配置.现在这个源更新速度很快. 这是网易的资源总库http://mirror.centos.org/.里面应有尽有.废话不多说: 具体安装步骤: 1.删除redhat原有的yum源 # rpm -aq | grep yum|xargs rpm -e –nodeps 2.重新从网上获取yum的安装包  以root登陆到redha

Red Hat Enterprise Linux 6配置CentOS的yum源

前言: 由于使用redhat官方yum源需要注册购买server服务,否则就会提示注册,或者根本找不到rehat的源.但是CentOS是redhat的免费版,除了log和一些无关紧要的东西,其他都是一样的.甚至kernel源代码都是一样的.所以我们可以使用CentOS的yum源代替redhat的yum源. <<<<< <<<<<<<本文笔者亲测成功>>>>>>>>>>>

RedHat采用CentOS的yum源

第一步:备份原有的repo文件,养成良好的习惯 mv rhel-source.repo  rhel-source.repo.bak 第二步:下载最新的CentOS-Base.repo到/etc/yum.repos.d wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo 第三步:替换$releasever为6 vi /etc/yum.repos.d/CentOS-Base.re

linux配置centos的yum源本地仓库搭建

1.放置iso文件,并挂载iso文件,永久挂载,修改/etc/fstab参考:https://blog.csdn.net/qq_36119192/article/details/82222175#%E4%B8%80%EF%BC%9A%E9%85%8D%E7%BD%AE%E6%9C%AC%E5%9C%B0yum%E6%BA%90或者搜索:Linux配置yum源(本地源和网络源) - 谢公子的博客 2.到该目录/etc/yum.repos.d删除所有文件rm -rf *,并创建base.repo [

[转载]Redhat Enterprise 6.1 如何使用免费的CentOS的yum源

Redhat Enterprise 6.1 如何使用免费的CentOS的yum源 graybull posted @ 2013年2月18日 22:29 in Unix/Linux with tags centos free redhat Source yum , 3938 阅读 Redhat Enterprise Linux 6.1 x86_64 使用官方yum源是需要收费的,本文将讲解如何使用免费的CentOS的yum源来安装/更新软件.分成以下几步: 卸载已有的yum 下载CentOS的yu

redhat 系统和centos系统配置yum 源的几种方法

          红帽或centos系统配置yum源 本地配置yum 源:光驱仓库,ISO仓库(一般适用于红帽linux,(因为它没有配不然怎么收钱)或者没有联网的centos系统, (都是配好的网源,只要可以联网就可以进行yum操作)) 文档带图片链接    http://pan.baidu.com/s/1c2G6Xyg    (https://yunpan.cn/Oc6mzj4mLwgDzC  访问密码 d35c ) 一.虚拟机中有光驱(虚拟机中光盘的位置)挂载的情况: (1)找到光驱的位

Redhat 7 yum源换成centos的YUM 源

背景:作者打算在Redhat 做kvm虚拟化的时候在安装 virt-manager发现 提示要注册红帽的yum源,简单说要钱呗.要钱那是不可能给你的,所以有以下有centos的yum源替换redhat7的yum源. 前景概括(步骤总结) 卸载原有的yum的rpm包 去阿里镜像站下载centos必要的yum包 rpm -ivh yum- 安装相对应的rpm 去阿里镜像站下载 centos-base.repo,并修改 清楚yum缓存,再重新生成缓存 测试 使用 yum -y install xxx

CentOS 6.* 配置本地网络 yum源

CentOS 6.* 配置本地网络yum源 一台服务时只需要配一个本地的yum源即可:当需要配置多台服务器时,只需要配置1到2台vsftpd的yum源,其它服务器通过ftp连接yum源: 1 基于本地文件的yum源 1.1 下载镜像源 wget -b https://mirrors.aliyun.com/centos/6.10/isos/x86_64/CentOS-6.10-x86_64-bin-DVD1.iso tail -100f wget-log 1.2 挂载iso镜像文件 ll /mnt