linux输入yum后提示: -bash: /usr/bin/yum: No such file or directory的解决方法
linux输入yum后提示:-bash:/usr/bin/yum:Nosuchfileordirectory的解决方案
今天在安装程序时,发现有一个插件未安装,我就随手敲了一个命令,看都没看
yumremoveyum
然后就杯具了...
[root@localhost~]#yum -bash:/usr/bin/yum:Nosuchfileordirectory
这个粗心的手误倒不至于让整个系统瘫痪,yum却无法使用了。于是,我试着折腾了一番
rpm-ivh--nodepshttp://mirrors.163.com/centos/5/os/x86_64/CentOS/yum-fastestmirror-1.1.16-14.el5.centos.1.noarch.rpm rpm-ivh--nodepshttp://mirrors.163.com/centos/5/os/x86_64/CentOS/yum-metadata-parser-1.1.2-3.el5.centos.x86_64.rpm rpm-ivh--nodepshttp://mirrors.163.com/centos/5/os/x86_64/CentOS/yum-3.2.22-26.el5.centos.noarch.rpm
关于rpm--nodeps的解释
--nodepsdon'tverifypackagedependencies
接下来,再次尝试输入yum,结果再次出现莫名错误
[root@localhost~]#yum TherewasaproblemimportingoneofthePythonmodules requiredtorunyum.Theerrorleadingtothisproblemwas: libxml2.so.2:cannotopensharedobjectfile:Nosuchfileordirectory Pleaseinstallapackagewhichprovidesthismodule,or verifythatthemoduleisinstalledcorrectly. It'spossiblethattheabovemoduledoesn'tmatchthe currentversionofPython,whichis: 2.4.3(#1,Nov112010,13:30:19) [GCC4.1.220080704(RedHat4.1.2-48)] Ifyoucannotsolvethisproblemyourself,pleasegoto theyumfaqat: http://wiki.linux.duke.edu/YumFaq
因为yum调用的是python,运行Python,试下是否可行
[root@localhost~]#python Python2.4.3(#1,Nov112010,13:30:19) [GCC4.1.220080704(RedHat4.1.2-48)]onlinux2 Type"help","copyright","credits"or"license"formoreinformation. >>>importyum Traceback(mostrecentcalllast): File"",line1,in? File"/usr/lib/python2.4/site-packages/yum/__init__.py",line54,in? importtransactioninfo File"/usr/lib/python2.4/site-packages/yum/transactioninfo.py",line31,in? fromsqlitesackimportYumAvailablePackageSqlite File"/usr/lib/python2.4/site-packages/yum/sqlitesack.py",line26,in? importyumRepo File"/usr/lib/python2.4/site-packages/yum/yumRepo.py",line32,in? importsqlitecachec File"/usr/lib64/python2.4/site-packages/sqlitecachec.py",line19,in? import_sqlitecache ImportError:libxml2.so.2:cannotopensharedobjectfile:Nosuchfileordirectory >>>
提示缺少libxml2.so.2,安装一下试试
rpm-ivhhttp://mirrors.163.com/centos/5/os/x86_64/CentOS/libxml2-2.6.26-2.1.2.8.x86_64.rpm
再次测试运行下yum命令,结果正常了,大喜
[root@localhost~]#yum Loadedplugins:fastestmirror Youneedtogivesomecommand usage:yum[options]COMMAND ListofCommands: check-updateCheckforavailablepackageupdates cleanRemovecacheddata deplistListapackage'sdependencies downgradedowngradeapackage eraseRemoveapackageorpackagesfromyoursystem groupinfoDisplaydetailsaboutapackagegroup groupinstallInstallthepackagesinagrouponyoursystem grouplistListavailablepackagegroups groupremoveRemovethepackagesinagroupfromyoursystem helpDisplayahelpfulusagemessage infoDisplaydetailsaboutapackageorgroupofpackages installInstallapackageorpackagesonyoursystem listListapackageorgroupsofpackages localinstallInstallalocalRPM makecacheGeneratethemetadatacache providesFindwhatpackageprovidesthegivenvalue reinstallreinstallapackage repolistDisplaytheconfiguredsoftwarerepositories resolvedepDeterminewhichpackageprovidesthegivendependency searchSearchpackagedetailsforthegivenstring shellRunaninteractiveyumshell updateUpdateapackageorpackagesonyoursystem upgradeUpdatepackagestakingobsoletesintoaccount options: -h,--helpshowthishelpmessageandexit -t,--tolerantbetolerantoferrors -Crunentirelyfromcache,don'tupdatecache -c[configfile]configfilelocation -R[minutes]maximumcommandwaittime -d[debuglevel]debuggingoutputlevel --showduplicatesshowduplicates,inrepos,inlist/searchcommands -e[errorlevel]erroroutputlevel -q,--quietquietoperation -v,--verboseverboseoperation -yansweryesforallquestions --versionshowYumversionandexit --installroot=[path]setinstallroot --enablerepo=[repo]enableoneormorerepositories(wildcardsallowed) --disablerepo=[repo]disableoneormorerepositories(wildcardsallowed) -x[package],--exclude=[package] excludepackage(s)bynameorglob --disableexcludes=[repo] disableexcludefrommain,forarepoorfor everything --obsoletesenableobsoletesprocessingduringupdates --nopluginsdisableYumplugins --nogpgcheckdisablegpgsignaturechecking --disableplugin=[plugin] disablepluginsbyname --enableplugin=[plugin] enablepluginsbyname --skip-brokenskippackageswithdepsolvingproblems --color=COLORcontrolwhethercolorisused PluginOptions:
最后,赶紧更新一下系统吧
yumupdate
好了这样yum问题就完全解决了!大家可以尝试下,感谢你对毛票票的支持。
声明:本文内容来源于网络,版权归原作者所有,内容由互联网用户自发贡献自行上传,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任。如果您发现有涉嫌版权的内容,欢迎发送邮件至:czq8825#qq.com(发邮件时,请将#更换为@)进行举报,并提供相关证据,一经查实,本站将立刻删除涉嫌侵权内容。