有好多朋友使用linux redhat版本是不是还在为rpm包的安装而烦恼,yum工具的使用无意是解决这一难题的好工具,他可以解决包安装中依赖问题,但是对于redhat版本的系统来说如果想使用yum的在线安装功能是需要银子的,那有没有在redhat下不要银子就可以使用yum呢,回答是肯定的可以使用,我们可以借助于centos系统开源包来给我们的yum工具做相应配置就可以使用了。
配置如下:

由于Redhat的yum在线更新是收费的,如果没有注册的话是不能使用的,即不能在线安装软件。在这种情况下,想使用Redhat系统,还想用yum源来在线安装软件,有没有办法?

  答案是有办法,请往下看!

1、删除redhat原有的yum源

# rpm -aq | grep yum|xargs rpm -e --nodeps

2、下载新的yum安装包 

  这里我们使用CentOS的yum源

# wget http://mirror.centos.org/centos/6/os/x86_64/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm

# wget http://mirror.centos.org/centos/6/os/x86_64/Packages/yum-metadata-parser-1.1.2-16.el6.i686.rpm

# wget http://mirror.centos.org/centos/6/os/x86_64/Packages/yum-3.2.29-40.el6.centos.noarch.rpm

# wget http://mirror.centos.org/centos/6/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm

3、安装yum软件包

# rpm -ivh  python-iniparse-0.3.1-2.1.el6.noarch.rpm

# rpm -ivh  yum-metadata-parser-1.1.2-14.1.el6.i686.rpm

# rpm -ivh  yum-3.2.27-14.el6.centos.noarch.rpm  yum-plugin-fastestmirror-1.1.26-11.el6.noarch.rpm

  注意:最后两个安装包要放在一起同时安装,否则会提示相互依赖,安装失败。

4、更改yum源  #我们使用网易的CentOS镜像源

# cd /etc/yum.repos.d/

# wget  http://mirrors.163.com/.help/CentOS6-Base-163.repo

# vi CentOS6-Base-163.repo

编辑文件,把文件里面的$releasever全部替换为版本号,即6 最后保存!或者直接把下面的内存拷贝到CentOS6-Base-163.repo文件中即可(已经修改好)

:%s/$releasever/6/g

#########################################################################

# CentOS-Base.repo

#

# The mirror system uses the connecting IP address of the client and the

# update status of each mirror to pick mirrors that are updated to and

# geographically close to the client.  You should use this for CentOS updates

# unless you are manually picking other mirrors.

#

# If the mirrorlist= does not work for you, as a fall back you can try the

# remarked out baseurl= line instead.

#

#

[base]

name=CentOS-6 - Base - 163.com

baseurl=http://mirrors.163.com/centos/6/os/$basearch/

#mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=os

gpgcheck=1

gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

#released updates

[updates]

name=CentOS-6 - Updates - 163.com

baseurl=http://mirrors.163.com/centos/6/updates/$basearch/

#mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=updates

gpgcheck=1

gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

#additional packages that may be useful

[extras]

name=CentOS-6 - Extras - 163.com

baseurl=http://mirrors.163.com/centos/6/extras/$basearch/

#mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=extras

gpgcheck=1

gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

#additional packages that extend functionality of existing packages

[centosplus]

name=CentOS-6 - Plus - 163.com

baseurl=http://mirrors.163.com/centos/6/centosplus/$basearch/

#mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=centosplus

gpgcheck=1

enabled=0

gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

#contrib - packages by Centos Users

[contrib]

name=CentOS-6 - Contrib - 163.com

baseurl=http://mirrors.163.com/centos/6/contrib/$basearch/

#mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=contrib

gpgcheck=1

enabled=0

gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

#########################################################################

5、清理yum缓存

# yum clean all

# yum makecache     #将服务器上的软件包信息缓存到本地,以提高搜索安装软件的速度

# yum install vim*    #测试域名是否可用

  至此,Redhat6可以使用CentOS的yum源在线安装软件了!

二、本地yum源配置
1、挂载iso文件
#mount -t iso9660 /dev/cdrom /mnt/iso/
2、修改yum配置文件
#vi /etc/yum.repo.d/iso
===============
[base]
name=locale
baseurl=file:///mnt/iso/Server
enabled=1  ---开启本地更新模式
gpgcheck=1
===============
redhat-6
====================================
[Server]
name=Server
baseurl=file:///mnt/cdrom/Server
enabled=1
gpgcheck=0
[HighAvailability]
name=HighAvailability
baseurl=file:///mnt/cdrom/HighAvailability
enabled=1
gpgcheck=0
[LoadBalancer]
name=LoadBalancer
baseurl=file:///mnt/cdrom/LoadBalancer
enabled=1
gpgcheck=0

[LoadBalancer]
name=LoadBalancer
baseurl=file:///mnt/cdrom/LoadBalancer
enabled=1
gpgcheck=0

3、清理缓存
#yum clean all
注意:报错处理

在Redhat Linux下用yum安装rpm时有时候会出现下面错误导致安装失败
warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID*****

