思路:卸载redhat自带yum,然后下载centos的yum,安装后修改配置文件
1、首先到http://mirrors.163.com/centos下载软件包
<wbr></wbr>
x86 地址:http://mirrors.163.com/centos/6/os/i386/Packages/
x86_64 地址:http://mirrors.163.com/centos/6/os/x86_64/Packages/
必要下载的软件包有(以64位系统为例):
a<wbr>python-iniparse-0.3.1-2.1.el6.noarch.rpm</wbr>
b<wbr>yum-3.2.29-40.el6.centos.noarch.rpm</wbr>
c<wbr>yum-metadata-parser-1.1.2-16.el6.x86_64.rpm</wbr>
d<wbr>yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm</wbr>
下载命令:
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
|
[注] :版本不一定要最新的
2、卸载RedHat自带的yum
<wbr></wbr>
<wbr><wbr><wbr><wbr><wbr>rpm -qa | grep yum | xargs rpm -e --nodeps</wbr></wbr></wbr></wbr></wbr>
<wbr><wbr><wbr><wbr><wbr><wbr>注:a、xargs是一条<a target="_blank" href="http://baike.baidu.com/view/8095.htm" style="text-decoration:none; color:rgb(49,139,146)">Unix</a>和类Unix操作系统的常用命令。它的作用是将参数列表转换成小块分段传递给其他命令,以避免参数列表过长的问题</wbr></wbr></wbr></wbr></wbr></wbr>
<wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr>b、--nodeps<wbr>强制卸载,不管依赖性</wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr>
<wbr></wbr>
3、安装下载的centos的yum包:
<wbr></wbr>
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
<wbr></wbr>
[注] :最后2个需要一起安装,否则会出现依赖性错误
<wbr></wbr>
4、到http://mirrors.163.com的centos帮助文档中下载CentOS6-Base-163.repo文件,存放到/etc/yum.repo.d中
<wbr></wbr>
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.<wbr>You should use this for CentOS updates</wbr>
# 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.
#
#
<wbr></wbr>
[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
<wbr></wbr>
#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
<wbr></wbr>
#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
<wbr></wbr>
#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
<wbr></wbr>
#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
|
<wbr></wbr>
6、yum clean all清除原有缓存
7、yum makecache<wbr>获取yum列表</wbr>
出现下面提示,表示yum更改完成:
Metadata Cache Created
分享到:
相关推荐
RedHat Enterprise Linux 6.4使用yum安装出现This system is not registered to Red Hat Subscription Management问题,但是发现激活Redhat的yum功能需要收费,所以就更改为CentOS的yum包了。 综合多份文档,本人...
本话题聚焦于将Red Hat Enterprise Linux (RHEL) 更改为 CentOS 6.4 的过程,这涉及到更换YUM源以及安装相关包。以下是关于这个主题的详细知识点: 首先,Red Hat Enterprise Linux 和 CentOS 都是基于Linux内核的...
1. 设置yum源:将yum源修改为centos源,举例说明修改为163源,以加快软件包的下载速度。 2. 安装配置dhcp:使用yum安装dhcp服务,然后配置dhcpd.conf文件并启动服务,检查其状态确保配置生效。 3. 安装配置http:...
在本文档中,我们主要探讨了如何在Red Hat Enterprise Linux (RHEL) 6.4系统上配置使用CentOS 6.4的软件源。这是一个常见的做法,因为两个发行版的兼容性较高,使得用户可以利用CentOS的开源替代品来获取软件更新...
红帽7.5更换yum源为centos源 操作步骤:参考以下链接。...标题:RedHat Enterprise Linux 6.4使用yum安装出现This system is not registered to Red Hat Subscription Management_天行健,君子以自强不息-CSDN博客 ...
在Red Hat Enterprise Linux (RHEL) 6.4版本中,`yum` 是默认的包管理器,用于安装、更新和管理系统软件。`yum`(Yellowdog Updater, Modified)通过连接到指定的软件仓库(也称为源或repo),为用户提供方便的方式...
name=Dag RPM Repository for Red Hat Enterprise Linux baseurl=http://apt.sw.be/redhat/el$releasever/en/$basearch/dag gpgcheck=1 gpgkey=http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt enabled=1 `...
在Red Hat Enterprise Linux (RHEL) 6.5这样的老版本系统中,有时需要手动安装特定的软件包,比如`openssl-devel`,因为默认的软件仓库可能不包含最新或者特定版本的软件。`openssl-devel`是开发人员在构建需要使用...
在这个例子中,系统已经配置了几个不同的YUM源,包括RHEL6.4默认源、Cloudera的CDH5和GPLExtras5以及EPEL(Extra Packages for Enterprise Linux)6。 为了安装saltstack,我们需要添加一个额外的YUM源,即`...
在CentOS 6.4上,我们可以使用`yum`包管理器来安装Apache、MySQL服务器和PHP,以及一些额外的依赖包,如PHP的SNMP扩展和RRDTool(用于数据存储和图形生成)。以下是安装命令: ```bash yum install httpd mysql ...