Hot search terms: 360 Security Guard Office365 360 browser WPS Office iQiyi Huawei Cloud Market Tencent Cloud Store
programming tools Storage size: 27.50 MB Time: 2022-12-05
Software introduction: Python is a general-purpose computer programming language. Python is a very beneficial tool for programmers, allowing you...
The following is an introduction to the solution to the problem that yum cannot be used due to upgrading Python in CentOS 6.4. After all, reinstalling yum is troublesome and may not be feasible. You can use the method introduced in this article to fix it.
1. Check the current system python version
1python -V
2. Download version 2.7.3 of Python
1wget http://python.org/ftp/python/2.7.3/Python-2.7.3.tar.bz2
3. Unzip and install
tar -jxvf Python-2.7.3.tar.bz2
#Enter the decompressed directory
cd Python-2.7.3
#Compile and install
. /configure
make
Make install
4. Check whether the installation is successful
/usr/local/bin/python2.7 -V
#If the following information appears, it means the installation is successful.
Python 2.7.3
5. Establish soft links
#Under normal circumstances, even after python2.7 is successfully installed, the python pointed to by the system by default is still version 2.6.6. Considering that yum is based on python2.6.6 to work properly, uninstallation is not recommended.
#Use the following method to change the system default python to version 2.7.3
mv /usr/bin/python /usr/bin/python2.6.6
ln -s /usr/local/bin/python2.7 /usr/bin/python
#Check whether the test is successful
python -V
#The presence of version 2.7.3 information indicates success
Python 2.7.3
6. Solve the problem of yum being unavailable after modifying the system default python version
#Modify yum file
vi /usr/bin/yum
.
#! /usr/bin/python
Change it to the following content
#! /usr/bin/python2.6.6
The entire upgrade process is completed.
7. Other questions
Yum is already available, but I don’t know which person has modified what file in the system, resulting in the error message “ no named yum” when using yum. After consulting the information, I learned that they are all versions of python that allow you to modify the head of yum.
But I have already modified it (step 6), and I don’t know how to solve it. Finally, I gave up "Du Niang" and used Google, which is often harmonized, and found a document on the Centos official website. The method is 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 based on 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.. . ##########################################[100%]
1:python-libs ##########################################[ 20%]
2:python #########################################[40%]
3:python-urlgrabber ##########################################[ 60%]
4:yum ##########################################[ 80%]
5:python-devel ########################################## [100%]
Execute the yum command, and the interface you are familiar with appears.
How does coreldraw export the specified object as a picture - How does coreldraw export the specified object as a picture
How to adjust word spacing in coreldraw - How to adjust word spacing in coreldraw
How to use Bezier tools in coreldraw - How to use Bezier tools in coreldraw
How to adjust font color in coreldraw - How to adjust font color in coreldraw
How to mirror symmetry in coreldraw - How to mirror symmetry in coreldraw
Eggman Party
WPS Office 2023
WPS Office
Minecraft PCL2 Launcher
WeGame
Tencent Video
Steam
CS1.6 pure version
Office 365
What to do if there is no sound after reinstalling the computer system - Driver Wizard Tutorial
How to switch accounts in WPS Office 2019-How to switch accounts in WPS Office 2019
How to clear the cache of Google Chrome - How to clear the cache of Google Chrome
How to practice typing with Kingsoft Typing Guide - How to practice typing with Kingsoft Typing Guide
How to upgrade the bootcamp driver? How to upgrade the bootcamp driver