title: Failed to download metadata for repo appstream
body: <p>Running on <code>centos 8</code> today want to install new package and before it wants to run:</p>
  <p><code>yum update -y</code></p>
  <p>but got this:</p>
  <blockquote>
  <p>Failed to download metadata for repo 'appstream': Cannot prepare
  internal mirrorlist: No URLs in mirrorlist</p>
  </blockquote>
  <p>Then I did search and found a <a href="https://yegorshytikov.medium.com/error-failed-to-download-metadata-for-repo-appstream-cannot-prepare-internal-mirrorlist-no-959768e5f8e5" rel="nofollow noreferrer">solution</a> to fix it:</p>
  <pre><code>sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
  sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
  </code></pre>
  <p>I did this but still error persist, any idea? how to fix this? Is there new solution in 2022?</p>
  <p>After use this <a href="https://haydenjames.io/fix-error-failed-to-download-metadata-for-repo-appstream-centos-8/" rel="nofollow noreferrer">solution</a></p>
  <p>Now error:</p>
  <blockquote>
  <p>Errors during downloading metadata for repository 'extras':</p>
  <ul>
  <li>Status code: 403 for <a href="https://vault.centos.org/centos/8/extras/x86_64/os/repodata/repomd.xml" rel="nofollow noreferrer">https://vault.centos.org/centos/8/extras/x86_64/os/repodata/repomd.xml</a>
  (IP: 13.249.9.66) Error: Failed to download metadata for repo
  'extras': Cannot download repomd.xml: Cannot download
  repodata/repomd.xml: All mirrors were tried</li>
  </ul>
  </blockquote>