背景
有使用较老的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_302return self.parent.open(new)File "/usr/lib64/python2.4/urllib2.py", line 358, in openresponse = 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_chainresult = func(*args)File "/usr/lib64/python2.4/site-packages/M2Crypto/m2urllib2.py", line 82, in https_openh.request(req.get_method(), req.get_selector(), req.data, headers)File "/usr/lib64/python2.4/httplib.py", line 810, in requestself._send_request(method, url, body, headers)File "/usr/lib64/python2.4/httplib.py", line 833, in _send_requestself.endheaders()File "/usr/lib64/python2.4/httplib.py", line 804, in endheadersself._send_output()File "/usr/lib64/python2.4/httplib.py", line 685, in _send_outputself.send(msg)File "/usr/lib64/python2.4/httplib.py", line 652, in sendself.connect()File "/usr/lib64/python2.4/site-packages/M2Crypto/httpslib.py", line 55, in connectsock.connect((self.host, self.port))File "/usr/lib64/python2.4/site-packages/M2Crypto/SSL/Connection.py", line 174, in connectret = self.connect_ssl()File "/usr/lib64/python2.4/site-packages/M2Crypto/SSL/Connection.py", line 167, in connect_sslreturn m2.ssl_connect(self.ssl, self._timeout)
M2Crypto.SSL.SSLError: unknown protocol
参考:
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