redhat卸载YUM后安装YUM

回复 收藏
本帖最后由 kuruite 于 2016-1-11 00:13 编辑

  给redhat5.9安装一个FTP的客户端,总是提示 error while loading shared libraries: libgio-2.0.so.0: cannot open shared object file: No such file or directory,就想着换个YUM源试试,结果操作失误把YUM给卸载掉了,当时我的那个心啊,想拿豆腐给撞死。
  首先检查Python有没有被卸载掉,直接运行python,看有没提示版本什么的,如果Python也被卸载了,那就麻烦多了,就要用rpm安装,然后一个一个的下载安装依赖包,或者源码编译安装python了,这里我就不说怎么安了。
11.png


开始安装yum遇到了要安各种依赖包,让人崩溃啊, 安装了rpmdb想解决依赖,结果点反应都没有,这个方法就这样结束了。利用了科学上网才找到了rpmdb的包,百度还找不到。rpm不行,我就源码安装yum呗,安装报错就如图
22.png

Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Traceback (most recent call last):
  File "/usr/bin/yum", line 29, in ?
    yummain.user_main(sys.argv[1:], exit_code=True)
  File "/usr/share/yum-cli/yummain.py", line 309, in user_main
    errcode = main(args)
  File "/usr/share/yum-cli/yummain.py", line 178, in main
    result, resultmsgs = base.doCommands()
  File "/usr/share/yum-cli/cli.py", line 345, in doCommands
    self._getTs(needTsRemove)
  File "/usr/lib/python2.4/site-packages/yum/depsolve.py", line 101, in _getTs
    self._getTsInfo(remove_only)
  File "/usr/lib/python2.4/site-packages/yum/depsolve.py", line 112, in _getTsInfo
    pkgSack = self.pkgSack
  File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 661, in
    pkgSack = property(fget=lambda self: self._getSacks(),
  File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 501, in _getSacks
    self.repos.populateSack(which=repos)
  File "/usr/lib/python2.4/site-packages/yum/repos.py", line 232, in populateSack
    self.doSetup()
  File "/usr/lib/python2.4/site-packages/yum/repos.py", line 79, in doSetup
    self.ayum.plugins.run('postreposetup')
  File "/usr/lib/python2.4/site-packages/yum/plugins.py", line 179, in run
    func(conduitcls(self, self.base, conf, **kwargs))
  File "/usr/lib/yum-plugins/fastestmirror.py", line 181, in postreposetup_hook
    all_urls = FastestMirror(all_urls).get_mirrorlist()
  File "/usr/lib/yum-plugins/fastestmirror.py", line 333, in get_mirrorlist
    self._poll_mirrors()
  File "/usr/lib/yum-plugins/fastestmirror.py", line 376, in _poll_mirrors
    pollThread.start()
  File "/usr/lib/python2.4/threading.py", line 416, in start
    _start_new_thread(self.__bootstrap, ())
thread.error: can't start new thread
有的资料就说如果不安装python-urlgrabber,python-pycurl,yum-metadata-parser这3个包的话,在下面运行./yummain.py install yum的话会报以下错误,我把这三个包下了安装也是缺少各种依赖,也没办法进行啊!!
我在网易源上去下载这些包,因为这次系统是redhat,所以考虑在之前先要对比redhat跟centos的内核,参考资料yum-3.2.22-20.el5.centos.noarch.rpm ,yum-metadata-parser-1.1.2-3.el5.centos.i386.rpm
python-iniparse-0.2.3-4.el5.noarch.rpm yum-fastestmirror-1.1.16-13.el5.centos.noarch.rpm
rpm安装这4个包,除了Python提示已经安装外,yum的这三个包居然都安装成功了,yum就又能用了。
YUM 是恢复了但是 libgio-2.0.so.0还没解决,后面接着弄吧,这个文档就记录到这里吧!



欢迎大家多多指点!
http://debris.blog.51cto.com/1614432/1733588

2016-01-10 23:57 举报
已邀请:
0

迷城

赞同来自:

{:4_92:}
0

huanglin

赞同来自:

经验之谈呀!受教了 想起铭哥说的 rm -rf 命令好用 但在回车是要确认一下 思考两秒{:7_180:}

回复帖子,请先登录注册

退出全屏模式 全屏模式 回复
评分
可选评分理由: