Skip to content
Summa Lai
Never Stop Learning, Building a Little Wiki…
Life is like riding a bicycle. To keep your balance, you must keep moving. But DON'T move too fast.
  • Home
  • Apple
  • Cloud
  • Linux
  • Microsoft
  • Networks
  • Solutions
  • TOOLS
  • Log In
  • About Me

How to Fix “Failed to download metadata for repo AppStream” on CentOS 8

Posted on June 4, 2022June 4, 2022 by Summa Lai

Updated on February 10, 2022

I installed a minimalist CentOS 8 on one of my servers. Installation went successful, however, when I tried to update the system using yum update I see this error message: Failed to download metadata for repo. Below is the complete error.

[root@autocontroller ~]# yum update
CentOS-8 - AppStream 70 B/s | 38 B 00:00
Error: Failed to download metadata for repo 'AppStream': Cannot prepare internal mirrorlist: No URLs in mirrorlist

Output from the /var/log/dnf.log for more DEBUG information:

2022-02-02T11:39:36Z DEBUG error: Curl error (6): Couldn't resolve host name for http://mirrorlist.centos.org/?release=8&arch=x86_64&repo=AppStream&infra=stock [Could not resolve host: mirrorlist.centos.org] (http://mirrorlist.centos.org/?release=8&arch=x86_64&repo=AppStream&infra=stock).
2022-02-02T11:39:36Z WARNING Errors during downloading metadata for repository 'AppStream':
- Curl error (6): Couldn't resolve host name for http://mirrorlist.centos.org/?release=8&arch=x86_64&repo=AppStream&infra=stock [Could not resolve host: mirrorlist.centos.org]
2022-02-02T11:39:36Z DDEBUG Cleaning up.
2022-02-02T11:39:36Z SUBDEBUG
Traceback (most recent call last):
File "/usr/lib/python3.6/site-packages/dnf/repo.py", line 573, in load
ret = self._repo.load()
File "/usr/lib64/python3.6/site-packages/libdnf/repo.py", line 394, in load
return _repo.Repo_load(self)
RuntimeError: Failed to download metadata for repo 'AppStream': Cannot prepare internal mirrorlist: Curl error (6): Couldn't resolve host name for http://mirrorlist.centos.org/?release=8&arch=x86_64&repo=AppStream&infra=stock [Could not resolve host: mirrorlist.centos.org]

But, then verified with the internet connection and DNS and it works just fine as below:

[root@autocontroller ~]# ping google.com
PING google.com (172.217.166.206) 56(84) bytes of data.
64 bytes from del03s13-in-f14.1e100.net (172.217.166.206): icmp_seq=1 ttl=115 ti me=43.5 ms
--- google.com ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 43.508/43.508/43.508/0.000 ms

So how did I fix the issue? Here it is.

Fix Failed to download metadata for repo

CentOS Linux 8 had reached the End Of Life (EOL) on December 31st, 2021. It means that CentOS 8 will no longer receive development resources from the official CentOS project. After Dec 31st, 2021, if you need to update your CentOS, you need to change the mirrors to vault.centos.org where they will be archived permanently. Alternatively, you may want to upgrade to CentOS Stream.

Step 1: Go to the /etc/yum.repos.d/ directory.

[root@autocontroller ~]# cd /etc/yum.repos.d/

Step 2: Run the below commands

[root@autocontroller ~]# sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
[root@autocontroller ~]# sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*

Step 3: Now run the yum update

[root@autocontroller ~]# yum update -y

That’s it!

Ref: https://techglimpse.com/failed-metadata-repo-appstream-centos-8/

Posted in CentOS, Linux Family Tagged Centos Failed to download metadata for repo AppStream, Failed to download metadata for repo AppStream

Post navigation

← How to Add DHCP Scope Option 135 – Domain Suffix Search Order in a Windows Server
How to Update WordPress to 6 Manually. →

