Yum
Oracle Linux yum 更新後不工作
我已將我的 Oracle Linux 6.4 伺服器更新為已註冊到 spacewalk 伺服器的 Oracle Linux 6.8。但更新後,yum 命令在伺服器中不起作用。
[root@j4server tmp]# yum update Loaded plugins: aliases, changelog, kabi, presto, refresh-packagekit, rhnplugin, security, tmprepo, verify, : versionlock 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 298, 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/rhnplugin.py", line 115, in init_hook login_info = up2dateAuth.getLoginInfo() File "/usr/share/rhn/up2date_client/up2dateAuth.py", line 219, in getLoginInfo login() 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'
它正在拋出這個輸出。當我嘗試禁用 rhn-plugin 時,yum 命令有效,列出了 spacewalk 上的軟體包,但正如您猜測的那樣無法安裝它們。
您對這種情況有什麼想法嗎?謝謝你的幫助!
我找到了解決方案,我在這裡發布解決方案,以防有人遇到同樣的情況。出現此故障的原因是,當您通過 spacewalk 使用“yum update”命令更新 Oracle Linux 伺服器時,yum update 會將伺服器 spacewalk-enabled rhn 外掛替換為啟用 ULN 的外掛。
在將“RHEL 6.8” ISO 安裝到 Oracle Linux 伺服器之後,我已經用“yum erase up2date”和“yum erase pirut”刪除了 up2date 包。在我將此iso添加為本地倉庫之後。我已經使用“yum install rhn-client-tools rhn-check rhn-setup rhnsd m2crypto yum-rhn-plugin”安裝了 rhn 工具並刪除了本地 repo 文件。現在一切正常!