{"id":227,"date":"2013-08-11T13:16:22","date_gmt":"2013-08-11T05:16:22","guid":{"rendered":"http:\/\/www.zyuns.com\/?p=227"},"modified":"2015-02-15T20:56:20","modified_gmt":"2015-02-15T12:56:20","slug":"yun-xing-yum-bao-cuo-xiu-fu","status":"publish","type":"post","link":"https:\/\/www.siediyer.cn\/?p=227","title":{"rendered":"\u8fd0\u884cyum\u62a5\u9519\u3001\u4fee\u590d"},"content":{"rendered":"<p>\u73b0\u8c61\uff1a\u8fd0\u884cyum\u62a5\u9519\uff0c\u81ea\u5df1\u5f04\u4e86\u4e8c\u5929\u6ca1\u6709\u641e\u5b9a\uff0c\u8fd0\u7ef4\u540c\u4e8b\u5f04\u597d\u4e86\u3002\u3010\u81ea\u6d4b\u8bd5\uff0c\u53ef\u7528\u3011<\/p>\n<pre class=\"wrap:true lang:default decode:true \">#########\n[ivy@testmimmsTO ~]$ yum\nThere was a problem importing one of the Python modules\nrequired to run yum. The error leading to this problem was:\n   No module named yum\nPlease install a package which provides this module, or\nverify that the module is installed correctly.\nIt's possible that the above module doesn't match the\ncurrent version of Python, which is:\n2.4.3 (#1, Dec 10 2010, 17:24:35)\n[GCC 4.1.2 20080704 (Red Hat 4.1.2-50)]\nIf you cannot solve this problem yourself, please go to\nthe yum faq at:\n  http:\/\/wiki.linux.duke.edu\/YumFaq\n###########<\/pre>\n<p>&nbsp;<\/p>\n<p>\u5206\u6790Python\u6545\u969c\uff08\u7cfb\u7edf\u5347\u7ea7\u6240\u81f4\uff09<br \/>\n\u6309\u65b9\u6848\u4e00\u89e3\u51b3\u672b\u679c<\/p>\n<p>\u65b9\u6848\u4e00<\/p>\n<pre class=\"wrap:true lang:default decode:true \">vi \/usr\/bin\/yum\n\"\u5c06 #!\/usr\/bin\/python \u4fee\u6539\u4e3a #!\/usr\/bin\/python2.4\"\n\u6216\u8005\u4fee\u6539:\nrm -rf \/usr\/bin\/python\nln -s \/usr\/bin\/python2.4 \/usr\/bin\/python<\/pre>\n<p>\u65b9\u6848\u4e8c\u00a0\u91cd\u65b0\u5b89\u88c5python\u548cyum<\/p>\n<pre class=\"wrap:true lang:default decode:true \">1.\u5220\u9664\u539f\u6709Python\nrpm -qa|grep python|xargs rpm -ev --allmatches --nodeps ##\u5f3a\u5236\u5220\u9664\u5df2\u5b89\u88c5\u7a0b\u5e8f\u53ca\u5176\u5173\u8054\nwhereis python |xargs rm -frv ##\u5220\u9664\u6240\u6709\u6b8b\u4f59\u6587\u4ef6 ##xargs\uff0c\u5141\u8bb8\u4f60\u5bf9\u8f93\u51fa\u6267\u884c\u5176\u4ed6\u67d0\u4e9b\u547d\u4ee4\nwhereis python ##\u9a8c\u8bc1\u5220\u9664\uff0c\u8fd4\u56de\u65e0\u7ed3\u679c\n\n2.\u83b7\u53d6python\u5b89\u88c5\u5305\nmount \/dev\/cdrom \/mnt\/cdrom\ncd \/mnt\/cdrom\/Server\nmkdir \/home\/***\/src\nmkdir \/home\/***\/src\/pythonrpm\ncp python*.rpm \/home\/****\/src\/pythonrpm\/\ncp lib*-python*.rpm \/home\/****\/src\/pythonrpm\/\ncd \/home\/ivy\/src\/pythonrpm\nrm -v python-ldap*.rpm\nrpm -ivh *.rpm\nwhereis python ##\u9a8c\u8bc1\u5b89\u88c5\uff0c\u8fd4\u56depython: \/usr\/bin\/python2.4 \/usr\/bin\/python\uff0c\u5373\u53ef\n\n 3.\u5220\u9664\u539f\u6709yum \u8fd0\u884c rpm -qa|grep yum \uff1b\u8fd0\u884crpm -e --nodeps \u5220\u9664\u6240\u6709\u8ddfyum\u6709\u5173\u7684\u5305\uff08\u5f3a\u5236\u5220\u9664\uff09\nrm -rf \/etc\/yum.repos.d\/*\nwhereis yum ##\u9a8c\u8bc1\u5f53\u524d\u5b89\u88c5\uff0c\u8fd4\u56deyum: \/usr\/bin\/yum \/etc\/yum.conf \/etc\/yum\nrpm -qa |grep yum ##\u9a8c\u8bc1\u5f53\u524d\u5b89\u88c5\u5305\nrpm -qa|grep yum|xargs rpm -e --nodeps ##\u5220\u9664\u5f53\u524d\u5b89\u88c5\nwhereis yum ##\u9a8c\u8bc1\u5220\u9664\uff0c\u8fd4\u56de\u65e0\u7ed3\u679c\uff0c\u82e5\u5426\u5219\u8fd0\u884c\u4e0b\u547d\u4ee4\nwhereis yum |xargs rm -rfv\n\n  \u83b7\u53d6yum\u5b89\u88c5\u5305\uff08\u672c\u4f8b\u6e90\u66f4\u6539\u4e3acentos,\u6545\u4e0b\u8f7dcentos\u5b89\u88c5\u5305\u53ca\u914d\u7f6e\u6587\u4ef6\uff09\ncd \/home\/***\/src\nmkdir yumrpm\ncd yumrpm\nwget http:\/\/mirror.centos.org\/centos-5\/5\/os\/x86_64\/CentOS\/yum-metadata-parser-1.1.2-3.el5.centos.x86_64.rpm\nwget http:\/\/mirror.centos.org\/centos-5\/5\/os\/x86_64\/CentOS\/yum-fastestmirror-1.1.16-21.el5.centos.noarch.rpm\nwget http:\/\/mirror.centos.org\/centos-5\/5\/os\/x86_64\/CentOS\/yum-3.2.22-39.el5.centos.noarch.rpm\nwget http:\/\/docs.linuxtone.org\/soft\/lemp\/CentOS-Base.repo\nrpm -ivh *.rpm\ncp CentOS-Base.repo \/etc\/yum.repos.d\/\nyum makecache\n\n\u6d4b\u8bd5yum\nyum list |grep telnet\nyum remove telnet\nyum install telnet\n\n  \u5fc5\u8981\u65f6\u505a\ncp RPM-GPG-KEY-CentOS-5 \/home\/***\/src\ncd \/home\/***\/src\nrpm --import RPM-GPG-KEY-CentOS-5<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u73b0\u8c61\uff1a\u8fd0\u884cyum\u62a5\u9519\uff0c\u81ea\u5df1\u5f04\u4e86\u4e8c\u5929\u6ca1\u6709\u641e\u5b9a\uff0c\u8fd0\u7ef4\u540c\u4e8b\u5f04\u597d\u4e86\u3002\u3010\u81ea\u6d4b\u8bd5\uff0c\u53ef\u7528\u3011 ######### [ivy@t [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-227","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.siediyer.cn\/index.php?rest_route=\/wp\/v2\/posts\/227","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.siediyer.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.siediyer.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.siediyer.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.siediyer.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=227"}],"version-history":[{"count":1,"href":"https:\/\/www.siediyer.cn\/index.php?rest_route=\/wp\/v2\/posts\/227\/revisions"}],"predecessor-version":[{"id":470,"href":"https:\/\/www.siediyer.cn\/index.php?rest_route=\/wp\/v2\/posts\/227\/revisions\/470"}],"wp:attachment":[{"href":"https:\/\/www.siediyer.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=227"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.siediyer.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=227"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.siediyer.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=227"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}