Categories

  • About Me (1)
  • Apple (24)
    • Apple Devices (18)
    • iCloud (3)
    • Mac OS (7)
  • Certifications (21)
    • CCNP (21)
    • CompTIA A+ (2)
    • CompTIA Network+ (9)
  • Cloud (80)
    • AWS (2)
    • CloudFlare (2)
    • Google Cloud (19)
    • JumpCloud (1)
    • Microsoft 365 (49)
    • Oracle (1)
    • RADIUS (2)
  • Linux Family (57)
    • Apache (20)
    • CentOS (23)
    • PHP (3)
    • Putty / WinSCP (1)
    • Shopify (2)
    • WordPress (18)
  • Microsoft Family (537)
    • Autopilot / Intune (52)
    • Azure (94)
    • Compliance Portal (3)
    • Dymanic (2)
    • Exchange (13)
    • Hyper-V (1)
    • Microsoft Defender (6)
    • Microsoft Office (171)
    • Power BI (94)
    • PowerShell (15)
    • SQL (20)
    • Surface (3)
    • Teams / SharePoint (20)
    • Windows 7/8/10/11 (133)
    • Windows Servers (71)
  • Networks (122)
    • Adobe (1)
    • Darktrace (2)
    • Firewalls (21)
    • Google (12)
    • Hardware (21)
    • Meraki (1)
    • Mobile phones (5)
    • NordLayer (1)
    • Others (24)
    • Palo Alto (11)
    • Phones (1)
    • Router/Switch (26)
    • Ubiquiti (1)
    • Wi-Fi (9)
  • Oversea Living (26)
  • Solutions (51)
    • 1Password (2)
    • Adobe (2)
    • BI and Reporting (5)
    • BoardEffect (1)
    • eCommerce (8)
    • Forensics / Investigation (1)
    • Google Workspace (4)
    • IT Management (2)
    • KnowBe4 (1)
    • Password Management (5)
    • Project Management (2)
    • QuickBooks (1)
    • Sage (3)
  • Tools (15)
    • Atera (2)
    • Chocolatey (1)
    • Google (4)
    • PatchMyPC (3)
  • Travels (2)
  • Uncategorized (13)
  • VMware (2)

Recent Posts

  • How to View the Attribute Editor in Active Directory September 5, 2025
  • How to Unlock a User in BoardEffect September 4, 2025
  • How to Insert a Table of Contents with Office 365 June 19, 2025
  • Password Expiration Notification for Microsoft 365 Users May 1, 2025
  • How to Fix “Your organization does not allow external forwarding.” Microsoft 365 April 9, 2025
  • How to Check the Windows 11 Version and Build March 25, 2025
  • How to Remove Previously Granted Access to a User’s OneDrive February 13, 2025
  • How to Create a Milestone with Project for The Web February 4, 2025
  • How To Convert a .CRT Certificate into a .PEM or .PFX Format January 6, 2025
  • How to Deploy 1Password SCIM Bridge on Azure Container Apps January 2, 2025

Recent Comments

  • buy CBD on SUMMA LAI – NEVER STOP LEARNING

Archives

  • September 2025 (2)
  • June 2025 (1)
  • May 2025 (1)
  • April 2025 (1)
  • March 2025 (1)
  • February 2025 (2)
  • January 2025 (2)
  • December 2024 (2)
  • November 2024 (3)
  • October 2024 (4)
  • September 2024 (3)
  • August 2024 (7)
  • July 2024 (7)
  • June 2024 (4)
  • May 2024 (4)
  • April 2024 (1)
  • March 2024 (5)
  • February 2024 (7)
  • January 2024 (12)
  • December 2023 (7)
  • November 2023 (10)
  • October 2023 (8)
  • September 2023 (8)
  • August 2023 (6)
  • July 2023 (12)
  • June 2023 (15)
  • May 2023 (17)
  • April 2023 (18)
  • March 2023 (14)
  • February 2023 (17)
  • January 2023 (21)
  • December 2022 (17)
  • November 2022 (20)
  • October 2022 (18)
  • September 2022 (17)
  • August 2022 (17)
  • July 2022 (17)
  • June 2022 (18)
  • May 2022 (12)
  • March 2022 (11)
  • February 2022 (18)
  • January 2022 (22)
  • December 2021 (26)
  • November 2021 (22)
  • October 2021 (23)
  • September 2021 (24)
  • August 2021 (12)
  • July 2021 (14)
  • June 2021 (20)
  • May 2021 (23)
  • April 2021 (28)
  • March 2021 (24)
  • February 2021 (27)
  • January 2021 (28)
  • December 2020 (31)
  • November 2020 (13)
  • October 2020 (4)
  • September 2020 (3)
  • August 2020 (7)
  • July 2020 (23)
  • June 2020 (24)
  • May 2020 (21)
Copyright 2024, Privacy Policy
  • SUMMA LAI – NEVER STOP LEARNING