思路:卸载redhat自带yum,然后下载centos的yum,安装后修改配置文件

1、首先到http://mirrors.163.com/centos下载软件包

x86 地址:http://mirrors.163.com/centos/6/os/i386/Packages/

x86_64 地址:http://mirrors.163.com/centos/6/os/x86_64/Packages/

必要下载的软件包有(以64位系统为例):

a python-iniparse-0.3.1-2.1.el6.noarch.rpm

b yum-3.2.29-40.el6.centos.noarch.rpm

c yum-metadata-parser-1.1.2-16.el6.x86_64.rpm

d yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm

下载命令:

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-40.el6.centos.noarch.rpm

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

[注] :版本要最新的,否则yum memcache 无法更新,系163资源只提供最新的,老版本不再更新

2、卸载RedHat自带的yum

rpm -qa | grep yum | xargs rpm -e --nodeps

注:a、xargs是一条Unix和类Unix操作系统的常用命令。它的作用是将参数列表转换成小块分段传递给其他命令,以避免参数列表过长的问题

b、--nodeps 强制卸载,不管依赖性

3、安装下载的centosyum包:

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-40.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm

[注] :最后2个需要一起安装,否则会出现依赖性错误

4、到http://mirrors.163.com centos帮助文档 中下载CentOS6-Base-163.repo文件,存放到/etc/yum.repo.d

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

5、编辑CentOS6-Base-163.repo文件,将其中的$releasever更改为centos的版本号(最新的版本)

下面是修改好的:

# 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

6yum clean all 清除原有缓存

7yum makecache 获取yum列表

出现下面提示,表示yum更改完成:

Metadata Cache Created

关于RedHat Enterprise Linux 6.4使用Centos 6 的yum源的更多相关文章

  1. RedHat Enterprise Linux 6.4使用Centos 6的yum源问题

    RedHat Enterprise Linux 6.4使用Centos 6的yum源问题 作为一名新手,学习Linux已经一个月了,其间遇到了不少问题,而今天笔者遇到的问题是 #yum install ...

  2. 【转发】RedHat Enterprise Linux 6.4 使用 Centos 6 的yum源问题

    作为一名新手,学习Linux已经一个月了,其间遇到了不少问题,而今天笔者遇到的问题是 #yum install pam-devel #This system is not registered to ...

  3. RedHat Enterprise Linux 6.4使用Centos 6 的yum源 分类: 服务器搭建 Nginx 2015-07-14 14:11 5人阅读 评论(0) 收藏

    转载自:http://blog.sina.com.cn/s/blog_50f908410101cto6.html 思路:卸载redhat自带yum,然后下载centos的yum,安装后修改配置文件 1 ...

  4. RedHat Enterprise Linux 6.4 使用 Centos 6 的yum(转)

    概述 redhat的yum源需注册付费,费时费力,整理RedHat yum 安装CentOS的方法. 安装系统文件 系统:RedHat Enterprise Linux 6.4-x86_64 md5: ...

  5. RedHat Enterprise Linux 6.4-x86_64 md5:467B53791903F9A0C477CBB1B24FFD1F

    RedHat Enterprise Linux 6.4-x86_64 md5:467B53791903F9A0C477CBB1B24FFD1F 这是下载地址:http://pan.baidu.com/ ...

  6. RedHat Enterprise Linux 6.4使用yum安装出现This system is not registered to Red Hat Subscription Management

    我虚拟机安装的系统是RedHat Enterprise Linux 6.4-i686,是32位的.使用yum命令安装软件时候出现以下错误: This system is not registered ...

  7. 使用Xmanager远程访问Redhat Enterprise Linux 6.1

    使用Xmanager远程访问Redhat Enterprise Linux 6.1   在Linux服务器开启gdm 配置防火墙 配置selinux 使用xmanager连接linux服务器 在Lin ...

  8. RHEL(RedHat Enterprise Linux)5/6 ISO镜像下载

    本文贴出了RHEL(RedHat Enterprise Linux)发行版本中常用的服务器版本的ISO镜像文件,供大家下载学习使用,贴出的版本有RedHat Enterprise Linux(RHEL ...

  9. 硬盘安装RedHat Enterprise Linux 6(转载)

    准备条件: (1)RedHat Enterprise Linux 6安装镜像            下载见文章末尾 (2)grub文件(用于引导安装)                         ...

随机推荐

  1. Mac下新安装的MySQL无法登陆root用户解决方法

      一 设置MySQL命令行搜索路径 0.苹果->系统偏好设置->最下边点mysql 在弹出页面中 启动mysql服务 1.打开终端,输入: sudo vi ~/.bash_profile ...

  2. Ansible 小手册系列 七(Ad-hoc)

    Ansible提供两种方式去完成任务,一是 ad-hoc 命令,一是写 Ansible playbook.前者可以解决一些简单的任务, 后者解决较复杂的任务. ad hoc——临时的,在ansible ...

  3. vue项目使用hbuilder打包后,真机测试白屏

    在命令行直接运行 npm run build后,生成的dist文件中,直接打开index.html文件 Tip: built files are meant to be served over an ...

  4. SqlServer和MySQL中存储过程out返回值处理C#代码

    1.SqlServer中out处理 C#代码 #region"SqlServer中存储过程处理out返回值" //public void getdata() //{ // stri ...

  5. Algorithm1: 全排列

    全排列 思想:      这是一个全排列问题,需要使用递归实现,将数组中的所有元素和第一个元素交换,求后面n-1个元素的全排列.      按照这个条件递归下去,知道元素的个数只有一个的时候,输出所有 ...

  6. 1: 介绍Prism5.0 Introduction to the Prism Library 5.0 for WPF(英汉对照版)

     Prism provides guidance designed to help you more easily design and build rich, flexible, and easy- ...

  7. PHP工作笔记:离线执行php任务

    直接上代码,主要函数 ignore_user_abort(true);这个函数忽略了终端被关闭(打开的网页被关闭),后面 getfiles()这函数是执行采集任务的自定义函数,后面又配置了下路径打开写 ...

  8. SpringInAction--XML配置Spring Aop

    前面学习了如何用注解的方式去配置Spring aop,今天把XML配置的方法也看了下,下面顺便也做了个记录 先把spring中用xml配置aop的配置元素给贴出来: <aop:advisor&g ...

  9. 【跟着stackoverflow学Pandas】Delete column from pandas DataFrame-删除列

    最近做一个系列博客,跟着stackoverflow学Pandas. 以 pandas作为关键词,在stackoverflow中进行搜索,随后安照 votes 数目进行排序: https://stack ...

  10. Android Studio com.android.dex.DexException: Multiple dex files define(重复引用包),androiddefine

    Android Studio com.android.dex.DexException: Multiple dex files define(重复引用包),androiddefine 如果你用Andr ...