由于Redhat的yum在线更新是收费的,如果没有注册的话是不能使用的,即不能在线安装软件。所以yum install 命令每次都安装失败

下面介绍一种更改yum源的方式:

系统说明:

系统:Red Hat Enterprise Linux Server 6.3

内核:Linux 2.6.32-279.el6.x86_64

1、删除RHEL原有的yum
     rpm
-aq|grep yum|xargs rpm -e --nodeps  #删除

2、下载新的yum安装包  #这里我们使用CentOS的yum源
       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-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

wget
http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.30-30.el6.noarch.rpm

(提示:如果下载时提示404找不到错误,请访问http://mirrors.163.com/centos/6/os/x86_64/Packages/,手动查找上面四个包,有时候版本会有点小偏差)

3、安装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-60.el6.centos.noarch.rpm   yum-plugin-fastestmirror-1.1.30-30.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文件中即可

(已经修改好,不用下载直接新建CentOS6-Base-163.repo 也     可以)

# 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缓存

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

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

RHEL 6.3使用CentOS yum源 (redhat yum安装失败)的更多相关文章

  1. Centos 7源码编译安装 php7.1 之生产篇

    Centos 7源码编译安装 php7.1 之生产篇 Published 2017年4月30日 by Node Cloud 介绍: 久闻php7的速度以及性能那可是比php5系列的任何一版本都要快,具 ...

  2. RedHat6使用CentOS yum源 换yum

    yum 简单介绍一下 yum 主要功能是更方便的添加/删除/更新RPM 包,自动解决包的倚赖性问题,便于管理大量系统的更新问题. yum 可以同时配置多个资源库(Repository),简洁的配置文件 ...

  3. CentOS 6.4安装本地yum源,并安装X Window System

    1.为DVD创建一个挂载目录 [root@localhost ~]# mkdir /media/CentOS 2.在Linux下挂载CentOS DVD(虚拟机挂载DVD不说了,应该都会) [root ...

  4. docker探索-CentOS7中配置Docker的yum源并升级安装docker1.13(十)

    此处使用的是CentOS7,内核版本为 [root@localhost ~]# uname -r -.el7.x86_64 该版本下,配置了yum的源为阿里的镜像源,具体的配置方法可以参见阿里镜像源配 ...

  5. Linux yum源码包安装和卸载

    Linux 下的绝大多数源码包都是用 C 语言编写的,还有少部分是用 C++ 等其他程序语言编写的.所以,要想安装源码包,必须安装 C 语言编译器 gcc(如果是用 C++ 编写的程序,则还需要安装 ...

  6. Centos-7修改yum源(阿里yum源)

    国外地址yum源下载慢,下到一半就断了,就这个原因就修改它为国内yum源地址 国内yum源: 阿里centos7 yum源:http://mirrors.aliyun.com/repo/Centos- ...

  7. Cent OS 7 本地yum源配置与安装

    一.本地yum源 1.添加一个新的yum源配置文件dvd.repo(文件名字自定义)  vi etc/yum.repos.d     添加新的内容: name=rhel_dvd            ...

  8. 自建yum源及分组安装

    最近在研究一套自动化运维方向的框架,在想到远程安装软件包的时候,觉得有yum支持会更方便一些.主要思路是把程序员写的代码或程序打包成rpm,然后提交到自建yum源,并实现按组安装,本地yum源实现步骤 ...

  9. centos 7 源码包安装、卸载nginx

    1.源码包安装之前,首页安装依赖包 yum -y install gcc gcc-c++ make libtool zlib zlib-devel openssl openssl-devel pcre ...

  10. CentOS7.2+MySQL5.7_ yum源方式_ 安装配置教程

    1)访问mysql官方网站 #访问网站 https://dev.mysql.com/downloads/file/?id=470281 2)下载安装包到linux #进入文件存放路径 cd /usr/ ...

随机推荐

  1. 【转】ubuntu下putty的复制粘贴 -- 不错

    原文网址:http://www.nwber.com/?p=165 今天在ubutnu下想用putty玩玩,突然发现在windows里直接点击右键的复制居然不管用了,调设置也没有用.这可麻烦了,要是手动 ...

  2. Word Search II 解答

    Question Given a 2D board and a list of words from the dictionary, find all words in the board. Each ...

  3. 剑指offer-面试题6.重建二叉树

    题目:输入某二叉树的前序遍历和中序遍历结果,请重建出该二叉树.假设 输入的前序遍历和中序遍历的结果都不含重复的数字.例如输入前序遍历 序列{1,2,4,7,3,5,6,8}和中序遍历序列{4,7,2, ...

  4. LeeCode-Linked List Cycle

    Given a linked list, determine if it has a cycle in it. /** * Definition for singly-linked list. * s ...

  5. python多线程同步

    python多线程同步 作者:vpoet 日期:大约在夏季 import threading import time mylock = threading.RLock() num=0 class my ...

  6. Linux 时间定时同步操作

    Yum –y install ntp安装时钟同步服务加入开机启动Chkcongfig ntpd on添加自动校对时间,每十分钟校对一次Crontab –e */10 * * * * /usr/sbin ...

  7. Easy Number Challenge(暴力,求因子个数)

    Easy Number Challenge Time Limit:2000MS     Memory Limit:262144KB     64bit IO Format:%I64d & %I ...

  8. hpux操作系统的关机与重新启动命令

    关机  shutdown -hy 0 重新启动: shutdown -ry 0

  9. Failed to create the Java Virtual Machine (Myeclipse或者eclipse启动报错)

    把某几个值改为原来的0.5倍就ok了(我就这么解决的)   eclipse.ini如下:   -startupplugins/org.eclipse.equinox.launcher_1.2.0.v2 ...

  10. java 成神之路

    一.基础篇 1.1 JVM 1.1.1. Java内存模型,Java内存管理,Java堆和栈,垃圾回收 http://www.jcp.org/en/jsr/detail?id=133 http://i ...