{"id":2180,"date":"2024-10-24T19:37:00","date_gmt":"2024-10-24T17:37:00","guid":{"rendered":"https:\/\/robermb.com\/blog\/?p=2180"},"modified":"2024-10-24T11:56:52","modified_gmt":"2024-10-24T09:56:52","slug":"update-centos-repositories-after-mirrorlist-end-of-life","status":"publish","type":"post","link":"https:\/\/robermb.com\/blog\/geeks\/update-centos-repositories-after-mirrorlist-end-of-life\/","title":{"rendered":"Update CentOS repositories after mirrorlist End of Life"},"content":{"rendered":"\n<p>If you are using CentOS and get this <strong>error<\/strong> when trying to install a package, <strong>\u201cCould not retrieve mirrorlist http:\/mirrorlist.centos.org\u201d<\/strong> <strong>means<\/strong> that <strong>the<\/strong> <strong>mirror<\/strong> \u201cmirrorlist.centos.org\u201d <strong>no longer exists<\/strong>. This is because on June 30, 2024 CentOS has reached its end of life.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Adding currents mirrors<\/h2>\n\n\n\n<p>To solve this problem and continue using the current mirrors we can replace them with these others by executing the following commands :<\/p>\n\n\n\n<ul>\n<li>In a CentOS machine:<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>sed -i 's\/mirrorlist\/#mirrorlist\/g' \/etc\/yum.repos.d\/CentOS-* &amp;&amp; \\\n\nsed -i 's|#baseurl=http:\/\/mirror.centos.org|baseurl=http:\/\/vault.centos.org|g' \/etc\/yum.repos.d\/CentOS-*<\/code><\/pre>\n\n\n\n<ul>\n<li>In a Dockerfile:<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code># Update the repository configuration to use the vault.centos.org mirror\nRUN sed -i 's\/mirrorlist\/#mirrorlist\/g' \/etc\/yum.repos.d\/CentOS-* &amp;&amp; \\\n    sed -i 's|#baseurl=http:\/\/mirror.centos.org|baseurl=http:\/\/vault.centos.org|g' \/etc\/yum.repos.d\/CentOS-*<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Important<\/h2>\n\n\n\n<p>As the project is not ongoing use your <strong>CentOS<\/strong> <strong>systems<\/strong> <strong>only<\/strong> in <strong>test<\/strong> or lab <strong>environments<\/strong>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">More information about CentOS End Of Life<\/h2>\n\n\n\n<p>CentOS reached end of life (EOL) on June 30, 2024.<\/p>\n\n\n\n<p><a href=\"https:\/\/www.redhat.com\/en\/topics\/linux\/centos-linux-eol\">https:\/\/www.redhat.com\/en\/topics\/linux\/centos-linux-eol<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/www.redhat.com\/en\/blog\/centos-linux-going-end-life-what-does-mean-me\">https:\/\/www.redhat.com\/en\/blog\/centos-linux-going-end-life-what-does-mean-me<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you are using CentOS and get this error when trying to install a package, \u201cCould not retrieve mirrorlist http:\/mirrorlist.centos.org\u201d &hellip; <a href=\"https:\/\/robermb.com\/blog\/geeks\/update-centos-repositories-after-mirrorlist-end-of-life\/\" class=\"more-link\">More <span class=\"screen-reader-text\">Update CentOS repositories after mirrorlist End of Life<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":1416,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,8],"tags":[123,35],"_links":{"self":[{"href":"https:\/\/robermb.com\/blog\/wp-json\/wp\/v2\/posts\/2180"}],"collection":[{"href":"https:\/\/robermb.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/robermb.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/robermb.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/robermb.com\/blog\/wp-json\/wp\/v2\/comments?post=2180"}],"version-history":[{"count":1,"href":"https:\/\/robermb.com\/blog\/wp-json\/wp\/v2\/posts\/2180\/revisions"}],"predecessor-version":[{"id":2181,"href":"https:\/\/robermb.com\/blog\/wp-json\/wp\/v2\/posts\/2180\/revisions\/2181"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/robermb.com\/blog\/wp-json\/wp\/v2\/media\/1416"}],"wp:attachment":[{"href":"https:\/\/robermb.com\/blog\/wp-json\/wp\/v2\/media?parent=2180"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/robermb.com\/blog\/wp-json\/wp\/v2\/categories?post=2180"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/robermb.com\/blog\/wp-json\/wp\/v2\/tags?post=2180"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}