同步查错

同步可能因多种原因而失败。 要获取有关连接问题的更多信息,请运行以下命令:

export URLGRABBER_DEBUG=DEBUG
spacewalk-repo-sync -c <channelname> <options> > /var/log/spacewalk-repo-sync-$(date +%F-%R).log 2>&1

您还可以在 /var/log/zypper.log 查看由 Zypper 创建的日志。

GPG 密钥不匹配

SUSE Multi-Linux Manager 不会自动信任第三方 GPG 密钥。 如果软件包同步失败,可能是由于不受信任的 GPG 密钥。 您可以通过打开 /var/log/rhn/reposync 并查找类似如下的错误来确定是否是这种情况:

['/usr/bin/spacewalk-repo-sync', '--channel', 'sle-12-sp1-ga-desktop-
nvidia-driver-x86_64', '--type', 'yum', '--non-interactive']
RepoMDError: Cannot access repository. Maybe repository GPG keys are not imported

要解决此问题,您需要将 GPG 密钥导入到 SUSE Multi-Linux Manager。 有关导入 GPG 密钥的更多信息,请参见 储存库元数据

spacewalk-repo-sync 中去除 GPG 密钥

使用 spacewalk-repo-sync 手动导入储存库的 GPG 密钥后,如果该密钥不再需要(例如,它可能已被泄露或仅用于测试目的),则可以通过以下命令将该密钥从 spacewalk-repo-sync 所使用的 zypper RPM 数据库中去除:

rpm --dbpath=/var/lib/spacewalk/reposync/root/var/lib/rpm/ -e gpg-pubkey-*

其中 gpg-pubkey-* 是要去除的 GPG 密钥的名称。

续订 GPG 密钥

如果您要续订某个 GPG 密钥,请先去除旧密钥,然后生成并导入新密钥。

校验和不匹配

如果校验和失败,您可能会在 /var/log/rhn/reposync/*.log 日志文件中看到如下错误:

Repo Sync Errors: (50, u'checksums did not match
326a904c2fbd7a0e20033c87fc84ebba6b24d937 vs
afd8c60d7908b2b0e2d95ad0b333920aea9892eb', 'Invalid information uploaded
to the server')
The package microcode_ctl-1.17-102.57.62.1.x86_64 which is referenced by
patch microcode_ctl-8413 was not found in the database. This patch has
been skipped.

您可以在命令提示符下使用 -Y 选项运行同步来解决此错误:

spacewalk-repo-sync --channel <channelname> -Y

此选项在同步之前校验储存库数据,而不是依赖于本地缓存的校验和。

连接超时

如果下载超时并出现以下错误:

28, 'Operation too slow. Less than 1000 bytes/sec transferred the last 300 seconds

您可以通过在 /etc/rhn/rhn.conf 中指定 reposync_timeoutreposync_minrate 配置值来解决此错误。 默认情况下,当在 300 秒内传输的字节数少于 1000 字节时,下载将被中止。 您可以使用 reposync_minrate 调整每秒传输的字节数,并使用 reposync_timeout 调整等待的秒数。

重新同步期间手动信任密钥

在某些情况下,当运行 reposync 时,您可能需要手动接受 GPG 密钥。 例如:

# spacewalk-repo-sync -c nvidia-compute-sle-15-x86_64-we-sp3
17:07:40 ======================================
17:07:40 | Channel: nvidia-compute-sle-15-x86_64-we-sp3
17:07:40 ======================================
17:07:40 Sync of channel started.
New repository or package signing key received:
  Repository:       nvidia-compute-sle-15-x86_64-we-sp3
  Key Fingerprint:  610C 7B14 E068 A878 070D A4E9 9CD0 A493 D42D 0685
  Key Name:         cudatools <cudatools@nvidia.com>
  Key Algorithm:    RSA 4096
  Key Created:      Thu Apr 14 16:04:01 2022
  Key Expires:      (does not expire)
  Rpm Name:         gpg-pubkey-d42d0685-62589a51
    Note: Signing data enables the recipient to verify that no modifications occurred after the data
    were signed. Accepting data with no, wrong or unknown signature can lead to a corrupted system
    and in extreme cases even to a system compromise.
    Note: A GPG pubkey is clearly identified by its fingerprint. Do not rely on the key's name. If
    you are not sure whether the presented key is authentic, ask the repository provider or check
    their web site. Many providers maintain a web page showing the fingerprints of the GPG keys they
    are using.
Do you want to reject the key, trust temporarily, or trust always? [r/t/a/?] (r):