redhat/centos 5 linux安装yum包 -bash: /usr/bin/yum: 没有那个文件或目录 的解决方法

By | 2017 年 2 月 8 日

因不小心把yum给删除了,导致无法使用yum

报错-bash: /usr/bin/yum

网上搜索有现成的教程:

[root@Linux yum.repos.d]# yum
-bash: /usr/bin/yum: 没有那个文件或目录

 

下面已经失效

[root@Linux yum.repos.d]# rpm -ivh –nodeps http://mirrors.163.com/centos/5/os/x86_64/CentOS//yum-fastestmirror-1.1.16-21.el5.centos.noarch.rpm 
Retrieving http://mirrors.163.com/centos/5/os/x86_64/CentOS//yum-fastestmirror-1.1.16-21.el5.centos.noarch.rpm
Preparing…                ########################################### [100%]

   1:yum-fastestmirror      ########################################### [100%]

[root@Linux yum.repos.d]# rpm -ivh –nodeps http://mirrors.163.com/centos/5/os/x86_64/CentOS/yum-fastestmirror-1.1.16-21.el5.centos.noarch.rpm 
Retrieving http://mirrors.163.com/centos/5/os/x86_64/CentOS/yum-fastestmirror-1.1.16-21.el5.centos.noarch.rpm
Preparing…                ########################################### [100%]

package yum-fastestmirror-1.1.16-21.el5.centos.noarch is already installed

[root@Linux yum.repos.d]# rpm -ivh –nodeps http://mirrors.163.com/centos/5/os/x86_64/CentOS/yum-metadata-parser-1.1.2-4.el5.x86_64.rpm   
Retrieving http://mirrors.163.com/centos/5/os/x86_64/CentOS/yum-metadata-parser-1.1.2-4.el5.x86_64.rpm
Preparing…                ########################################### [100%]

   1:yum-metadata-parser    ########################################### [100%]

[root@Linux yum.repos.d]# rpm -ivh –nodeps http://mirrors.163.com/centos/5/os/x86_64/CentOS/yum-3.2.22-40.el5.centos.noarch.rpm 
Retrieving http://mirrors.163.com/centos/5/os/x86_64/CentOS/yum-3.2.22-40.el5.centos.noarch.rpm
Preparing…                ########################################### [100%]

   1:yum                    ########################################### [100%]

[root@Linux yum.repos.d]# yum

已解决。

参考:http://blog.csdn.net/yongchaozhang/article/details/47751929

发表评论

电子邮件地址不会被公开。 必填项已用*标注