1. 程式人生 > >yum 崩潰的解決方法

yum 崩潰的解決方法

yum

yum 崩潰的解決方法

唔、一個用戶寶塔登陸界面一直是打轉轉,

技術分享圖片

看日誌把日誌顯示



119.147.144.162:49468 - - [05/Jun/2018 16:10:23] "HTTP/1.1 GET /favicon.ico" - 500 Internal Server ErrorTraceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/web/application.py", line 237, in process    return p(lambda: process(processors))
  File "/usr/local/lib/python2.7/site-packages/web/session.py", line 85, in _processor
    self._load()
  File "/usr/local/lib/python2.7/site-packages/web/session.py", line 106, in _load
    d = self.store[self.session_id]
  File "/usr/local/lib/python2.7/site-packages/web/session.py", line 303, in __getitem__    return self.decode(s.data)
  File "/usr/local/lib/python2.7/site-packages/web/session.py", line 209, in decode
    pickled = base64.decodestring(session_data)
  File "/usr/local/lib/python2.7/base64.py", line 328, in decodestring    return binascii.a2b_base64(s)Error: Incorrect padding119.147.144.162:49468 - - [05/Jun/2018 16:10:23] "HTTP/1.1 GET /login" - 500 Internal Server ErrorTraceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/web/application.py", line 237, in process    return p(lambda: process(processors))
  File "/usr/local/lib/python2.7/site-packages/web/session.py", line 85, in _processor
    self._load()
  File "/usr/local/lib/python2.7/site-packages/web/session.py", line 106, in _load
    d = self.store[self.session_id]
  File "/usr/local/lib/python2.7/site-packages/web/session.py", line 303, in __getitem__    return self.decode(s.data)
  File "/usr/local/lib/python2.7/site-packages/web/session.py", line 209, in decode
    pickled = base64.decodestring(session_data)
  File "/usr/local/lib/python2.7/base64.py", line 328, in decodestring    return binascii.a2b_base64(s)Error: Incorrect padding


唔。找了很久。最後發現竟然是yum 有問題。emmmmm 報錯如下:

[root@iZdt4mpwkybe8hZ tmp]# yum install wget  There was a problem importing one of the Python modules required to run yum. The error leading to this problem was:

   No module named yumPlease install a package which provides this module, or
verify that the module is installed correctly.It's possible that the above module doesn't match the
current version of Python, which is:2.7.15 (default, Jun  5 2018, 13:52:24) [GCC 4.8.5 20150623 (Red Hat 4.8.5-16)]If you cannot solve this problem yourself, please go to 
the yum faq at:
  http://yum.baseurl.org/wiki/Faq


看著網上哪些人說,修改一下/use/bin/yum

修改了第一行為


[root@iZdt4mpwkybe8hZ tmp]# vi /usr/bin/yum 

#!/usr/bin/python2import systry:
    import yum
except ImportError:
    print >> sys.stderr, """\There was a problem importing one of the Python modules
required to run yum. The error leading to this problem was:

   %sPlease install a package which provides this module, or
verify that the module is installed correctly.It's possible that the above module doesn't match the
current version of Python, which is:%sIf you cannot solve this problem yourself, please go to
the yum faq at:
  http://yum.baseurl.org/wiki/Faq""" % (sys.exc_value, sys.version)
    sys.exit(1)sys.path.insert(0, '/usr/share/yum-cli')try:
    import yummain
    yummain.user_main(sys.argv[1:], exit_code=True)except KeyboardInterrupt, e:
    print >> sys.stderr, "\n\nExiting on user cancel."
    sys.exit(1)


emmm 結果很尷尬的


[root@iZdt4mpwkybe8hZ tmp]# yum  install wget 
Loaded plugins: fastestmirror
base                                                                                                      | 3.6 kB  00:00:00     epel                                                                                                      | 3.2 kB  00:00:00     extras                                                                                                    | 3.4 kB  00:00:00     updates                                                                                                   | 3.4 kB  00:00:00     Traceback (most recent call last):
  File "/usr/libexec/urlgrabber-ext-down", line 22, in <module>
    from urlgrabber.grabber import \ImportError: No module named urlgrabber.grabberTraceback (most recent call last):
  File "/usr/libexec/urlgrabber-ext-down", line 22, in <module>
    from urlgrabber.grabber import \ImportError: No module named urlgrabber.grabberTraceback (most recent call last):Traceback (most recent call last):
  File "/usr/libexec/urlgrabber-ext-down", line 22, in <module>
    from urlgrabber.grabber import \ImportError: No module named urlgrabber.grabber  File "/usr/libexec/urlgrabber-ext-down", line 22, in <module>
    from urlgrabber.grabber import \ImportError: No module named urlgrabber.grabber


唔看了一下報錯。發現沒有這個模塊,那麽pip 安裝一個把


[root@iZdt4mpwkybe8hZ yum.repos.d]# pip install urlgrabberLooking in indexes: https://pypi.doubanio.com/simple/Collecting urlgrabber  Downloading https://pypi.doubanio.com/packages/29/1a/f509987826e17369c52a80a07b257cc0de3d7864a303175f2634c8bcb3e3/urlgrabber-3.10.2.tar.gz (84kB)
    100% |████████████████████████████████| 92kB 5.7MB/s 
