Preface
Because the server centos6.8 installed MySQL has been unable to connect the problem, and then see a method, accidentally put Yum to delete, all can not restore, is desperate, very uncomfortable. Then, without Yum, this centos would feel like a waste, and then find a way to put it up.
Python--version view python version
whereis python view python file
python:/usr/bin/python2.6/usr/bin/python/usr/lib/ python2.7/usr/lib/python2.6/usr/lib64/python2.7/usr/lib64/python2.6/usr/include/python2.7/usr/share/man/man1/ Python.1.gz
centos6.8 basic underlying Python is python2.6, Centos7 is 2.7, mine is centos6.8 solution
method One:
This netizen solves the method, records the
$ RPM-QA | grep python-| grep 2.6
$ sudo rpm-ivh--force--nodeps ftp://mirror.switch.ch/pool/4/mirror/scientificlinux/6.5/x86_64/updates /fastbugs/python-2.6.6-52.el6.x86_64.rpm
To solve the problem, yum can be used, and the principle estimate is that Python rolls back to the default of 2.6
Method Two:
This is my solution.
http://mirrors.163.com/centos/6/os/x86_64/Packages/
1, to the above site to download the following RPM package
python-iniparse-0.3.1-2.1.el6.noarch.rpm
yum-metadata-parser-1.1.2-14.1.el6.x86_64.rpm
yum-3.2.29-69.el6.centos.noarch.rpm
yum-plugin-fastestmirror-1.1.30-30.el6.noarch.rpm
2. After the download is complete, install it with the RPM command as follows:
RPM-IVH--force--nodeps python-iniparse-0.3.1-2.1.el6.noarch.rpm
rpm-ivh--force--nodeps yum-metadata-parser-1.1.2-14.1.el6.x86_64.rpm
RPM-IVH--force--nodeps yum-3.2.29-69.el6.centos.noarch.rpm
yum-plugin-fastestmirror-1.1.30-30.el6.noarch.rpm
3, to Http://yum.baseurl.org/wiki
Download yum-3.4.3.tar.gz, put it in the directory you specified, unzip the command as follows:
tar-zxvf yum-3.4.3.tar.gz #解压后进到yum -3.4.3 Directory
4, input./yummain.py update
When you are finished, enter Yum to resolve the issue
It is also useless to pay attention to the version of CentOS and the compatibility of this installation package when downloading the installation package above. Reference
Http://blog.sina.com.cn/s/blog_4cbf97060100u2zb.html
http://blog.csdn.NET/u011531010/article/details/53528054
Http://blog.sina.com.cn/s/blog_643754960102w82m.html
Http://stackoverflow.com/questions/17490921/no-module-named-rpm-when-i-call-yum-on-shell
http://blog.csdn.net/u011832895/article/details/53735198