`

RedHat5.6、6.0使用CentOS yum源

阅读更多

如何修改Centos yum源
--------------------------------------
国内yum源: 163和搜狐的yum源
本文章介绍的yum源支持的版本是CentOS 5系列,理论上支持RHEL5系列。

更新方法如下:

先进入yum源配置目录
 cd /etc/yum.repos.d
 
备份系统自带的yum源
 mv CentOS-Base.repo CentOS-Base.repo.save
 
下载其他更快的yum源
 中科大的yum源:(现在打不开
 wget http://centos.ustc.edu.cn/CentOS-Base.repo
 
163的yum源:
 wget http://mirrors.163.com/.help/CentOS-Base-163.repo
修改CentOS-Base.repo  (不修改会报错),下载到本地把“$releasever”,替换成“5”

sohu的yum源
 wget http://mirrors.sohu.com/help/CentOS-Base-sohu.repo

更新玩yum源后,建议更新一下,使操作立即生效
 yum makecache




RedHat5.6使用CentOS yum源更新的方法
================================================================================

由于RedHat的yum在线更新是收费的,我们的RedHat没有注册,不能在线更新下载rpm包。
需将RedHat的yum卸载后,重启安装Centos的yum,再配置其他yum源。

 

一、确认RedHat的版本
cat /etc/redhat-release
uname -m

二、删除redhat原有的yum源
rpm -aq|grep yum|xargs rpm -e --nodeps

三、下载CentOS的yum安装包(163源)  (可以在这里手工找rpm包:http://mirrors.163.com/centos/)
32位系统:
wget http://mirrors.163.com/centos/5/os/i386/CentOS/yum-metadata-parser-1.1.2-3.el5.centos.i386.rpm
wget http://mirrors.163.com/centos/5/os/i386/CentOS/yum-3.2.22-39.el5.centos.noarch.rpm
wget http://mirrors.163.com/centos/5/os/i386/CentOS/yum-fastestmirror-1.1.16-21.el5.centos.noarch.rpm
64位系统:
wget http://mirrors.163.com/centos/5/os/x86_64/CentOS/yum-metadata-parser-1.1.2-3.el5.centos.x86_64.rpm
wget http://mirrors.163.com/centos/5/os/x86_64/CentOS/yum-3.2.22-39.el5.centos.noarch.rpm
wget http://mirrors.163.com/centos/5/os/x86_64/CentOS/yum-fastestmirror-1.1.16-21.el5.centos.noarch.rpm

还依赖python-iniparse-0.2.3-4.el5.noarch.rpm,
但我的系统里已安装了,是系统默认Python2.4中自带的。
如果你的系统没有安装,请安装吧。

四、安装yum软件包
32位系统:
rpm -ivh yum-metadata-parser-1.1.2-3.el5.centos.i386.rpm
rpm -ivh yum-3.2.22-39.el5.centos.noarch.rpm  yum-fastestmirror-1.1.16-21.el5.centos.noarch.rpm
注意:最后两个安装包要放在一起同时安装,否则会提示相互依赖,安装失败。

64位系统:
rpm -ivh yum-metadata-parser-1.1.2-3.el5.centos.x86_64.rpm
rpm -ivh yum-3.2.22-39.el5.centos.noarch.rpm  yum-fastestmirror-1.1.16-21.el5.centos.noarch.rpm
注意:最后两个安装包要放在一起同时安装,否则会提示相互依赖,安装失败。


五、更改yum源  #我们使用网易的CentOS镜像源
cd /etc/yum.repos.d/
vi 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-5 - Base - 163.com
mirrorlist=http://mirrorlist.centos.org/?release=5&arch=$basearch&repo=os
baseurl=http://mirrors.163.com/centos/5/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

#released updates
[updates]
name=CentOS-5 - Updates - 163.com
mirrorlist=http://mirrorlist.centos.org/?release=5&arch=$basearch&repo=updates
baseurl=http://mirrors.163.com/centos/5/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

#packages used/produced in the build but not released
[addons]
name=CentOS-5 - Addons - 163.com
mirrorlist=http://mirrorlist.centos.org/?release=5&arch=$basearch&repo=addons
baseurl=http://mirrors.163.com/centos/5/addons/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

#additional packages that may be useful
[extras]
name=CentOS-5 - Extras - 163.com
mirrorlist=http://mirrorlist.centos.org/?release=5&arch=$basearch&repo=extras
baseurl=http://mirrors.163.com/centos/5/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-5 - Plus - 163.com
mirrorlist=http://mirrorlist.centos.org/?release=5&arch=$basearch&repo=centosplus
baseurl=http://mirrors.163.com/centos/5/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

#contrib - packages by Centos Users
[contrib]
name=CentOS-5 - Contrib - 163.com
mirrorlist=http://mirrorlist.centos.org/?release=5&arch=$basearch&repo=contrib
baseurl=http://mirrors.163.com/centos/5/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5



六、清理
yum clean all
yum makecache 

如果报错:imary.sqlite.bz2 from base: [Errno 256] No more mirrors to try.
执行:yum makecache 

 

 

 

七、更新

cd /etc/pki/rpm-gpg
wget http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

yum update


很长时间的下载后,报错:

warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID e8562897
GPG key retrieval failed: [Errno 5] OSError: [Errno 2] No such file or directory: '/etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5'
这是因为:指定的文件/etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5在本地不存在导致的。

解决:
去官网http://mirror.centos.org/centos/下载相应文件
cd /etc/pki/rpm-gpg
wget http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5


================================================================================




RedHat6.0使用CentOS yum源更新的方法
--------------------------------------------------------------------

由于RedHat的yum在线更新是收费的,我们的RedHat没有注册,不能在线更新下载rpm包。
需将RedHat的yum卸载后,重启安装Centos的yum,再配置其他yum源。


一、确认RedHat的版本
cat /etc/redhat-release
uname -m

二、删除redhat原有的yum源
rpm -aq|grep yum|xargs rpm -e --nodeps

三、下载CentOS的yum安装包(163源)
32位系统 :
wget http://mirrors.163.com/centos/6/os/i386/Packages/yum-3.2.29-22.el6.centos.noarch.rpm
wget http://mirrors.163.com/centos/6/os/i386/Packages/yum-metadata-parser-1.1.2-16.el6.i686.rpm
wget http://mirrors.163.com/centos/6/os/i386/Packages/yum-plugin-fastestmirror-1.1.30-10.el6.noarch.rpm
wget http://mirrors.163.com/centos/6/os/i386/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm

四、安装yum软件包
rpm -ivh python-iniparse-0.3.1-2.1.el6.noarch.rpm
rpm -ivh yum-metadata-parser-1.1.2-16.el6.i686.rpm
rpm -ivh yum-3.2.29-22.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.30-10.el6.noarch.rpm
注意:最后两个安装包要放在一起同时安装,否则会提示相互依赖,安装失败。

五、更改yum源  #我们使用网易的CentOS镜像源
cd /etc/yum.repos.d/
vi 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


六、清理
yum clean all
yum makecache 

如果报错:imary.sqlite.bz2 from base: [Errno 256] No more mirrors to try.
执行:yum makecache 

至此,Redhat6可以使用CentOS的yum源在线安装软件了!

分享到:
评论
1 楼 ooo456mmm 2014-11-14  
 

相关推荐

    redhat7配置成centos yum安装包和yum源

    由于RHEL7的更新包仅对已注册用户开放,对于那些希望免费获得更新的用户来说,将RHEL7系统配置为使用CentOS的YUM源和安装包是一种常见的解决方案。以下我们将详细探讨如何进行这种转换以及涉及的知识点。 首先,...

    redhat7替换使用CentOS yum源--博客附件

    总的来说,这个博客附件提供的是一套完整的流程,包括了替换RHEL 7的yum源以及更新必要的yum相关组件,确保用户能够在使用CentOS源后顺利进行软件的安装与更新。需要注意的是,这种操作可能会导致失去RHEL官方的技术...

    redhat/centos6通用yum源

    通用版redhat6或者centos6的yum源

    RHEL5下使用centos Yum源

    在RHEL5中使用CentOS的YUM源是一个常见的做法,尤其是当企业用户没有购买RHEL订阅的情况下。RHEL(Red Hat Enterprise Linux)是企业级Linux发行版,提供专业的技术支持和服务,但需要购买相应的订阅才能使用其全部...

    rhel6.0配置yum本地源

    本地源通常是指将光盘镜像的内容复制到本地硬盘上,然后配置yum使用这个本地目录作为软件包的来源。以下是一个详细的步骤指南,教你如何配置RHEL6.0系统的yum本地源。 首先,你需要将RHEL6.0的光盘镜像挂载到系统中...

    redhat7使用centos7的yum源

    redhat7使用yum需要收费,不能直接使用,需要使用centos7的yum源,本人看了一些文档和博客总结成了这个方法,成功地为redhat7配置好了yum,这个压缩包中包含配置yum的方法以及用到的文件,需要提前安装python,我的linux安...

    redhat换centos的yum源所需的4个文件

    - **下载新源文件**:下载到的压缩包"redhat换centos的yum源"应该包含了适用于RHEL 6的CentOS YUM源配置文件。 - **解压并替换文件**:将压缩包解压,并将解压出的`.repo`文件复制到`/etc/yum.repos.d`目录下,...

    Redhat 6.9 yum源的替换

    标题"Redhat 6.9 yum源的替换"表明我们要讨论如何为RHEL 6.9替换默认的yum源。描述中提到的“郁闷源”可能指的是官方源已经不再提供支持,而“163.repo”则是一个第三方的yum源,通常由网易提供,它包含了大量的...

    Redhat-配置YUM源

    Redhat 配置 YUM 源 Redhat 配置 YUM 源是 Linux 操作系统中的一种软件包管理器配置方法。YUM(Yellow dog Updater, Modified)是一种在 Fedora 和 Red Hat Enterprise Linux 中使用的软件包管理器,能够自动下载和...

    RedHat本地yum源配置及国内镜像源配置.docx

    ### RedHat本地yum源配置及国内镜像源配置 #### 一、RedHat本地yum源配置 ##### 1. 环境准备与检查 **背景介绍:** Red Hat Enterprise Linux(RHEL)是一款广泛使用的Linux发行版,在企业级应用环境中非常受...

    RedHat使用CentOS的yum源方法

    然而,由于成本或其他原因,用户可能希望使用CentOS的YUM源,这是一个可行的替代方案。 以下是使用CentOS YUM源的步骤: 1. **备份现有配置**:首先,确保备份当前的YUM配置,以防万一需要恢复。这可以通过复制`/...

    Centos8搭建本地yum源与局域网yum源.docx

    【CentOS8搭建本地YUM源与局域网YUM源】 在CentOS8系统中,搭建本地YUM源和局域网YUM源对于批量部署和管理服务器集群至关重要,可以显著提高软件安装和更新的速度。以下是详细步骤: 1. **前言** 在开始之前,...

    redhat6.0_配置源使用_yum

    在Red Hat Enterprise Linux (RHEL) 6.0系统中,使用YUM(Yellowdog Updater, Modified)作为包管理器进行软件安装和更新是非常常见的。然而,由于RHEL是商业发行版,其官方源可能需要订阅服务才能访问。在这种情况...

    RedHat6.6更新Centos6yum源

    redhat未注册,连接redhat官方软件源时,对未注册的用户不提供下载软件包的权限。 解决办法:因为centOS和redhat “本自同根生”,因此可以使用centOS的软件源。包括32位的软件包及安装步骤

    RedHat Linux RHEL6配置本地YUM源

    ### RedHat Linux RHEL6配置本地YUM源详解 #### YUM简介 YUM(Yellowdog Updater Modified)是一款在Linux环境下使用的包管理工具。它最初由Yellow Dog Linux的开发者们设计并实现,名为yup(Yellowdog Updater)。...

    修改red hat yum 源为centos

    本主题将详细介绍如何将Red Hat Enterprise Linux(RHEL)7.3或7.4的YUM源更改为CentOS的YUM源,这是一个常见的操作,特别是对于那些希望使用免费软件仓库的用户。 首先,理解YUM源的重要性是必要的。YUM是一个包...

    Redhat 使用CentOS的yum源进行升级或软件安装

    Redhat 使用CentOS的yum源进行升级或软件安装 分类: linux 2012-07-19 15:54 1113人阅读 评论(0) 收藏 举报 Redhat默认的源不但速度不给力,而且软件版本陈旧,今天试着将Redhat默认源替换为CentOS的163源,发现...

Global site tag (gtag.js) - Google Analytics