1. 检查是否安装yum包
[root@node1 rpms]# rpm -qa|grep yum

2. 删除自带的yum包
[root@node1 rpms]# rpm -qa|grep yum|xargs rpm -e --nodeps
因为一些包之间可能会有依赖关系,所以我们需要加上参数 --nodeps 无视依赖关系。

3. 下载yum包
Yum包下载地址http://mirrors.163.com/centos/
在这个网站里,你可以自己选择需要下载的文件,进入形如5/或者6/的文件下载,其他的无法下载。

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-73.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-37.el6.noarch.rpm

4. 安装yum包
[root@node1 rpms]# rpm -ivh python-iniparse-0.3.1-2.1.el6.noarch.rpm
[root@node1 rpms]# rpm -ivh yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
[root@node1 rpms]# rpm -ivh yum-3.2.29-73.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.30-37.el6.noarch.rpm

或者用以下命令
rpm -ivh yum-metadata-parser-1.1.2-16.el6.x86_64.rpm yum-3.2.29-73.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.30-37.el6.noarch.rpm --force --nodeps

5. 替换yum源

[root@node2 /]# cd /etc/yum.repos.d/
[root@node2 yum.repos.d]# cat 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

如果wget http://mirrors.163.com/.help/CentOS6-Base-163.repo 下载的,需要修改下里面的变量。

6. 清除缓存:
[root@node2 /]# yum clean all

7. 加载缓存:
[root@node2 /]# yum makecache

8. 更新软件:
[root@node2 /]# yum update

以上方法也是Red Hat Enterprise Linux Server(RHEL) yum安装软件时This system is not registered with RHN. RHN support will be disabled. 的解决方法
Red Hat Enterprise Linux Server(RHEL) 的yum服务是付费的,因为没有付费,所以无法使用yum安装软件,如RHEL想安装LNMP必须要先按此教程设置好yum,并可以正常使用后才可以安装LNMP一键安装包,会提示如下错误:This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register. 或如下错误信息:This system is not registered with RHN. RHN support will be disabled.

redhat 6.8 配置centos6的yum源的更多相关文章

  1. redhat 6.8 配置外网yum源

    1.检查是否安装yum包 rpm -qa |grep yum 2. 删除自带的yum包 rpm -qa|grep yum|xargs rpm -e --nodeps 3. 下载yum包 wget ht ...

  2. Centos6.5配置阿里云yum源

    很多时候,centos6.5 yum源可能无法访问,报404等等问题,一般情况下我们可以将yum源配置成阿里云的源,当然也可以配置成163的,简单说一下配置成阿里云的: 阿里云镜像源地址:http:/ ...

  3. Centos 5.x/6.x 配置163网易yum源

    Centos系统默认都是系统自带的yum源,国内用户用yum源安装比较慢,为了提高效率,一般我们会配置国内的yum源.国内比较好的yum源有网易yum源.搜狐yum源等. 我感觉网易的yum源比较好用 ...

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

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

  5. Centos7一键配置阿里云yum源脚本

    Centos7一键配置阿里云yum源脚本 工作中linux系统经常要配置网络yum,故写了一个简单的配置阿里云yum源的的脚本可以单独使用也可以在做自动化部署的时候调用. #!/bin/bash # ...

  6. Centos 7 配置阿里云 yum 源

    Centos 7 配置阿里云 yum 源 一. 禁用 yum 插件 fastestmirror 修改插件的配置文件 cp /etc/yum/pluginconf.d/fastestmirror.con ...

  7. redhat 6.8 配置 centos6 163 的 yum 源

    1. 检查是否安装yum包[root@node1 rpms]# rpm -qa|grep yum 2. 删除自带的yum包[root@node1 rpms]# rpm -qa|grep yum|xar ...

  8. centos6.5配置163的yum源

    CentOS系统自带的更新源的速度实在是慢,为了让CentOS6使用速度更快的YUM更新源,可以选择163(网易)的更新源. 1.下载repo文件 wget http://mirrors.163.co ...

  9. CentOS6.4配置163的yum源

    CentOS系统自带的更新源的速度实在是慢,为了让CentOS6使用速度更快的YUM更新源,可以选择163(网易)的更新源. 1.下载repo文件 wget http://mirrors.163.co ...

随机推荐

  1. Hashtable、ConcurrentHashMap源码分析

    Hashtable.ConcurrentHashMap源码分析 为什么把这两个数据结构对比分析呢,相信大家都明白.首先二者都是线程安全的,但是二者保证线程安全的方式却是不同的.废话不多说了,从源码的角 ...

  2. 谈谈一些有趣的CSS题目(十七)-- 不可思议的颜色混合模式 mix-blend-mode

    开本系列,谈谈一些有趣的 CSS 题目,题目类型天马行空,想到什么说什么,不仅为了拓宽一下解决问题的思路,更涉及一些容易忽视的 CSS 细节. 解题不考虑兼容性,题目天马行空,想到什么说什么,如果解题 ...

  3. Alsa 读取wave文件,并播放wave 文件

    对于一个wave文件,如果需要播放,涉及到几个方面 1.对于wave文件的解析 2.通过解析wave文件,将得到的参数(主要是sampfrequency, bitsperSample,channel) ...

  4. 解析HTML

                                                    解析HTML 一.什么是HTML HTML是超文本标签语言,即网页的源码.而浏览器就是翻译解释HTML源 ...

  5. VR全景智慧城市-VR大时代

    这是一个创业的时代,这是一个创新的社会,我们的国家从没有像今天这样高度重视创业创新,我们的社会从没有像今天这样对创业创新寄予如此厚望.李克强总理在2015年政府工作报告中指出:要把"大众创业 ...

  6. ASP实现计算机爱好者网站,可以直接浏览

    利用ASP制作的计算机爱好者协会网站,内容比较全面,具有母版和子页的功能,利用ACCESS数据库进行资源存储.适合新手学习和网页制作比赛参考 下载地址:http://download.csdn.net ...

  7. Hibernate乐观锁、悲观锁和多态

     乐观锁和悲观锁 悲观锁(Pessimistic Lock), 顾名思义,就是很悲观,每次去拿数据的时候都认为别人会修改,所以每次在拿数据的时候都会上锁,这样别人想拿这个数据就会block直到它拿到锁 ...

  8. Hibernate map enum type

    1. Bean @Entity @Table(name = "entities") public class Entities { public enum entityType { ...

  9. Android网络下载图片

    package net.learn2develop.Networking; import android.app.Activity; import android.os.Bundle; import ...

  10. Your data vis “Spidey-sense” & the need for a robust “utility belt”

    @theboysmithy did a great piece on coming up with an alternate view for a timeline for an FT piece. ...