背景

有使用较老的Centos 5 系统内部安装软件无法正常报错,是由于系统叫老yum源存在问题

处理方法

更换下述yum源,可以将其他repo源文件备份移动到其他目录,添加下述源后重新测试

[C5.11-base]
name=CentOS-5.11     
baseurl=http://vault.centos.org/5.11/os/$basearch/gpgcheck=1
#gpgkey= file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5    如果出现下述报错将此行注释
enabled=1

临时解决就是换个不同的镜像,比如:
baseurl= http://archive.kernel.org/centos-vault/5.11/os/$basearch/

如果出现下述报错提示

result = func(*args)
  File "/usr/lib64/python2.4/urllib2.py", line 565, in http_error_302
    return self.parent.open(new)
  File "/usr/lib64/python2.4/urllib2.py", line 358, in open
    response = self._open(req, data)
  File "/usr/lib64/python2.4/urllib2.py", line 376, in _open
    '_open', req)
  File "/usr/lib64/python2.4/urllib2.py", line 337, in _call_chain
    result = func(*args)
  File "/usr/lib64/python2.4/site-packages/M2Crypto/m2urllib2.py", line 82, in https_open
    h.request(req.get_method(), req.get_selector(), req.data, headers)
  File "/usr/lib64/python2.4/httplib.py", line 810, in request
    self._send_request(method, url, body, headers)
  File "/usr/lib64/python2.4/httplib.py", line 833, in _send_request
    self.endheaders()
  File "/usr/lib64/python2.4/httplib.py", line 804, in endheaders
    self._send_output()
  File "/usr/lib64/python2.4/httplib.py", line 685, in _send_output
    self.send(msg)
  File "/usr/lib64/python2.4/httplib.py", line 652, in send
    self.connect()
  File "/usr/lib64/python2.4/site-packages/M2Crypto/httpslib.py", line 55, in connect
    sock.connect((self.host, self.port))
  File "/usr/lib64/python2.4/site-packages/M2Crypto/SSL/Connection.py", line 174, in connect
    ret = self.connect_ssl()
  File "/usr/lib64/python2.4/site-packages/M2Crypto/SSL/Connection.py", line 167, in connect_ssl
    return m2.ssl_connect(self.ssl, self._timeout)
M2Crypto.SSL.SSLError: unknown protocol

Centos 5 的yum源_python

参考: https://bugs.centos.org/view.php?id=18345

修改成如下信息:

[root@xxxx  yum.repos.d]# cat CentOS-Base.repo
[5.11-base]
name=CentOS-5.11 - Base
#baseurl=http://vault.centos.org/5.11/os/$basearch/gpgcheck=1
baseurl= http://archive.kernel.org/centos-vault/5.11/os/$basearch/
gpgcheck=1
#gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
enabled=1

Centos 5 的yum源_centos_02