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

HTML page jump code

Save the following code as the default homepage fi...

How to create a child process in nodejs

Table of contents Introduction Child Process Crea...

Solution for multiple Docker containers not having the same port number

Background In Docker, four containers are created...

How to implement Nginx reverse proxy for multiple servers

Nginx reverse proxy multiple servers, which means...

Nginx solves cross-domain issues and embeds third-party pages

Table of contents Preface difficulty Cross-domain...

Summary of the execution issues between mysql max and where

Execution problem between mysql max and where Exe...

Summary of Mysql slow query operations

Mysql slow query explanation The MySQL slow query...

MySQL 5.7 cluster configuration steps

Table of contents 1. Modify the my.cnf file of se...

linux exa command (better file display experience than ls)

Install Follow the README to install The document...

Write a publish-subscribe model with JS

Table of contents 1. Scene introduction 2 Code Op...

How to construct a table index in MySQL

Table of contents Supports multiple types of filt...

Ubuntu Server 16.04 MySQL 8.0 installation and configuration graphic tutorial

Ubuntu Server 16.04 MySQL 8.0 installation and co...

Vue uses rules to implement form field validation

There are many ways to write and validate form fi...