linux输入yum后提示: -bash: /usr/bin/yum: No such file or directory的解决方案
时间:2019-11-25
本文章向大家介绍linux输入yum后提示: -bash: /usr/bin/yum: No such file or directory的解决方案,主要包括linux输入yum后提示: -bash: /usr/bin/yum: No such file or directory的解决方案使用实例、应用技巧、基本知识点总结和需要注意事项,具有一定的参考价值,需要的朋友可以参考一下。
linux输入yum后提示: -bash: /usr/bin/yum: No such file or directory的解决方案
今天在安装程序时,发现有一个插件未安装,我就随手敲了一个命令,看都没看
yum remove yum
然后就杯具了...
1 [root@localhost ~]# yum 2 -bash: /usr/bin/yum: No such file or directory
这个粗心的手误倒不至于让整个系统瘫痪,yum 却无法使用了。于是,我试着折腾了一番
1 rpm -ivh --nodeps http://mirrors.163.com/centos/5/os/x86_64/CentOS/yum-fastestmirror-1.1.16-14.el5.centos.1.noarch.rpm 2 rpm -ivh --nodeps http://mirrors.163.com/centos/5/os/x86_64/CentOS/yum-metadata-parser-1.1.2-3.el5.centos.x86_64.rpm 3 rpm -ivh --nodeps http://mirrors.163.com/centos/5/os/x86_64/CentOS/yum-3.2.22-26.el5.centos.noarch.rpm
关于rpm --nodeps的解释
1 --nodeps don't verify package dependencies
接下来,再次尝试输入yum,结果再次出现莫名错误
1 [root@localhost ~]# yum 2 There was a problem importing one of the Python modules 3 required to run yum. The error leading to this problem was: 4 5 libxml2.so.2: cannot open shared object file: No such file or directory 6 7 Please install a package which provides this module, or 8 verify that the module is installed correctly. 9 10 It's possible that the above module doesn't match the 11 current version of Python, which is: 12 2.4.3 (#1, Nov 11 2010, 13:30:19) 13 [GCC 4.1.2 20080704 (Red Hat 4.1.2-48)] 14 15 If you cannot solve this problem yourself, please go to 16 the yum faq at: 17 http://wiki.linux.duke.edu/YumFaq
因为yum调用的是python,运行 Python,试下是否可行
1 [root@localhost~]# python 2 Python 2.4.3 (#1, Nov 11 2010, 13:30:19) 3 [GCC 4.1.2 20080704 (Red Hat 4.1.2-48)] on linux2 4 Type "help", "copyright", "credits" or "license" for more information. 5 >>> import yum 6 Traceback (most recent call last): 7 File "<stdin>", line 1, in ? 8 File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 54, in ? 9 import transactioninfo 10 File "/usr/lib/python2.4/site-packages/yum/transactioninfo.py", line 31, in ? 11 from sqlitesack import YumAvailablePackageSqlite 12 File "/usr/lib/python2.4/site-packages/yum/sqlitesack.py", line 26, in ? 13 import yumRepo 14 File "/usr/lib/python2.4/site-packages/yum/yumRepo.py", line 32, in ? 15 import sqlitecachec 16 File "/usr/lib64/python2.4/site-packages/sqlitecachec.py", line 19, in ? 17 import _sqlitecache 18 ImportError: libxml2.so.2: cannot open shared object file: No such file or directory 19 >>>
提示缺少libxml2.so.2,安装一下试试
rpm -ivh http://mirrors.163.com/centos/5/os/x86_64/CentOS/libxml2-2.6.26-2.1.2.8.x86_64.rpm
再次测试运行下yum命令,结果正常了,大喜
1 [root@localhost ~]# yum 2 Loaded plugins: fastestmirror 3 You need to give some command 4 usage: yum [options] COMMAND 5 6 List of Commands: 7 8 check-update Check for available package updates 9 clean Remove cached data 10 deplist List a package's dependencies 11 downgrade downgrade a package 12 erase Remove a package or packages from your system 13 groupinfo Display details about a package group 14 groupinstall Install the packages in a group on your system 15 grouplist List available package groups 16 groupremove Remove the packages in a group from your system 17 help Display a helpful usage message 18 info Display details about a package or group of packages 19 install Install a package or packages on your system 20 list List a package or groups of packages 21 localinstall Install a local RPM 22 makecache Generate the metadata cache 23 provides Find what package provides the given value 24 reinstall reinstall a package 25 repolist Display the configured software repositories 26 resolvedep Determine which package provides the given dependency 27 search Search package details for the given string 28 shell Run an interactive yum shell 29 update Update a package or packages on your system 30 upgrade Update packages taking obsoletes into account 31 32 33 options: 34 -h, --help show this help message and exit 35 -t, --tolerant be tolerant of errors 36 -C run entirely from cache, don't update cache 37 -c [config file] config file location 38 -R [minutes] maximum command wait time 39 -d [debug level] debugging output level 40 --showduplicates show duplicates, in repos, in list/search commands 41 -e [error level] error output level 42 -q, --quiet quiet operation 43 -v, --verbose verbose operation 44 -y answer yes for all questions 45 --version show Yum version and exit 46 --installroot=[path] set install root 47 --enablerepo=[repo] enable one or more repositories (wildcards allowed) 48 --disablerepo=[repo] disable one or more repositories (wildcards allowed) 49 -x [package], --exclude=[package] 50 exclude package(s) by name or glob 51 --disableexcludes=[repo] 52 disable exclude from main, for a repo or for 53 everything 54 --obsoletes enable obsoletes processing during updates 55 --noplugins disable Yum plugins 56 --nogpgcheck disable gpg signature checking 57 --disableplugin=[plugin] 58 disable plugins by name 59 --enableplugin=[plugin] 60 enable plugins by name 61 --skip-broken skip packages with depsolving problems 62 --color=COLOR control whether color is used 63 64 Plugin Options:
最后,赶紧更新一下系统吧
1 yum update
好了 这样yum问题就完全解决了!
转载于:https://www.cnblogs.com/AI-Algorithms/p/3585456.html
原文地址:https://www.cnblogs.com/Sincerity/p/11926767.html
- ASP.NET MVC是如何运行的[1]: 建立在“伪”MVC框架上的Web应用
- 在Entity Framework中使用存储过程(五):如何通过存储过程维护多对多关系?
- ASP.NET MVC下基于异常处理的完整解决方案
- 不到40行代码构建正则表达式引擎
- 随便写一篇文章
- Java 10新特性解密
- Android组件化框架项目详解
- ScheduledThreadPoolExecutor原理探究
- TensorFlow下载与安装
- Kotlin基础之内联函数
- 不服来战,看Kotlin如何完爆Java
- 前缀、中缀、后缀表达式
- iOS WebDriverAgent 环境搭建
- Kotlin 1.2 新特性
- JavaScript 教程
- JavaScript 编辑工具
- JavaScript 与HTML
- JavaScript 与Java
- JavaScript 数据结构
- JavaScript 基本数据类型
- JavaScript 特殊数据类型
- JavaScript 运算符
- JavaScript typeof 运算符
- JavaScript 表达式
- JavaScript 类型转换
- JavaScript 基本语法
- JavaScript 注释
- Javascript 基本处理流程
- Javascript 选择结构
- Javascript if 语句
- Javascript if 语句的嵌套
- Javascript switch 语句
- Javascript 循环结构
- Javascript 循环结构实例
- Javascript 跳转语句
- Javascript 控制语句总结
- Javascript 函数介绍
- Javascript 函数的定义
- Javascript 函数调用
- Javascript 几种特殊的函数
- JavaScript 内置函数简介
- Javascript eval() 函数
- Javascript isFinite() 函数
- Javascript isNaN() 函数
- parseInt() 与 parseFloat()
- escape() 与 unescape()
- Javascript 字符串介绍
- Javascript length属性
- javascript 字符串函数
- Javascript 日期对象简介
- Javascript 日期对象用途
- Date 对象属性和方法
- Javascript 数组是什么
- Javascript 创建数组
- Javascript 数组赋值与取值
- Javascript 数组属性和方法
- 在 Ubuntu Linux 上安装 Oracle Java 14的方法
- 在 Linux 系统中手动滚动日志的方法
- Linux进程管理工具supervisor安装配置教程
- Linux执行可执行文件提示No such file or directory的解决方法
- 详解bash中的脚本调试机制
- 在 Linux 上查看和配置密码时效的方法
- CentOS7中使用shell脚本安装python3.8环境(推荐)
- linux定时任务的一些相关操作汇总
- Linux nohup命令原理及实例解析
- 基于centos7快速安装mysql5.7教程解析
- Centos8下django项目部署 nginx+uwsgi的教程
- 3分钟短文:Laravel把数据验证的手伸向“请求体”
- 「Redis」字符串
- Elasticsearch:pipeline aggregation 介绍
- Qt音视频开发32-Onvif网络设置