Solution to uninstalling Python and yum in CentOs system

Solution to uninstalling Python and yum in CentOs system

Background of the accident: A few days ago, due to project needs, I built the python-mysql module on the server, but it was not installed properly. So I wanted to uninstall and reinstall it, so I searched online for ways to uninstall python. As a result, I accidentally deleted the system's python..........

Now I can only repair it with tears. I searched for methods on the Internet, but they are basically not so detailed. Now I write down this method, hoping to help friends with the same situation as me~

1: Uninstall Python (in case some students did not uninstall it cleanly)

2. Uninstall yum

3. Verify whether the deletion is complete

4. Install python and yum

Find the python rpm package of your system version in the mirror station linked below (mine is a 64-bit system of centos 6.9)

Key point: Be sure to choose the file that corresponds to your system version! ! Otherwise, the following error will occur (When the blogger did not see this website at first, he referred to the download file list provided by another blogger and searched and downloaded it directly on the Internet by file name. As a result, the file did not match the system... It took a long time to search on the Internet...)

http://vault.centos.org/

Enter the website, select the version corresponding to your system, and enter the OS folder

Select the bit number corresponding to the system. For 32-bit, select i386. For 64-bit, select x86_64.

Go to the Packages folder

After entering, you will see a lot of rpm files

5. Download the following files

python-2.6.6-66.el6_8.x86_64.rpmpython-devel-2.6.6-66.el6_8.x86_64.rpmpython-iniparse-0.3.1-2.1.el6.noarch.rpmpython-libs-2.6.6-66.el6_8.x86_64.rpmpython-pycurl-7.19.0-9.el6.x86_64.rpmpython-urlgrabber-3.9.1-11.el6.noarch.rpmrpm-python-4.8.0-55.el6.x86_64.rpmyum-3.2.29-81.el6.centos.noarch.rpmyum-metadata-parser-1.1.2-16.el6.x86_64.rpmyum-plugin-fastestmirror-1.1.30-40.el6.noarch.rpm

6. Log in to the server and create a python folder where you like. Here I am in local src

7. Upload the files you just downloaded to the python folder of your server

8. Start installation after uploading

If an error similar to the following appears in the middle of the process, this is the dependency relationship between packages (provided that your file and system versions correspond)

Pay attention! ! ! The dependency here is not as simple as relying on just one. The problem first occurred when I was installing python-2.6.6-66.el6_8.x86_64.rpm (I forgot to take a screenshot). I searched online and someone said that it depended on python-libs-2.6.6-66.el6_8.x86_64.rpm. Then the blogger still reported this error after trying it. Later, I simply thought of installing them all together, and it really succeeded... (I don't know who has dependencies on whom, so just install them all together. It works after personal testing)

9. Testing

yum

The following information indicates that the reinstallation is successful~~~~

Summarize

The above is the solution introduced by the editor after uninstalling Python and yum that comes with the CentOs system. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website!

You may also be interested in:
  • Use shell script to install python3.8 environment in CentOS7 (recommended)
  • Tutorial on installing Python3 from source code and automatically installing Python3 using shell scripts under CentOS7
  • Python3 monitoring CentOS disk space script
  • Shell script sharing for upgrading Python to version 2.7 in CentOS 6.x system
  • Tutorial on installing and uninstalling python3 under Centos7
  • Detailed installation of Python3 and corresponding pip tutorial on centos
  • How to implement scheduled execution of Python scripts in CentOS 7

<<:  Solve the problem of Access denied for user 'root'@'%' to database 'xxx' after creating a database in MySQL

>>:  JavaScript data structure bidirectional linked list

Recommend

Detailed explanation of the use of CSS pointer-events attribute

In front-end development, we are in direct contac...

How to fill items in columns in CSS Grid Layout

Suppose we have n items and we have to sort these...

Search optimization knowledge to pay attention to in web design

1. Link layout of the new site homepage 1. The loc...

A detailed guide to custom directives in Vue

Table of contents 1. What is a custom instruction...

Research on the problem of flip navigation with tilted mouse

In this article, we will analyze the production of...

MySQL table field time setting default value

Application Scenario In the data table, the appli...

Detailed explanation of 6 ways of js inheritance

Prototype chain inheritance Prototype inheritance...

How to point the target link of a tag to iframe

Copy code The code is as follows: <iframe id=&...

30 Tips for Writing HTML Code

1. Always close HTML tags In the source code of p...

JavaScript implements fireworks effects with sound effects

It took me half an hour to write the code, and th...

XHTML introductory tutorial: Web page Head and DTD

Although head and DTD will not be displayed on th...

An article teaches you to write clean JavaScript code

Table of contents 1. Variables Use meaningful nam...