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

Layim in javascript to find friends and groups

Currently, layui officials have not provided the ...

Detailed tutorial on installing VirtualBox and Ubuntu 16.04 under Windows system

1. Software Introduction VirtualBox VirtualBox is...

MySQL 8.0.13 manual installation tutorial

This article shares the manual installation tutor...

The latest virtual machine VMware 14 installation tutorial

First, I will give you the VMware 14 activation c...

How to use history redirection in React Router

In react-router, the jump in the component can be...

js precise calculation

var numA = 0.1; var numB = 0.2; alert( numA + num...

Detailed explanation of MySQL transactions and MySQL logs

Transactional Characteristics 1. Atomicity: After...

Chrome monitors cookie changes and assigns values

The following code introduces Chrome's monito...

In-depth analysis of the Identifier Case Sensitivity problem in MySQL

In MySQL, you may encounter the problem of case s...

How to preview pdf file using pdfjs in vue

Table of contents Preface think Library directory...

Share some key interview questions about MySQL index

Preface An index is a data structure that sorts o...

How to deploy HTTPS for free on Tencent Cloud

Recently, when I was writing a WeChat applet, the...

MySQL PXC builds a new node with only IST transmission (recommended)

Demand scenario: The existing PXC environment has...