{"id":4138,"date":"2022-06-04T12:40:12","date_gmt":"2022-06-04T19:40:12","guid":{"rendered":"https:\/\/SUMMALAI.COM\/?p=4138"},"modified":"2022-06-04T12:40:13","modified_gmt":"2022-06-04T19:40:13","slug":"how-to-fix-failed-to-download-metadata-for-repo-appstream-on-centos-8","status":"publish","type":"post","link":"https:\/\/SUMMALAI.COM\/?p=4138","title":{"rendered":"How to Fix &#8220;Failed to download metadata for repo AppStream&#8221; on CentOS 8"},"content":{"rendered":"\n<p>Updated on February 10, 2022<\/p>\n\n\n\n<p>I installed a minimalist CentOS 8 on one of my servers. Installation went successful, however, when I tried to update the system using&nbsp;<code>yum update<\/code>&nbsp;I see this error message: Failed to download metadata for repo. Below is the complete error.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">[root@autocontroller ~]# yum update\nCentOS-8 - AppStream 70 B\/s | 38 B 00:00\nError: Failed to download metadata for repo 'AppStream': Cannot prepare internal mirrorlist: No URLs in mirrorlist<\/pre>\n\n\n\n<p>Output from the&nbsp;<code>\/var\/log\/dnf.log<\/code>&nbsp;for more DEBUG information:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">2022-02-02T11:39:36Z DEBUG error: Curl error (6): Couldn't resolve host name for http:\/\/mirrorlist.centos.org\/?release=8&amp;arch=x86_64&amp;repo=AppStream&amp;infra=stock [Could not resolve host: mirrorlist.centos.org] (http:\/\/mirrorlist.centos.org\/?release=8&amp;arch=x86_64&amp;repo=AppStream&amp;infra=stock).\n2022-02-02T11:39:36Z WARNING Errors during downloading metadata for repository 'AppStream':\n- Curl error (6): Couldn't resolve host name for http:\/\/mirrorlist.centos.org\/?release=8&amp;arch=x86_64&amp;repo=AppStream&amp;infra=stock [Could not resolve host: mirrorlist.centos.org]\n2022-02-02T11:39:36Z DDEBUG Cleaning up.\n2022-02-02T11:39:36Z SUBDEBUG\nTraceback (most recent call last):\nFile \"\/usr\/lib\/python3.6\/site-packages\/dnf\/repo.py\", line 573, in load\nret = self._repo.load()\nFile \"\/usr\/lib64\/python3.6\/site-packages\/libdnf\/repo.py\", line 394, in load\nreturn _repo.Repo_load(self)\nRuntimeError: 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&amp;arch=x86_64&amp;repo=AppStream&amp;infra=stock [Could not resolve host: mirrorlist.centos.org]<\/pre>\n\n\n\n<p>But, then verified with the internet connection and DNS and it works just fine as below:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">[root@autocontroller ~]# ping google.com\nPING google.com (172.217.166.206) 56(84) bytes of data.\n64 bytes from del03s13-in-f14.1e100.net (172.217.166.206): icmp_seq=1 ttl=115 ti me=43.5 ms\n--- google.com ping statistics ---\n1 packets transmitted, 1 received, 0% packet loss, time 0ms\nrtt min\/avg\/max\/mdev = 43.508\/43.508\/43.508\/0.000 ms<\/pre>\n\n\n\n<p>So how did I fix the issue? Here it is.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"fix-failed-to-download-metadata-for-repo\">Fix Failed to download metadata for repo<\/h2>\n\n\n\n<p><a href=\"https:\/\/www.centos.org\/centos-linux-eol\/\" target=\"_blank\" rel=\"noreferrer noopener\">CentOS Linux 8 had reached the End Of Life (EOL)<\/a>&nbsp;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&nbsp;<a href=\"https:\/\/vault.centos.org\/\">vault.centos.org<\/a>&nbsp;where they will be archived permanently. Alternatively, you may want to&nbsp;<a href=\"https:\/\/techglimpse.com\/convert-centos8-linux-centosstream\/\">upgrade to CentOS Stream<\/a>.<\/p>\n\n\n\n<p><strong>Step 1:<\/strong>&nbsp;Go to the&nbsp;<code>\/etc\/yum.repos.d\/<\/code>&nbsp;directory.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">[root@autocontroller ~]# cd \/etc\/yum.repos.d\/<\/pre>\n\n\n\n<p><strong>Step 2:<\/strong>&nbsp;Run the below commands<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">[root@autocontroller ~]# sed -i 's\/mirrorlist\/#mirrorlist\/g' \/etc\/yum.repos.d\/CentOS-*<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">[root@autocontroller ~]# sed -i 's|#baseurl=http:\/\/mirror.centos.org|baseurl=http:\/\/vault.centos.org|g' \/etc\/yum.repos.d\/CentOS-*<\/pre>\n\n\n\n<p><strong>Step 3:<\/strong>&nbsp;Now run the yum update<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">[root@autocontroller ~]# yum update -y<\/pre>\n\n\n\n<p>That\u2019s it!<\/p>\n\n\n\n<p>Ref: https:\/\/techglimpse.com\/failed-metadata-repo-appstream-centos-8\/<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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&nbsp;yum update&nbsp;I see this error message: Failed to download metadata for repo. Below is the complete error. [root@autocontroller ~]# yum update CentOS-8 &#8211; AppStream 70 B\/s | 38 <a class=\"read-more\" href=\"https:\/\/SUMMALAI.COM\/?p=4138\">Read More<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[262,5],"tags":[1171,1170],"class_list":["post-4138","post","type-post","status-publish","format-standard","hentry","category-centos","category-linux","tag-centos-failed-to-download-metadata-for-repo-appstream","tag-failed-to-download-metadata-for-repo-appstream"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/posts\/4138","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4138"}],"version-history":[{"count":2,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/posts\/4138\/revisions"}],"predecessor-version":[{"id":4159,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/posts\/4138\/revisions\/4159"}],"wp:attachment":[{"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4138"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4138"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4138"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}