大家都应该都清楚,redhalt 刚装完系统之后的yum是不好使的,有时我们像安装vsftp 这样的软件时用yum安装很方便。为此我们需要利用centos的yum源进行配置。现在这个源更新速度很快。 这是网易的资源总库 http://mirror.centos.org/。里面应有尽有。废话不多说: 具体安装步骤:
1、删除redhat原有的yum源
# rpm -aq | grep yum|xargs rpm -e –nodeps
2、重新从网上获取yum的安装包
以root登陆到redhalt系统,默认目录已经切换到 /root,通过wget 命令下载相应的yum包。
具体命令如下:
#wget http://mirrors.163.com/centos/6/ ... -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-73.el6.centos.noarch.rpm
# wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.30-37.el6.noarch.rpm
这样四个需要安装的包全部就下载下来了,接下来就是需要安装了。
3.安装软件包
# 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-73.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.30-37.el6.noarch.rpm
注意: 后面两个需要一起安装才行。因为具有软件依赖关系。当时我安装最后两个包时出现了一个错误,如下:
[iyunv@localhost ~]# rpm -ivh yum-3.2.29-73.el6.centos.noarch.rpmyum-plugin-fastestmirror-1.1.30-37.el6.noarch.rpm
warning:y um-3.2.29-73.el6.centos.noarch.rpm: Header V3 RSA/SHA1 Signature, key IDc105b9de: NOKEY
error: Failed dependencies:
python-urlgrabber >= 3.9.1-10 is needed byyum-3.2.29-73.el6.centos.noarch
还是软件依赖的问题,需要安装大于3.9.1-10版本的python-urlgrabber
于是又去下了一个大于3.9.1-10版本的python-urlgrabber的rpm包。
wget http://mirrors.163.com/centos/6/os/x86_64/Packages/ python-urlgrabber-3.9.1-11.el6.noarch.rpm
继续先安装 python-urlgrabber-3.9.1-11.el6.noarch.rpm 包;
# rpm -ivh python-urlgrabber-3.9.1-11.el6.noarch.rpm
安装完成后继续重复刚才最后一个步骤:
# rpm -ivh yum-3.2.29-73.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.30-37.el6.noarch.rpm
终于好使了。
4、更改yum源,使用网易的镜像站。
切换目录到 /etc/yum.repos.d/目录下
# cd /etc/yum.repos.d/
# wget http://mirrors.163.com/.help/CentOS6-Base-163.repo
# vim CentOS6-Base-163.repo
编辑CentOS6-Base-163.repo 文件,把文件里面的$releasever全部替换为版本号,这个地方是版本6 ,最后保存退出。如下:
# 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
改完之后退出编辑保存退出
5.测试是否安装好
# yum clean all #清理yum缓存
#yum makecache #将服务器上的软件包信息缓存到本地,以提高搜索安装软件的速度。
你会看到缓存过程,说明已经安装好了。
# yum list yum #测试配置的yum源是否已经生效。
下面就可以用yum安装一系列软件了。
运维网声明
1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网 享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com