Building wheels for collected packages: urlgrabber  Running setup.py bdist_wheel for urlgrabber ... done  Stored in directory: /root/.cache/pip/wheels/fc/d8/3b/06e617fb35ebe30fc48412a2963a17e9b88e2d21f9f40c8e01Successfully built urlgrabberInstalling collected packages: urlgrabberSuccessfully installed urlgrabber-3.10.2


唔安裝成功,那麽再用一下yum 把


[root@iZdt4mpwkybe8hZ yum.repos.d]# yum  install python-pipLoaded plugins: fastestmirrorLoading mirror speeds from cached hostfileTraceback (most recent call last):
  File "/usr/libexec/urlgrabber-ext-down", line 22, in <module>
    from urlgrabber.grabber import \  File "/usr/local/lib/python2.7/site-packages/urlgrabber/__init__.py", line 55, in <module>
    from grabber import urlgrab, urlopen, urlread  File "/usr/local/lib/python2.7/site-packages/urlgrabber/grabber.py", line 532, in <module>
    Traceback (most recent call last):
  File "/usr/libexec/urlgrabber-ext-down", line 22, in <module>
    import pycurlImportErrorfrom urlgrabber.grabber import \  File "/usr/local/lib/python2.7/site-packages/urlgrabber/__init__.py", line 55, in <module>: No module named pycurl    
from grabber import urlgrab, urlopen, urlread  File "/usr/local/lib/python2.7/site-packages/urlgrabber/grabber.py", line 532, in <module>
    import pycurlImportError: No module named pycurlTraceback (most recent call last):
  File "/usr/libexec/urlgrabber-ext-down", line 22, in <module>
    from urlgrabber.grabber import \  File "/usr/local/lib/python2.7/site-packages/urlgrabber/__init__.py", line 55, in <module>
    from grabber import urlgrab, urlopen, urlread  File "/usr/local/lib/python2.7/site-packages/urlgrabber/grabber.py", line 532, in <module>
    import pycurlImportError: No module named pycurl


唔還是報錯。安裝一下pycurl 把


[root@iZdt4mpwkybe8hZ yum.repos.d]# pip install pycurlLooking in indexes: https://pypi.doubanio.com/simple/Collecting pycurl  Downloading https://pypi.doubanio.com/packages/e8/e4/0dbb8735407189f00b33d84122b9be52c790c7c3b25286826f4e1bdb7bde/pycurl-7.43.0.2.tar.gz (214kB)
    100% |████████████████████████████████| 215kB 11.5MB/s 
    Complete output from command python setup.py egg_info:
    Using curl-config (libcurl 7.29.0)
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-xDCpxU/pycurl/setup.py", line 913, in <module>
        ext = get_extension(sys.argv, split_extension_source=split_extension_source)
      File "/tmp/pip-install-xDCpxU/pycurl/setup.py", line 582, in get_extension
        ext_config = ExtensionConfiguration(argv)
      File "/tmp/pip-install-xDCpxU/pycurl/setup.py", line 99, in __init__
        self.configure()
      File "/tmp/pip-install-xDCpxU/pycurl/setup.py", line 316, in configure_unix
        specify the SSL backend manually.''')
    __main__.ConfigurationError: Curl is configured to use SSL, but we have not been able to determine which SSL backend it is using. Please see PycURL documentation for how to specify the SSL backend manually.
    
    ----------------------------------------Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-xDCpxU/pycurl/

emmm 竟然報錯. tmd 那麽就編譯一個把


下載pycurl:http://pycurl.sourceforge.net/download/pycurl-7.19.0.tar.gztar xzf pycurl-7.19.0.tar.gz
python setup.py install

然後測試一下



[root@iZdt4mpwkybe8hZ tmp]# python 
Python 2.7.15 (default, Jun  5 2018, 13:52:24) [GCC 4.8.5 20150623 (Red Hat 4.8.5-16)] on linux2Type "help", "copyright", "credits" or "license" for more information.>>> import pycurl>>>


如果出現問題。那麽就這樣編譯


提示如下錯誤:Traceback (most recent call last):
  File "<stdin>", line 1, in ?ImportError: No module named pycurl檢查一下,原來是pycurl自己假定的curl路徑不對。需要給pycurl指定curl-config 路徑,如下所示:python setup.py install --curl-config=/usr/local/bin/curl-config問題很小,有點隱蔽
[root@iZdt4mpwkybe8hZ pycurl-7.19.0]# yum install wget 
Loaded plugins: fastestmirrorLoading mirror speeds from cached hostfile(1/3): extras/7/x86_64/primary_db                                                                         | 147 kB  00:00:00     (2/3): updates/7/x86_64/primary_db                                                                        | 2.0 MB  00:00:00     (3/3): base/7/x86_64/primary_db                                                                           | 5.9 MB  00:00:00     epel/x86_64/primary                                                                                       | 3.5 MB  00:00:00     epel                                                                                                                 12585/12585Package wget-1.14-15.el7_4.1.x86_64 already installed and latest versionNothing to do


唔搞定了!!!!!

技術分享圖片

yum 崩潰的解決方法