YUM:ダウンロードは成功しましたが、チェックサムが一致しません。

YUM:ダウンロードは成功しましたが、チェックサムが一致しません。

RHEL9はローカルYUM Repoを作成し、/ RHEL9-REPOの下にすべてのファイルをコピーしました。

/etc/yum.repos.d/rhel-lcoal.repoの内容

[rhel-baseos]
name= RHEL 9.0 Local BaseOS YUM REPO
baseurl= file:///RHEL9-REPO/BaseOS
enabled=1
gpgcheck=0


[rhel-AppStream]
name= RHEL 9.0 Local AppStream YUM REPO
baseurl= file:///RHEL9-REPO/AppStream
enabled=1
gpgcheck=0

「dnf clean all」と「dnf repolist -v」を実行すると、このエラーが発生します。

Loaded plugins: builddep, changelog, config-manager, copr, debug, debuginfo-install, download, generate_completion_cache, groups-manager, kpatch, needs-restarting, playground, product-id, repoclosure, repodiff, repograph, repomanage, reposync, subscription-manager, uploadprofile
Updating Subscription Management repositories.
Unable to read consumer identity

This system is not registered with an entitlement server. You can use subscription-manager to register.

DNF version: 4.10.0
cachedir: /var/cache/dnf
RHEL 9.0 Local BaseOS YUM REPO                                                                                                             94 MB/s | 1.7 MB     00:00    
Errors during downloading metadata for repository 'rhel-baseos':
  - Downloading successful, but checksum doesn't match. Calculated: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855(sha256)  Expected: 951a2367c42d5c3fb70e6d8ad430d120cc32e639b361139eaf68d8d2c6569003(sha256) 
Error: Failed to download metadata for repo 'rhel-baseos': Yum repo downloading error: Downloading error(s): repodata/951a2367c42d5c3fb70e6d8ad430d120cc32e639b361139eaf68d8d2c6569003-productid.gz - Cannot download, all mirrors were already tried without success

ベストアンサー1

このエラーを取り除くには、ローカルストアのメタデータを手動で作成する必要があります。次のことができます。

createrepo -v /RHEL9-REPO/BaseOS/
createrepo -v RHEL9-REPO/AppStream

コンピュータとRPMパッケージの数によっては、このコマンドを実行するのに数分かかることがあります。

dnf clean all
dnf repolist -v

これで問題が解決します。

おすすめ記事