这是由于yum安装了旧版本的GPG keys造成的,解决办法是可以运行下面命令:
$ sudo rpm --import /etc/pki/rpm-gpg/RPM* 

在redhat6下配置yum源的使用的更多相关文章

  1. RedHat Enterprise Linux下配置yum源(尝试过的可行方案)

    转自:http://bbs.51cto.com/thread-861410-1.html 一.在linux 6.1中本地yum源配置:首先编辑yum源配置文件我们可以再这个目录中新创建一个配置文件,v ...

  2. Linux下配置yum源为阿里云或网易的详解

    一.yum源概述 yum需要一个yum库,也就是yum源.默认情况下,CentOS就有一个yum源.在/etc/yum.repos.d/目录下有一些默认的配置文件(可以将这些文件移到/opt下,或者直 ...

  3. linux下配置yum源

    备份原yum源   /etc/yum.repos.d/centos一base.repo 下载yum源       wagt 源网址/源名称/etc/yum.repos.d/原yum名

  4. REDHAT6.2配置yum源(64位)(转载)

    From:http://www.dedecms8.com/db/php_bc/12322.html 1.删除redhat原有的yum rpm -aq|grep yum|xargs rpm -e --n ...

  5. 日常工作问题解决:redhat6.9--解决yum功能不能正常使用和配置yum源

    1.问题描述 解决RedHat6.9下yum功能不能用问题: 在redhat6.9下使用yum安装时,会提示:This system is not registered to Red Hat Subs ...

  6. vbox虚拟机配置Redhat6.4本地yum源

    作为一个新手,配置这个yum源配了4天,遇到了各种问题,也按照网络上面一些方法在163上面下载CentOS6的yum源来替换Redhat本地的yum源,但是配置过程中,出现很多错误,发现直接在本地配置 ...

  7. linux配置yum源

    yum(全称为 Yellow dog Updater, Modified)是一个在Fedora和RedHat以及SUSE中的Shell前端软件包管理器.基於RPM包管理,能够从指定的服务器自动下载RP ...

  8. redhat6 改 centos yum 源

    **redhat的yum在线更新是收费的,如果没有注册的话不能使用,如果要使用,需将redhat的yum卸载后,重启安装其他yum源,再配置其他源.** 本文包括配置本地源及第三方源.第三方源包括:网 ...

  9. RHEL 7.0 本地配置yum源

    RHEL 7.0 本地配置yum源  yum简介  yum = Yellow dog Updater, Modified 主要功能是更方便的添加/删除/更新RPM包. 它能自动解决包的倚赖性问题. 它 ...

随机推荐

  1. [转]C,C++开源项目中的100个Bugs

    [转]C,C++开源项目中的100个Bugs http://tonybai.com/2013/04/10/100-bugs-in-c-cpp-opensource-projects/ 俄罗斯OOO P ...

  2. input checkbox问题和li里面包含checkbox

    <input type="checkbox" id="checkbox1"/> $("input#checkbox1").cli ...

  3. Linux 启动参数介绍

    Linux 启动参数介绍 取自2.6.18 kernel Documentation/i386/boot.txt 文件中介绍 vga= 这里的不是一个整数(在C语言表示法中,应是十进制,八进制或者十六 ...

  4. ERP 实施和应用不成功共同点

    ERP 实施和应用不成功共同点     ERP 重新得到人们理性的关注并不意味着实施和应用ERP变得轻而易举了.如何才能实施好ERP?这仍然是关键的问题. 大部份企业应用ERP不成功的原因是什么,许多 ...

  5. 【转】Mac不能复制拷贝写入文件到移动硬盘,U盘怎么办 |

    原文网址:http://jingyan.baidu.com/article/a3aad71aa1dde7b1fb0096ab.html 有的小伙伴把移动硬盘或 U 盘接入到 Mac 电脑上,当把文件拷 ...

  6. linux下passwd命令设置修改用户密码

    1.passwd 简单说明: 我们已经学会如何添加用户了,所以我们还要学习设置或修改用户的密码:passwd命令的用法也很多,我们只选如下的几个参数加以说明:想了解更多,请参考man passwd或p ...

  7. HDU-1036 Average is not Fast Enough!

    Average is not Fast Enough! http://acm.hdu.edu.cn/showproblem.php?pid=1036 Problem Description A rel ...

  8. [Tommas] SQL 中 WITH AS 的用法

    WITH AS短语,也叫做子查询部分(subquery factoring),可以让你做很多事情,定义一个SQL片断,该SQL片断会被整个SQL语句所用到: 下面的例子定义了一个 Temp 片段,Te ...

  9. lua部分 tips

    lua文件刷新 function require_ex( _mname ) if _mname == "" then return end if package.loaded[_m ...

  10. Web---myAjax(自己写底层)-隐藏帧技术

    讲解网站一般都有的一个功能,就是注册时候的,实现验证用户名是否存在的功能. 源代码演示: reg.jsp: <%@ page language="java" import=& ...