折腾着搞openvpn 网站服务器yum指令出了点问题
------------------------------------------------------------
[[email protected] ~]# yum
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.6.6 (r266:84292, Feb 22 2013, 00:00:18)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-3)]
If you cannot solve this problem yourself, please go to
the yum faq at:
http://yum.baseurl.org/wiki/Faq
-----------------------------------------------------------
原因是python版本与yum不兼容.
解决过程:1.准备
[[email protected] ~]# lsb_release -a
LSB Version: :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
Distributor ID: CentOS
Description: CentOS release 6.4 (Final)
Release: 6.4
Codename: Final
那么系统是CentOS release 6.4 (Final).
[[email protected] ~]# uname -a
Linux cloud 2.6.32-358.el6.x86_64 #1 SMP Fri Feb 22 00:31:26 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
那么安装的系统是64位.
2.安装yum程序
先下载所需要的rpm包;
2)下载并安装python-urlgrabber,python-pycurl,yum-metadata-parser(yum需要这三个东西)
centos5 下载地址:http://tel.mirrors.163.com/centos/5/os/x86_64/CentOS/
centos6 下载地址:http://mirrors.163.com/centos/6/os/x86_64/Packages/
使用 wget 下载,然后 rpm -ivh xxx.rpm 安装
3)安装yum
到官网或其他地址下载yum源码包(例如:yum-3.4.3)
wget http://yum.baseurl.org/download/3.4/yum-3.4.3.tar.gz
tar xvf yum-3.4.3.tar.gz
cd yum-3.4.3
./yummain.py install yum
错误又出来了
CRITICAL:yum.cli:Config Error: Error accessing file for config file:///etc/yum.conf
其实是因为/etc/yum.conf之前被我删了
那么touch保险下吧 touch /etc/yum.conf
再执行./yummain.py install yum
[[email protected] yum-3.4.3]# ./yummain.py install yum
There are no enabled repos.
Run "yum repolist all" to see the repos you have.
You can enable repos with yum-config-manager --enable <repo>
又是问题。。。坑
没有repo源 又是被我删了的。。。有的话请略过
cd /etc/yum.repos.d
mkdir yum.repos.d
wget http://docs.linuxtone.org/soft/lemp/CentOS-Base.repo
./yummain.py install yum
出现
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.6.6 (r266:84292, Feb 22 2013, 00:00:18)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-3)]
If you cannot solve this problem yourself, please go to
the yum faq at:
http://yum.baseurl.org/wiki/Faq
-----------------------------------
未完待续,问题还没解决....