yum clean all 给出多个字符串错误

yum clean all 给出多个字符串错误

当我尝试将实例连接到卫星服务器时,它失败了。我尝试执行基本的系统更新并尝试运行 yum clean all。但是,我收到以下几行:

Traceback (most recent call last):
  File "/usr/bin/yum", line 29, in <module>
    yummain.user_main(sys.argv[1:], exit_code=True)
  File "/usr/share/yum-cli/yummain.py", line 300, in user_main
    errcode = main(args)
  File "/usr/share/yum-cli/yummain.py", line 115, in main
    base.getOptionsConfig(args)
  File "/usr/share/yum-cli/cli.py", line 229, in getOptionsConfig
    self.conf
  File "/usr/lib/python2.6/site-packages/yum/__init__.py", line 911, in <lambda>
    conf = property(fget=lambda self: self._getConfig(),
  File "/usr/lib/python2.6/site-packages/yum/__init__.py", line 363, in _getConfig
    self.plugins.run('init')
  File "/usr/lib/python2.6/site-packages/yum/plugins.py", line 184, in run
    func(conduitcls(self, self.base, conf, **kwargs))
  File "/usr/share/yum-plugins/ulninfo.py", line 23, in init_hook
    login_info = up2dateAuth.getLoginInfo(timeout=timeout)
  File "/usr/share/rhn/up2date_client/up2dateAuth.py", line 219, in getLoginInfo
    login(timeout=timeout)
  File "/usr/share/rhn/up2date_client/up2dateAuth.py", line 167, in login
    if readCachedLogin():
  File "/usr/share/rhn/up2date_client/up2dateAuth.py", line 133, in readCachedLogin
    expireTime = float(li['X-RHN-Auth-Expiration'])
KeyError: 'X-RHN-Auth-Expiration'

有人可以解释一下吗?

答案1

检查您的订阅状态,它可能会导致此错误。不过,老实说,我不知道为什么要“全部清理”。最后的“KeyError”引起了我的好奇心。

subscription-manager status
subscription-manager list

答案2

这是一个简单的修复方法。我发现rhnreg在多个服务器上同时运行该命令以在 spacewalk/redhat 卫星上注册客户端会导致此问题。例如,我在 4 台服务器上运行此命令,但只有一台服务器注册成功。

我的 3 台服务器抛出了上述相同的错误。这是我为解决该问题所做的事情。

备份了我当前的up2dateAuth.py文件

 cp /usr/share/rhn/up2date_client/up2dateAuth.py /usr/share/rhn/up2date_client/up2dateAuth.py_`date +%m_%d_%Y`

scp从第一台已成功注册到太空行走服务器的服务器上进行了操作。

 scp /usr/share/rhn/up2date_client/up2dateAuth.py root@server2:/usr/share/rhn/up2date_client/
 ls -lrth /usr/share/rhn/up2date_client/up2dateAuth.py*

跑步

 yum repolist

 rhnreg_ks --sslCACert=/usr/share/rhn/RHN-ORG-TRUSTED-SSL-CERT --serverUrl=https://myspacewalkserver-corp.com/XMLRPC  --activationkey=1-oraclelinux6-x86_64 --force

 yum repolist (it work like a charm)

PS不要忘记删除 cd /etc/yum.repos.d/; rm -rf spacewalk26-client.repo 在运行 rhnreg 命令之前,否则会抛出另一个错误。

在 Oracle Linux Yum Server 存储库配置文件中禁用对 Spacewalk Client 存储库的访问或删除 /etc/yum.repos.d/spacewalk26-client.repo。

相关内容