`

SSLCertificateFileNotFound 错误解决。

阅读更多

 

客户有台机器装的是红帽,但不想用官方的rpm源做更新,并且在yum update的时候,发现出了如下错误:

 

[root@localhost ~]# yum update
Loading "rhnplugin" plugin
Loading "security" plugin
Traceback (most recent call last):
  File "/usr/bin/yum", line 29, in ?
    yummain.main(sys.argv[1:])
  File "/usr/share/yum-cli/yummain.py", line 85, in main
    base.getOptionsConfig(args)
  File "/usr/share/yum-cli/cli.py", line 163, in getOptionsConfig
    disabled_plugins=self.optparser._splitArg(opts.disableplugins))
  File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 183, in _getConfig
    self.plugins.run('init')
  File "/usr/lib/python2.4/site-packages/yum/plugins.py", line 169, in run
    func(conduitcls(self, self.base, conf, **kwargs))
  File "/usr/lib/yum-plugins/rhnplugin.py", line 109, in init_hook
    login_info = up2dateAuth.getLoginInfo()
  File "/usr/share/rhn/up2date_client/up2dateAuth.py", line 211, in getLoginInfo
    login()
  File "/usr/share/rhn/up2date_client/up2dateAuth.py", line 162, in login
    server = rhnserver.RhnServer()
  File "/usr/share/rhn/up2date_client/rhnserver.py", line 147, in __init__
    self._server = rpcServer.getServer()
  File "/usr/share/rhn/up2date_client/rpcServer.py", line 168, in getServer
    raise up2dateErrors.SSLCertificateFileNotFound(msg)
up2date_client.up2dateErrors.SSLCertificateFileNotFound: ERROR: can not find RHNS CA file: /usr/share/rhn/RHN-ORG-TRUSTED-SSL-CERT

 

,希望用开源的,找了找"redhat yum配置"的文章,发现这个(http://blog.m6699.com/diomedea/article/29966.html)验证是对的。按照步骤来:


[root@localhost etc]# mv /etc/yum.conf /etc/yum.conf.bak
[root@localhost etc]# vi /etc/yum.conf
[main]
cachedir=/var/cache/yum
keepcache=1
debuglevel=2
logfile=/var/log/yum.log
pkgpolicy=newest
distroverpkg=redhat-release
tolerant=1
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1
metadata_expire=1800
# PUT YOUR REPOS HERE OR IN separate files named file.repo
# in /etc/yum.repos.d
[base]
name=centos-5 - Base
baseurl=http://centos.ustc.edu.cn/centos/5/os/i386/
# the other site: http://centos.candishosting.com.cn/centos/5/os/i386/
# you can find more site in: http://www.centos.org/modules/tinycontent/index.php?id=13
enabled=1
gpgcheck=1
gpgkey=http://centos.ustc.edu.cn/centos/5/os/i386/RPM-GPG-KEY-CentOS-5
#released updates
[update]
name=CentOS-5 - Updates
baseurl=http://mirror.centos.org/centos/5/updates/i386/
gpgcheck=1
gpgkey=http://centos.ustc.edu.cn/centos/5/os/i386/RPM-GPG-KEY-CentOS-5
#packages used/produced in the build but not released
[addons]
name=CentOS-5 - Addons
baseurl=http://mirror.centos.org/centos/5/addons/$basearch/
gpgcheck=1
gpgkey=http://centos.ustc.edu.cn/centos/5/os/i386/RPM-GPG-KEY-CentOS-5
#additional packages that may be useful
[extras]
name=CentOS-5 - Extras
baseurl=http://mirror.centos.org/centos/5/extras/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-5 - Plus
baseurl=http://mirror.centos.org/centos/5/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://centos.ustc.edu.cn/centos/5/os/i386/RPM-GPG-KEY-CentOS-5
#contrib - packages by Centos Users
[contrib]
name=CentOS-5 - Contrib
baseurl=http://mirror.centos.org/centos/5/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://centos.ustc.edu.cn/centos/5/os/i386/RPM-GPG-KEY-CentOS-5
#packages in testing
[testing]
name=CentOS-5 - Testing
baseurl=http://mirror.centos.org/centos/5/testing/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://centos.ustc.edu.cn/centos/5/os/i386/RPM-GPG-KEY-CentOS-5

 

 

但还是发现有原先的错误:


[root@localhost etc]# yum update
Loading "rhnplugin" plugin
Loading "security" plugin
Traceback (most recent call last):
  File "/usr/bin/yum", line 29, in ?
    yummain.main(sys.argv[1:])
  File "/usr/share/yum-cli/yummain.py", line 85, in main
    base.getOptionsConfig(args)
  File "/usr/share/yum-cli/cli.py", line 163, in getOptionsConfig
    disabled_plugins=self.optparser._splitArg(opts.disableplugins))
  File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 183, in _getConfig
    self.plugins.run('init')
  File "/usr/lib/python2.4/site-packages/yum/plugins.py", line 169, in run
    func(conduitcls(self, self.base, conf, **kwargs))
  File "/usr/lib/yum-plugins/rhnplugin.py", line 109, in init_hook
    login_info = up2dateAuth.getLoginInfo()
  File "/usr/share/rhn/up2date_client/up2dateAuth.py", line 211, in getLoginInfo
    login()
  File "/usr/share/rhn/up2date_client/up2dateAuth.py", line 162, in login
    server = rhnserver.RhnServer()
  File "/usr/share/rhn/up2date_client/rhnserver.py", line 147, in __init__
    self._server = rpcServer.getServer()
  File "/usr/share/rhn/up2date_client/rpcServer.py", line 168, in getServer
    raise up2dateErrors.SSLCertificateFileNotFound(msg)
up2date_client.up2dateErrors.SSLCertificateFileNotFound: ERROR: can not find RHNS CA file: /usr/share/rhn/RHN-ORG-TRUSTED-SSL-CERT


执行了下面这个也不行,
[root@localhost etc]# yum clean all
Loading "rhnplugin" plugin
Loading "security" plugin
Cleaning up Everything
[root@localhost etc]# yum install system-config-date
Loading "rhnplugin" plugin
Loading "security" plugin
Traceback (most recent call last):
  File "/usr/bin/yum", line 29, in ?
    yummain.main(sys.argv[1:])
  File "/usr/share/yum-cli/yummain.py", line 85, in main
    base.getOptionsConfig(args)
  File "/usr/share/yum-cli/cli.py", line 163, in getOptionsConfig
    disabled_plugins=self.optparser._splitArg(opts.disableplugins))
  File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 183, in _getConfig
    self.plugins.run('init')
  File "/usr/lib/python2.4/site-packages/yum/plugins.py", line 169, in run
    func(conduitcls(self, self.base, conf, **kwargs))
  File "/usr/lib/yum-plugins/rhnplugin.py", line 109, in init_hook
    login_info = up2dateAuth.getLoginInfo()
  File "/usr/share/rhn/up2date_client/up2dateAuth.py", line 211, in getLoginInfo
    login()
  File "/usr/share/rhn/up2date_client/up2dateAuth.py", line 162, in login
    server = rhnserver.RhnServer()
  File "/usr/share/rhn/up2date_client/rhnserver.py", line 147, in __init__
    self._server = rpcServer.getServer()
  File "/usr/share/rhn/up2date_client/rpcServer.py", line 168, in getServer
    raise up2dateErrors.SSLCertificateFileNotFound(msg)
up2date_client.up2dateErrors.SSLCertificateFileNotFound: ERROR: can not find RHNS CA file: /usr/share/rhn/RHN-ORG-TRUSTED-SSL-CERT

 

估计是原先的插件的问题,就看了看这个:


[root@localhost etc]# rpm -qa|grep yum
yum-3.2.8-9.el5
yum-updatesd-0.9-2.el5
yum-rhn-plugin-0.5.3-6.el5
yum-metadata-parser-1.1.2-2.el5

yum-security-1.1.10-9.el5

 

就删除了这个原先系统自带的插件:
[root@localhost etc]# rpm -e yum-rhn-plugin-0.5.3-6.el5
[root@localhost etc]# yum clean all
Loading "security" plugin
Cleaning up Everything
[root@localhost etc]# yum install system-config-date
Loading "security" plugin
update                    100% |=========================| 1.9 kB    00:00    
primary.sqlite.bz2        100% |=========================| 459 kB    01:26    
base                      100% |=========================| 2.1 kB    00:00    
primary.sqlite.bz2        100% |=========================| 1.6 MB    00:07    
addons                    100% |=========================|  951 B    00:00    
primary.xml.gz            100% |=========================|  201 B    00:00    
extras                    100% |=========================| 1.1 kB    00:00    
primary.xml.gz            100% |=========================| 107 kB    00:07    
extras    : ################################################## 325/325
Setting up Install Process
Parsing package install arguments
Resolving Dependencies
--> Running transaction check
---> Package system-config-date.noarch 0:1.8.12-4.el5.centos set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

=============================================================================
 Package                 Arch       Version          Repository        Size
=============================================================================
Updating:
 system-config-date      noarch     1.8.12-4.el5.centos  base              1.5 M

Transaction Summary
=============================================================================
Install      0 Package(s)        
Update       1 Package(s)        
Remove       0 Package(s)        

Total download size: 1.5 M
Is this ok [y/N]: y
Downloading Packages:
(1/1): system-config-date 100% |=========================| 1.5 MB    00:14    
warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID e8562897
Importing GPG key 0xE8562897 "CentOS-5 Key (CentOS 5 Official Signing Key) <centos-5-key@centos.org>" from http://centos.ustc.edu.cn/centos/5/os/i386/RPM-GPG-KEY-CentOS-5
Is this ok [y/N]: y
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Updating  : system-config-date           ######################### [1/2]
  Cleanup   : system-config-date           ######################### [2/2]

Updated: system-config-date.noarch 0:1.8.12-4.el5.centos
Complete!
[root@localhost etc]#

 

这下就好了。

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics