In the operation of CentOS system, yum is not available when upgrading Python, and yum is a more important software. How to deal with this problem? The following small series will introduce you to the solution that CentOS 6.4 upgrade Python causes yum to be unavailable.
1, check the current python version
1python -V
2, download the 2.7.3 version of Python
1wget http: //python.org/ftp/python/2.7.3/Python-2.7.3.tar.bz2
3. Unpack and install
tar -jxvf Python-2.7.3.tar .bz2
#Enter the unzipped directory
cd Python-2.7.3
#compile and install
. /configure
make
make install
4. Check if the installation is successful
/usr/local/bin/python2.7 -V
#If the following message appears, the installation is successful
Python 2.7.3
5, create a soft link
#Normally, even if python2.7 is successfully installed, The default python pointed to by the system is still version 2.6.6. Considering that yum is based on python 2.6.6, it works fine, so it is not recommended to uninstall.
#Use the following method to change the default python of the system to version 2.7.3
mv /usr/bin/python /usr/bin/python2.6.6
ln -s /usr/local/bin/python2.7 /usr/bin/python
#detecting success
python -V
#2.7.3 version information Representative success
Python 2.7.3
6. Solve the problem that yum is not available after modifying the default python version of the system
#Modify yum file
vi /usr/bin/yum
#! /usr/bin/python
Change to the following content
#! /usr/bin/python2.6.6
The entire upgrade process is complete.
7, other problems
After the above 6 steps of the operation yum is available, but I do not know which cow has modified the system's files, resulting in the use of yum or prompt no Named yum error message. After reviewing the information, it is known to make the version of yum's head python.
But I have already modified it (step 6), I don't know how to solve it. Finally, I gave up the "Da Niang", using Google, which is often harmonized, to find a document on the Centos official website, as follows.
First find the CD or ISO file where you installed Centos, as long as the system version is the same. Copy the following files to the system:
python-2.6.6-36.el6.x86_64.rpm
python-urlgrabber-3.9.1-8.el6.noarch.rpm
python-devel-2.6.6-36.el6.x86_64.rpm
python-libs-2.6.6-36.el6.x86_64.rpm
yum-3.2.29 -40.el6.centos.noarch.rpm
The specific version number is subject to your system disk or ISO. I copied it to the following directory
/usr/local/src/Python-2.6.6
Execute the installation
cd /usr/local/src/Python-2.6. 6/
rpm -Uvh --replacepkgs *.rpm
#The following prompt appears
Preparing. . ###############################################################################
1: python-libs ###################################################################### # [ 20%]
2:python ################################################# ####### [ 40%]
3: python-urlgrabber ########################################## ############### [ 60%]
4:yum ##################################### ####################[80%]
5:python-devel ############## ############################################ [100%]
Execute the yum command, the interface you are familiar with appears.
The above is a description of the solution that CentOS 6.4 upgrades Python to make yum unusable. After all, reloading yum is cumbersome and not necessarily feasible. You can use the method described in this article to fix it.
The oracle database is one of the most popular server databases. It can handle dist
Linux is very troublesome to build SVN repository every time. If you implement these through shell s
There are many ways to take screenshots in Linux, but how do you take screenshots i
To master the partition of Linux hard disk, we must know the concept of MBR, extended partition and
What should I do if the NAS storage failure causes Linux to fail to start properly?
What should I do if I install a graphics card driver error on Ubuntu 13.10?
Linux vsftp prompt 530 Permission denied how to do?
Two ways to protect VPS SSH account security under Linux
Usage of the Linux tail command
Learn about the role of Linux mail commands through examples
Linux can not identify the u disk solution
Linux method for synthesizing multiple file contents
How to turn off alt shortcuts in Ubuntu system
What should I do if Win10 Cortana is slow?
The Win8.1 technique efficiently manages the application
How to set the start menu power button for Windows 8 system
Win7 computer running game often prompts "lost d3dx943.dll" What should I do?
Windows 10 desktop version of the Outlook /alarm clock application can be interactive notification
Three commands to solve Windows 7 can not start the problem
How to detect whether the computer can upgrade Win10? Does the computer meet the upgrade win10?
Win10 boot music is gone, how to do
What should I do if the Win8 system notebook built-in camera can't be used?
What if win8 forgets the password? One easy to reset Win8 login password