在安装heartbeat的时候提示不能找到依赖的包,最后发现是yum源的问题。在网上查了很多资料,终于成功配置了yum网络源,下面分享一下解决的办法。
解决办法:
1.卸载EHEL的yum,并下载CentOS的对应软件包
[[email protected] tools]# rpm -aq|grep yum
yum-metadata-parser-1.1.2-16.el6.x86_64
yum-rhn-plugin-0.9.1-58.el6.noarch
yum-3.2.29-69.el6.noarch
[[email protected] tools]# rpm -aq|grep yum|xargs rpm -e --nodeps
[[email protected] tools]#
[[email protected] tools]# rpm -aq|grep yum|xargs rpm -e --nodeps
rpm: no packages given for erase
2.下载并安装CentOS的对应的软件包
(1)可以通过网站直接下载
http://mirrors.163.com/centos/6/os/x86_64/Packages/
(2)在线下载对应软件包
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/python-urlgrabber-3.9.1-11.el6.noarch.rpm
wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-3.2.29-81.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-40.el6.noarch.rpm
[[email protected] ~]# cd /home/linzhongniao/tools/
[[email protected] tools]# ls
yum-3.2.29-81.el6.centos.noarch.rpm python-iniparse-0.3.1-2.1.el6.noarch.rpm yum-metadata-parser-1.1.2-16.el6.x86_64.rpmpython-urlgrabber-3.9.1-11.el6.noarch.rpm yum-plugin-fastestmirror-1.1.30-40.el6.noarch.rpm
提示:如果不正确执行,网站没有响应,意思这个包找不到了,以为版本更新了老版本删除掉了,我们可以吧按原来的软件名,在上面的那个网站里找这些安装包。
(3)安装对应软件包
[[email protected] tools]# rpm -ivh *
每个人的而系统环境都不一样,安装过程中会遇到各种各样的问题。缺失依赖的软件包rpm安装或者在镜像源网站上下载安装即可,如果提示软件包冲突rpm –e卸载旧版本重新再镜像源网站上下载安装即可。
3.Yum网络源配置
(1)先备份系统.repo文件
[[email protected] ~]# cp /etc/yum.repos.d/rhel-source.repo /etc/yum.repos.d/rhel-source.repo.bak
(2)添加下面内容
[[email protected] yum.repos.d]# cat rhel-source.repo
[base]
name=CentOS-$releasever - Base
baseurl=http://mirrors.163.com/centos/6/os/$basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6
[updates]
name=CentOS-$releasever - Updates
baseurl=http://mirrors.163.com/centos/6/updates/$basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6
[extras]
name=CentOS-$releasever - Extras
baseurl=http://mirrors.163.com/centos/6/extras/$basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6
[centosplus]
name=CentOS-$releasever - Plus
baseurl=http://mirrors.163.com/centos/6/centosplus/$basearch/
gpgcheck=1
enabled=0
(3)清楚原来的源文件
`yum clean all`
(4)安装yun源,测试新的yum 源有没有安装成功
yum install yum
(5)获取yum列表
yum list
好,到此yum网络源的配置成功了
原文地址:http://blog.51cto.com/10642812/2072250
时间: 2024-10-06 01:19:35