The yum command delete restore in centos describes the remedy
- 2020-06-23 02:34:40
- OfStack
preface
yum, short for Yellow dog Updater Modified, was originally developed by Terra Soft, the developer of the first release, yellow dog. It was written in python, which was also known as yup(yellow dog updater), and later refined by the Linux@Duke development team at Duke University. The mission of yum is to automate upgrades, install/remove rpm packages, collect relevant information on rpm packages, check dependencies and automatically prompt users for resolution. yum the key is to have reliable repository, as the name suggests, this is the warehouse software, it can be http or ftp site, can also be a local pool of software, but must contain rpm header, header includes rpm bags of all kinds of information, including description, function, file dependency, etc., it is collect and analyze the header can automatically finish the rest of the task.
Because the server centos6.8 installation of mysql1 could not connect the problem, and then saw a method, 1 accidentally deleted yum, can not restore, very desperate, very uncomfortable. And then you don't have an yum and this centos feels like it's gone, and you find a way to put it in.
python --version To view python version
whereis python To view python file
python: /usr/bin/python2.6 /usr/bin/python /usr/lib /python2.7 /usr/lib/python2.6 /usr/lib64/python2.7 /usr/lib64/python2.6 /usr/include/python2.7 /usr/share/man/man1/python.1.gz
centos6.8 Basic base python is python2.6, centos7 is 2.7, and mine is centos6.8
The solution
Method 1:
This netizen's solution, record 1
$ rpm -qa | grep python- | grep 2.6
$ sudo rpm -ivh --force --nodeps ftp://mirror.switch.ch/pool/4/mirror/scientificlinux/6.5/x86_64/updates/fastbugs/python-2.6.6-52.el6.x86_64.rpm
To fix the problem, yum is available and the principle estimate is that python rolls back to the default 2.6
Method 2:
This is my solution
http://mirrors.163.com/centos/6/os/x86_64/Packages/
1. Go to the above website to download the RPM package as follows
python-iniparse-0.3.1-2.1.el6.noarch.rpm
yum-metadata-parser-1.1.2-14.1.el6.x86_64.rpm
yum-3.2.29-69.el6.centos.noarch.rpm
yum-plugin-fastestmirror-1.1.30-30.el6.noarch.rpm
2. After downloading, install with rpm command, as follows:
rpm -ivh --force --nodeps python-iniparse-0.3.1-2.1.el6.noarch.rpm
rpm -ivh --force --nodeps yum-metadata-parser-1.1.2-14.1.el6.x86_64.rpm
rpm -ivh --force --nodeps yum-3.2.29-69.el6.centos.noarch.rpm
yum-plugin-fastestmirror-1.1.30-30.el6.noarch.rpm
3, to http: / / yum baseurl. org/wiki
Download ES81en-3.4.3. tar.gz, put it in the directory you specified and unzip it. The unzip command is as follows:
tar -zxvf yum-3.4.3.tar.gz # Unzip and move in yum-3.4.3 directory
4, Input./ ES88en. py update
When done, enter yum to solve the problem
Pay attention to
Pay attention to the compatibility between the centos version and the centos version when downloading the above installation package. Otherwise, it is useless.
conclusion
reference
http://blog.sina.com.cn/s/blog_4cbf97060100u2zb.html
http://blog.csdn.NET/u011531010/article/details/53528054
http://blog.sina.com.cn/s/blog_643754960102w82m.html
http://stackoverflow.com/questions/17490921/no-module-named-rpm-when-i-call-yum-on-shell
http://blog.csdn.net/u011832895/article/details/53735198