RedHat Enterprise Linux 6.4使用Centos 6 的yum源

转载 2015年12月22日 15:44:35

思路:卸载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位系统为例):

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

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

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

 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-69.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

[注] :版本不一定要最新的

 

2、卸载RedHat自带的yum

 

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

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

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

 3、安装下载的centos的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-69.el6.centos.noarch.rpm  yum-plugin-fastestmirror-1.1.30-30.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

 

6、yum clean all 清除原有缓存

7、yum makecache  获取yum列表

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

Metadata Cache Created

8、在安装软件时,出现以下错误

 yum源更新后需要导入 key值,否则报错如下,无法安装相关的包。 

Total size: 42 M
Downloading Packages:
warning: rpmts_HdrFromFdno: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6


GPG key retrieval failed: [Errno 14] Could not open/read file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

 

 

解决办法:

  1. 先安装如下工具包:

    rpm -Uhv http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm

[root@localhost yum.repos.d]# rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-6

再次

6、yum clean all 清除原有缓存

7、yum makecache  获取yum列表


一般来说安装完成后即可,安装完这个就可以了。






RedHat Enterprise Linux 6.5使用Centos 6 的yum源

由于redhat6.5的yum功能是需要注册feiy
  • crazyitlhs
  • crazyitlhs
  • 2014-09-28 16:58:42
  • 3703

RedHat RHEL 6.4使用CentOS yum源

背景介绍 Red Hat是全球最大的开源厂商,RedHat Linux也被认为是最成功的Linux发行版,提供稳定的企业版Linux服务。CentOS也是Linux发行版之一,它是来自于Red Ha...
  • daiominribao
  • daiominribao
  • 2013-08-05 17:08:42
  • 3391

RedHat Enterprise Linux6.5 使用CentOS yum源

http://blog.csdn.net/zhngjan/article/details/20843465 [plain] view plaincopyprint? ...
  • witto_sdy
  • witto_sdy
  • 2014-12-09 16:04:37
  • 632

Red Hat Enterprise Linux (RHEL) 6.4 DVD ISO 迅雷下载地址

i386: http://rhel.ieesee.net/uingei/rhel-server-6.4-i386-dvd.iso x86_64: http://rhel.ieesee...
  • jiqiyoudu2
  • jiqiyoudu2
  • 2016-07-10 12:23:18
  • 2084

RedHat Linux6.4 使用yum安装时报错,改用CentOS yum源

在使用redhat linux的yum来安装或者更新软件的时候会有如下提示:[root@node1 home]# yum install package_name Loaded plugins: pr...
  • Super_Man_X
  • Super_Man_X
  • 2016-04-08 11:36:03
  • 1926

Red Hat Enterprise 6.4 i386 和 64位版本下载地址

  • 2013年04月28日 15:03
  • 921B
  • 下载

Red Hat Enterprise Linux 6 中yum安装配置

下载安装yum包 下载地址http://centos.ustc.edu.cn/centos/6.5/os/x86_64/Packages/ http://mirrors.163.com/cento...
  • liyunlong19870123
  • liyunlong19870123
  • 2015-06-11 09:17:42
  • 1783

redhat6.4 配置centos6 yum替换

关于Redhat 配置centos 更新源yum的操作说明
  • h249059945
  • h249059945
  • 2013-09-13 11:41:33
  • 4621

redhat enterprise linux 6.4 64位系统安装sybase

安装环境及版本 Redhat Enterprise Linux 6.4 64位 Vmware Workstation 10 ase15.7 64位 查看redhat版本及位数等信息命令: uname ...
  • loomz
  • loomz
  • 2015-04-21 11:04:48
  • 1859

redhat enterprise linux 6.4 64位系统安装oracle11g,笔记

安装环境 Redhat Enterprise Linux 6.4 64 Vmware Workstation 10 oracle 11g 安装准备 1、下载oracle数据库安装包,登录orac...
  • loomz
  • loomz
  • 2015-04-16 21:34:12
  • 3661
收藏助手
不良信息举报
您举报文章:RedHat Enterprise Linux 6.4使用Centos 6 的yum源
举报原因:
原因补充:

(最多只允许输入30个字)