エラー: repo 'appstream' のメタデータのダウンロードに失敗しました

dnf updateで失敗

エラー: repo 'appstream' のメタデータのダウンロードに失敗しました : Cannot prepare internal mirrorlist: No URLs in mirrorlist

のメッセージ出現でupdateが出来ない状況。識者のWebを観察すると.repoの向け先をbaseurl←mirrorlistに切替よとありました。

変更前のCentOS-Linux-AppStream.repo

# CentOS-Linux-AppStream.repo
#
# The mirrorlist system uses the connecting IP address of the client and the
# update status of each mirror to pick current mirrors that are geographically
# close to the client.  You should use this for CentOS updates unless you are
# manually picking other mirrors.
#
# If the mirrorlist does not work for you, you can try the commented out
# baseurl line instead.

[appstream]
name=CentOS Linux $releasever - AppStream
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo
=AppStream&infra=$infra
#baseurl=http://mirror.centos.org/$contentdir/$releasever/AppStream/$basearch/os
/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial

文字列置換の対象は/etc/yum.repos.d/CentOS-Linux-*

# sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-Linux-*
# sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-Linux-*

mirrorはコメントアウトbaseurlのコメントアウトを除去

dnf clean all→dnf update

# dnf clean all
56 ファイルが削除されました
[root@vmcent-1218 yum.repos.d]# dnf update
CentOS Linux 8 - AppStream                       15 MB/s | 8.4 MB     00:00
CentOS Linux 8 - BaseOS                         8.3 MB/s | 4.6 MB     00:00
CentOS Linux 8 - Extras                          38 kB/s |  10 kB     00:00
Extra Packages for Enterprise Linux 8 - x86_64  4.1 MB/s |  11 MB     00:02
Extra Packages for Enterprise Linux Modular 8 - 1.8 MB/s | 1.0 MB     00:00
依存関係が解決しました。
================================================================================
 パッケージ            Arch            バージョン           リポジトリー  サイズ
================================================================================
アップグレード:
 epel-release          noarch          8-15.el8             epel           23 k

トランザクションの概要
================================================================================
アップグレード  1 パッケージ

ダウンロードサイズの合計: 23 k
これでよろしいですか? [y/N]: y
パッケージのダウンロード:
epel-release-8-15.el8.noarch.rpm                252 kB/s |  23 kB     00:00
--------------------------------------------------------------------------------
合計                                             27 kB/s |  23 kB     00:00
トランザクションの確認を実行中
トランザクションの確認に成功しました。
トランザクションのテストを実行中
トランザクションのテストに成功しました。
トランザクションを実行中
  準備             :                                                        1/1
  scriptletの実行中: epel-release-8-15.el8.noarch                           1/1
  アップグレード中 : epel-release-8-15.el8.noarch                           1/2
  整理             : epel-release-8-13.el8.noarch                           2/2
  scriptletの実行中: epel-release-8-13.el8.noarch                           2/2
  検証             : epel-release-8-15.el8.noarch                           1/2
  検証             : epel-release-8-13.el8.noarch                           2/2
インストール済みの製品が更新されています。

アップグレード済み:
  epel-release-8-15.el8.noarch

完了しました!

CentOSのサポート期限は2021年12月で終了しているので、別のOSに乗り換える必要があります。MiracleLinuxかUbuntuなのかなと、、、

 

コメント