{"id":2313,"date":"2022-09-01T09:28:30","date_gmt":"2022-09-01T07:28:30","guid":{"rendered":"https:\/\/itsimple.info\/?p=2313"},"modified":"2022-12-25T12:28:39","modified_gmt":"2022-12-25T10:28:39","slug":"linux-centos-can-not-get-updates-from-repo","status":"publish","type":"post","link":"https:\/\/itsimple.info\/?p=2313","title":{"rendered":"Linux CentOS can not get updates from REPO"},"content":{"rendered":"\n<p>Somtime the linux machine can not get updates and you get this error:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\"Failed to download metadata for repo AppStream\"<\/pre>\n\n\n\n<p>This can happens if the repo URL is old or got corrupted some how, To fix this just replace the URL with a good and updated one like &#8220;<a rel=\"noreferrer noopener\" href=\"https:\/\/vault.centos.org\/\" target=\"_blank\">vault.centos.org<\/a>&#8221; , run from ssh or console :<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">cd \/etc\/yum.repos.d\/\nsed -i 's\/mirrorlist\/#mirrorlist\/g' \/etc\/yum.repos.d\/CentOS-*\nsed -i 's|#baseurl=http:\/\/mirror.centos.org|baseurl=http:\/\/vault.centos.org|g' \/etc\/yum.repos.d\/CentOS-*<\/pre>\n\n\n\n<p>This is example of how CentOS-Linux-BaseOS.repo :<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">[baseos]\nname=CentOS Linux $releasever - BaseOS\n#mirrorlist=http:\/\/#mirrorlist.centos.org\/?release=$releasever&amp;arch=$basearch&amp;repo=BaseOS&amp;infra=$infra\nbaseurl=http:\/\/vault.epel.cloud\/$contentdir\/$releasever\/BaseOS\/$basearch\/os\/\ngpgcheck=1\nenabled=1\ngpgkey=file:\/\/\/etc\/pki\/rpm-gpg\/RPM-GPG-KEY-centosofficial\n<\/pre>\n\n\n\n<p>Now you will be able to execute :<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">yum update\nOr\ndnf update<\/pre>\n\n\n\n<p>Some time you will need to run &#8220;clean all&#8221; to reset the package list:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">yum clean all\n<\/pre>\n\n\n\n<p>I had an indecent with this error : <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Module yaml error: Unexpected key in data: static_context [line 9 col 3]\n<\/pre>\n\n\n\n<p>The solution is simple, just upgrade the module:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">dnf update libmodulemd\n<\/pre>\n\n\n\n<p>Now run again the update<\/p>\n\n\n\n<figure class=\"wp-block-pullquote has-vivid-green-cyan-color has-text-color\"><blockquote><p><strong>Good Luck<\/strong><\/p><\/blockquote><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Somtime the linux machine can not get updates and you get this error: &#8220;Failed to download metadata for repo AppStream&#8221; This can happens if the repo URL is old or got corrupted some how, To fix this just replace the URL with a good and updated one like &#8220;vault.centos.org&#8221; , run from ssh or console [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16,13,12],"tags":[],"class_list":["post-2313","post","type-post","status-publish","format-standard","hentry","category-centos","category-linux","category-tutorials"],"_links":{"self":[{"href":"https:\/\/itsimple.info\/index.php?rest_route=\/wp\/v2\/posts\/2313","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/itsimple.info\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/itsimple.info\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/itsimple.info\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/itsimple.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2313"}],"version-history":[{"count":0,"href":"https:\/\/itsimple.info\/index.php?rest_route=\/wp\/v2\/posts\/2313\/revisions"}],"wp:attachment":[{"href":"https:\/\/itsimple.info\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2313"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itsimple.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2313"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itsimple.info\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2313"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}