2023/11/27 Rockly linux 9.3 で dnf installでエラーが出る場合の対処

Rockly linux 9.3でdnf installをする際エラーが出て動かない時がある.例えば perlなど入れたい場合に

dnf install perl-App-cpanminus perl-devel

メタデータの期限切れの最終確認: 0:00:45 前の 2023年11月28日 06時35分25秒 に実施しました。

エラー: 

 問題 1: package perl-devel-4:5.32.1-480.el9.x86_64 from appstream requires redhat-rpm-config, but none of the providers can be installed

  – package redhat-rpm-config-201-1.el9.noarch from appstream requires kernel-srpm-macros >= 1.0-6, but none of the providers can be installed

  – ジョブの最良アップデート候補をインストールできません

  – package kernel-srpm-macros-1.0-13.el9.noarch from appstream is filtered out by exclude filtering

 問題 2: package perl-4:5.32.1-480.el9.x86_64 from appstream requires perl-devel(x86-64) = 4:5.32.1-480.el9, but none of the providers can be installed

  – package perl-devel-4:5.32.1-480.el9.x86_64 from appstream requires redhat-rpm-config, but none of the providers can be installed

  – package perl-App-cpanminus-1.7044-14.el9.noarch from appstream requires perl, but none of the providers can be installed

  – package redhat-rpm-config-201-1.el9.noarch from appstream requires kernel-srpm-macros >= 1.0-6, but none of the providers can be installed

  – 競合するリクエスト

  – package kernel-srpm-macros-1.0-13.el9.noarch from appstream is filtered out by exclude filtering

(インストール不可のパッケージをスキップするには、’–skip-broken’ を追加してみてください または、’–nobest’ を追加して、最適候補のパッケージのみを使用しないでください)

このように filtered されてしまって入らない.これは https://bugzilla.redhat.com/show_bug.cgi?id=1891603ここに参考にあるように

/etc/dnf/dnf.conf をエディターで開いて下記の部分をコメントアウトする

external=kernel* の部分を#でコメントアウト

すると dnf installが成功する