1.首先查看redhat 7.0系统本身所安装的那些yum 软件包:

  rpm -qa | grep yum              #列出所有已安装的yum包

2.删除这些包:

  rpm -e *.rpm --nodeps            #删除所有以前的yum包

3.下载新的yum rpm包:(2016/12/8 最新版本rpm,如果404 NOT FOUND错误,自己进去网址,换成最新的rpm包的名字)

  wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-3.4.3-132.el7.centos.0.1.noarch.rpm

  wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm

  wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-utils-1.1.31-34.el7.noarch.rpm

  wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-updateonboot-1.1.31-34.el7.noarch.rpm

  wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-34.el7.noarch.rpm

4.安装下载的rpm包:

  rpm -ivh yum-*

5.配置CentOS-Base.repo:(2016/12/8 最新源网址配置)

  vim /etc/yum.repos.d/CentOS-Base.repo

  [base]
  name=CentOS-7-Base
  baseurl=http://mirrors.sohu.com/centos/7/os/x86_64/
  gpgcheck=1
  #released updates
  [updates]
  name=CentOS-7- Updates
  baseurl=http://mirrors.163.com/centos/7/updates/x86_64/
  gpgcheck=1
  gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7
  #packages used/produced in the build but not released
  [addons]
  name=CentOS-7- Addons
  baseurl=http://mirrors.163.com/centos/7/sclo/x86_64/sclo/
  gpgcheck=1
  gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7
  #additional packages that may be useful
  [extras]
  name=CentOS-7- Extras
  baseurl=http://mirrors.163.com/centos/7/extras/x86_64/
  gpgcheck=1
  gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7
  #additional packages that extend functionality of existing packages
  [centosplus]
  name=CentOS-7- Plus
  baseurl=http://mirrors.163.com/centos/7/centosplus/x86_64/
  gpgcheck=1
  enabled=0

6.yum源配置完成:

  yum clean all

7.测试yum是否成功:

  yum update python

  报错:You have enabled checking of packages via GPG keys. This is a good thing. However, you do not have any GPG public keys installed. You need to download the keys for packages you wish to install and install them. You can do that by running the command.

  rpm --import public.gpg.key

  .........

  经查,是key的错误,解决方法是:

  cd /etc/pki/rpm-gpg/

  ls                        #列出所有密钥

  导入以 release 结尾的密钥

  rpm --import RPM-GPG-KEY-redhat-legacy-release

8.经测试,yum成功:

  yum update python               #顺利使用yum

rhel 7.0 配置centos yum源(2016/12/8),成功!的更多相关文章

  1. RHEL 6.0使用CentOS yum源

    引言:由于RHEL的yum在线更新是收费的,如果没有注册的话是不能使用的,即不能在线安装软件.在这种情况下,想使用RHEL系统,还想用yum源来在线安装软件,有没有办法?答案是有办法,请往下看! 1. ...

  2. RHEL6配置CentOS yum源

    RHEL6配置CentOS yum源

  3. RHEL 6.3使用CentOS yum源 (redhat yum安装失败)

    由于Redhat的yum在线更新是收费的,如果没有注册的话是不能使用的,即不能在线安装软件.所以yum install 命令每次都安装失败 下面介绍一种更改yum源的方式: 系统说明: 系统:Red ...

  4. rhel7.0替换centos yum源

    1:卸载原先的yum 2:安装centos的yum 有以下的yum yum-utils-1.1.31-24.el7.noarch yum-langpacks-0.4.2-3.el7.noarch yu ...

  5. RHEL6.×配置Centos YUM源

    Step1: 清除原有的yum源rpm -aq|grep yum|xargs rpm -e --nodeps Step2:下载新的yum()源进行安装,注意操作系统支持64位还是32位wget htt ...

  6. Rhel5.5配置Centos yum源

    ruiy哥,抛砖引玉 当你使用rhel系统时,[大部分数据库中心及政府企业选择linux服务器时通常考虑采购的版本一般不外乎是Rhel红帽及Suse,理由你懂的EcoSystem!]你没有一个红帽网络 ...

  7. RedHat 更新CentOS Yum源(转)

    经测试,可用.转自:https://www.cnblogs.com/tangsen/p/5151994.html 一.随笔引言 1.1随笔内容: 1.RedHat 配置Centos yum源 2.yu ...

  8. 使用 ISO镜像配置 本地yum 源(RHEL, CentOS, Fedora等适用)

    使用 ISO镜像配置 本地yum 源(RHEL, CentOS, Fedora等适用)   1.上传ISO镜像和挂载 1) 上传Centos7.2 ISO镜像到 /usr/local/src目录 2) ...

  9. (转载)centos yum源的配置和使用

    原文地址:http://www.cnblogs.com/mchina/archive/2013/01/04/2842275.html 一.yum 简介 yum,是Yellow dog Updater, ...

随机推荐

  1. zorka源码解读之Beanshell与zorka的交互实现

    一.beanshell基础知识从应用程序中调用BeanShell创建一个BeanShell的解释器(interpreter)用eval()和source()命令可以对一个字符串求值和运行一个脚本文件使 ...

  2. LogPolar 对数极坐标

    LogPolar 对数极坐标 cvLogPolar 对数极坐标(logpolar)是仿真生物视网膜中央凹陷的特性,具有数据压缩的能力,可用于目标跟踪中快速尺度和旋转变换不变的模板匹配. 对数极坐标其实 ...

  3. jQuery的.bind()、.live()和.delegate()之间区别

    摘要:jQuery的.bind()..live()和.delegate()之间的区别并非总是那么明显的,然而,如果我们对所有的不同之处都有清晰的理解的话,那么这将会有助于我们编写出更加简洁的代码,以及 ...

  4. html 之input标签height设置问题

    今天针对这个问题纠结了很久 <input type="button" value="xx" style="height:99px;" ...

  5. [LintCode] Min Stack 最小栈

    Implement a stack with min() function, which will return the smallest number in the stack. It should ...

  6. java并发编程(六)Runnable和Thread实现多线程的区别

    http://blog.csdn.net/ns_code/article/details/17161237

  7. Socket聊天室-TcpListener,TcpClient

    参考自:http://blog.csdn.net/liguo9860/article/details/6148614 服务端:

  8. Struts2中的ModelDriven机制及其运用

    所谓ModelDriven,意思是直接把实体类当成页面数据的收集对象.比如,有实体类User如下: package cn.com.leadfar.struts2.actions; public cla ...

  9. SQL日期相关的操作

    DECLARE @dt datetime SET @dt=GETDATE() DECLARE @number int --1.指定日期该年的第一天或最后一天 --A. 年的第一天 ),)+'1-1' ...

  10. 安卓中級教程(9):pathbutton中的animation.java研究(2)

    src/geniuz/myPathbutton/composerLayout.java package geniuz.myPathbutton; import com.nineoldandroids. ...