Yum 更新命令显示一些错误

Yum 更新命令显示一些错误

在带有 cpanel 的 almalinux 服务器中,当尝试使用命令“yum update”更新 yum 时,会抛出以下错误。所有命令均无效。所有命令的输出均相同。输出如下所示

错误详情:

    Traceback (most recent call last):
      File "/usr/bin/yum", line 58, in <module>
        main.user_main(sys.argv[1:], exit_code=True)
      File "/usr/lib/python3.6/site-packages/dnf/cli/main.py", line 201, in user_main
        errcode = main(args)
      File "/usr/lib/python3.6/site-packages/dnf/cli/main.py", line 67, in main
        return _main(base, args, cli_class, option_parser_class)
      File "/usr/lib/python3.6/site-packages/dnf/cli/main.py", line 102, in _main
        cli.configure(list(map(ucd, args)), option_parser())
      File "/usr/lib/python3.6/site-packages/dnf/cli/cli.py", line 830, in configure
        self.base.init_plugins(opts.disableplugin, opts.enableplugin, self)
      File "/usr/lib/python3.6/site-packages/dnf/base.py", line 307, in init_plugins
        self._plugins._run_init(self, cli)
      File "/usr/lib/python3.6/site-packages/dnf/plugin.py", line 154, in _run_init
        plugin = p_cls(base, cli)
      File "/usr/lib/python3.6/site-packages/dnf-plugins/spacewalk.py", line 79, in __init__
        self.activate_channels()
      File "/usr/lib/python3.6/site-packages/dnf-plugins/spacewalk.py", line 109, in activate_channels
        login_info = up2date_client.up2dateAuth.getLoginInfo(timeout=self.conf.timeout)
      File "/usr/lib/python3.6/site-packages/up2date_client/up2dateAuth.py", line 231, in getLoginInfo
        login(timeout=timeout)
      File "/usr/lib/python3.6/site-packages/up2date_client/up2dateAuth.py", line 198, in login
        li = server.up2date.login(systemId, socket.getfqdn())
      File "/usr/lib/python3.6/site-packages/up2date_client/rhnserver.py", line 67, in __call__
        return rpcServer.doCall(method, *args, **kwargs)
      File "/usr/lib/python3.6/site-packages/up2date_client/rpcServer.py", line 222, in doCall
        ret = method(*args, **kwargs)
      File "/usr/lib64/python3.6/xmlrpc/client.py", line 1112, in __call__
        return self.__send(self.__name, args)
      File "/usr/lib/python3.6/site-packages/up2date_client/rpcServer.py", line 48, in _request1
        ret = self._request(methodname, params)
      File "/usr/lib/python3.6/site-packages/rhn/rpclib.py", line 394, in _request
        self._handler, request, verbose=self._verbose)
      File "/usr/lib/python3.6/site-packages/rhn/transports.py", line 194, in request
        return self._process_response(fd, connection)
      File "/usr/lib/python3.6/site-packages/rhn/transports.py", line 222, in _process_response
        return self.parse_response(fd)
      File "/usr/lib/python3.6/site-packages/rhn/transports.py", line 245, in parse_response
        p.close()
      File "/usr/lib64/python3.6/xmlrpc/client.py", line 448, in close
        parser.Parse(b"", True) # end of data
    xml.parsers.expat.ExpatError: syntax error: line 1, column 0

答案1

这是太空行走连接/握手/某事错误。我确信您知道,太空行走已经相当过时了(我应该知道,我自己也为旧产品运行过一个),但从头开始设置 cpanel 可能非常麻烦,所以我理解您想尽量利用您已设置的功能。

我会确保您可以通过 webui 登录 spacew2alk 服务器以确保它看起来正常(或者如果其他人有访问权限,请他们以相同的想法进行检查)。

现在,如果太空行走完全瘫痪,而您想要在没有太空行走的情况下更新内容,您可以运行 yum repolist,如果您可以识别使用太空行走的存储库,则可以对每个存储库使用 yum --disablerepo=name_of_spacewalk_repo,然后重试剩下的操作或执行您想要的 yum --enablerepo=repo。

如果您有一个包含所需更新的 ISO,您甚至可以创建一个 cdrom repo。

我有一台机器,我正试图在太空行走时获取一些较新的更新,并且我将 iso 安装在 /mnt/cdrom 上。这是我的 cdrom.repo:

    [cdrom]
name=Local ISO Repo
baseurl=file:///mnt/cdrom
enabled=1
gpgcheck=1

我希望这能有所帮助。

相关内容