处置错误:Error: Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: No URLs in mirrorlist
问题出现:
[root@CentOS84-IP08 ]#dnf in centos-release-stream
Repository extras is listed more than once in the configuration
CentOS Linux 8 - AppStream                                                                  80  B/s |  38  B     00:00    
Error: Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: No URLs in mirrorlist分析问题:
因为CentOS团队从官方镜像中移除CentOS 8的所有包,现在被转移到 https://vault.centos.org。如需继续使用CentOS 8,可在/etc/yum.repos中用vault.centos.org代替mirror.centos.org

解决问题:
[root@CentOS84-IP08 ]#lsb_release -a 
LSB Version:    :core-4.1-amd64:core-4.1-noarch
Distributor ID: CentOS
Description:    CentOS Linux release 8.5.2111
Release:        8.5.2111
Codename:       n/a
[root@CentOS84-IP08 ]#ll /etc/yum.repos.d/
total 108
-rw-r--r--  1 root root 2796 Jan 15 03:08 base.repo
-rw-r--r--  1 root root  721 May  6 21:26 CentOS-Linux-AppStream.repo
-rw-r--r--  1 root root  706 May  6 21:26 CentOS-Linux-BaseOS.repo
-rw-r--r--  1 root root 1132 May  6 21:26 CentOS-Linux-ContinuousRelease.repo
-rw-r--r--  1 root root  318 May  6 21:26 CentOS-Linux-Debuginfo.repo
-rw-r--r--  1 root root  734 May  6 21:26 CentOS-Linux-Devel.repo
-rw-r--r--  1 root root  706 May  6 21:26 CentOS-Linux-Extras.repo
-rw-r--r--  1 root root  721 May  6 21:26 CentOS-Linux-FastTrack.repo
-rw-r--r--  1 root root  742 May  6 21:26 CentOS-Linux-HighAvailability.repo
-rw-r--r--  1 root root  693 May  6 21:26 CentOS-Linux-Media.repo
-rw-r--r--  1 root root  708 May  6 21:26 CentOS-Linux-Plus.repo
-rw-r--r--  1 root root  726 May  6 21:26 CentOS-Linux-PowerTools.repo
-rw-r--r--  1 root root 1124 May  6 21:26 CentOS-Linux-Sources.repo
-rw-r--r--  1 root root  725 Dec 20  2019 CentOS-Stream-AppStream.repo
-rw-r--r--  1 root root  706 Dec 20  2019 CentOS-Stream-Base.repo
-rw-r--r--  1 root root  796 Dec 20  2019 CentOS-Stream-centosplus.repo
-rw-r--r--  1 root root  666 Dec 20  2019 CentOS-Stream-Debuginfo.repo
-rw-r--r--  1 root root  750 Dec 20  2019 CentOS-Stream-Extras.repo
-rw-r--r--  1 root root  932 Dec 20  2019 CentOS-Stream-Media.repo
-rw-r--r--  1 root root  730 Dec 20  2019 CentOS-Stream-PowerTools.repo
-rw-r--r--  1 root root 1374 Dec 20  2019 CentOS-Stream-Sources.repo
-rw-r--r--  1 root root   74 Dec 20  2019 CentOS-Stream-Vault.repo
-rw-r--r--  1 root root  358 May  6 21:27 redhat.repo
[root@CentOS84-IP08 ]#
[root@CentOS84-IP08 ]#sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
[root@CentOS84-IP08 ]#sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
root@CentOS84-IP08 ]#dnf in centos-release-stream
Repository extras is listed more than once in the configuration
CentOS Linux 8 - AppStream                       1.5 MB/s | 8.4 MB     00:05    
CentOS Linux 8 - BaseOS                          999 kB/s | 4.6 MB     00:04    
CentOS Linux 8 - Extras                          5.6 kB/s |  10 kB     00:01    
Last metadata expiration check: -1 day, 23:46:00 ago on Fri 06 May 2022 09:41:11 PM CST.
Dependencies resolved.
====================================================================================
 Package                  Architecture    Version               Repository    Size
====================================================================================
Installing:
 centos-release-stream    x86_64          8.1-1.1911.0.7.el8    extras        11 k
Transaction Summary
====================================================================================
Install  1 Package
Total download size: 11 k
Installed size: 6.6 k
Is this ok [y/N]: y
Downloading Packages:
centos-release-stream-8.1-1.1911.0.7.el8.x86_64.rpm      10 kB/s |  11 kB     00:01    
-------------------------------------------------------------------------------------
Total                                                   10 kB/s |  11 kB     00:01     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                       1/1 
  Installing       : centos-release-stream-8.1-1.1911.0.7.el8.x86_64       1/1 
  Verifying        : centos-release-stream-8.1-1.1911.0.7.el8.x86_64       1/1 
Installed products updated.
Installed:
  centos-release-stream-8.1-1.1911.0.7.el8.x86_64                                                                          
Complete!
[root@CentOS84-IP08 ]#









