在CentOS 6.5上安装yum工具:

1、下载yum文件

主要下载3个rpm安装包(以64bit系统为例):

yum-3.2.29-60.el6.centos.noarch.rpm
yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
yum-plugin-fastestmirror-1.1.30-30.el6.noarch.rpm

64位系统前往:http://centos.ustc.edu.cn/centos/6/os/x86_64/Packages/

32位前往:http://centos.ustc.edu.cn/centos/6/os/i386/Packages/,(文件名与64bit的关键词对应即可,依次为3.2.29、metadata-parser、fastestmirror)

2、安装

rpm -ivh yum-*

3、配置yum的配置源

wget http://docs.linuxtone.org/soft/lemp/CentOS-Base.repo 下载到 /etc/yum.repos.d/ 目录下

4、安装之后输入yum测试,如果提示python中不包含这个模块,如我安装了python2.7,但是yum默认装在了python2.6的模块下,则会报错:

There was a problem importing one of the Python modules
required to run yum. The error leading to this problem was:
No module named yum
Please install a package which provides this module, or
verify that the module is installed correctly.
It’s possible that the above module doesn’t match the
current version of Python, which is:
2.7.6 (default, Jan 19 2015, 22:40:16)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-11)]
If you cannot solve this problem yourself, please go to
the yum faq at:
http://yum.baseurl.org/wiki/Faq

可以修改yum配置文件:

1
vim /usr/bin/yum

,将第一行“#!/usr/bin/python”改为“#!/usr/bin/python2.6”或者对应版本(centOS6.5默认安装python2.6)

最后更新: 2019年04月19日 21:37

原始链接: http://andersjing.com/2015/05/07/2015-05-07-CentOS6.5_yum/

× 请打赏~
打赏二维码