close

[Fixed] Failed to download metadata for repo ‘appstream’: Cannot prepare internal mirrorlist: No URLs in mirrorlist

Today We are Going To Solve Failed to download metadata for repo ‘appstream’: Cannot prepare internal mirrorlist: No URLs in mirrorlist in Linux. Here we will Discuss All Possible Solutions and How this error Occurs So let’s get started with this Article.

How to Fix Failed to download metadata for repo ‘appstream’: Cannot prepare internal mirrorlist: No URLs in mirrorlist Error?

  1. How to Fix Failed to download metadata for repo ‘appstream’: Cannot prepare internal mirrorlist: No URLs in mirrorlist Error?

    To Fix Failed to download metadata for repo ‘appstream’: Cannot prepare internal mirrorlist: No URLs in mirrorlist ErrorJust try this. First of all you have to run these command one by one. sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-Linux-*sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-Linux-* Now You have to upgrade to centos 8 streams. So for upgrading use these commands: sudo dnf install centos-release-stream -y sudo dnf swap centos-{linux,stream}-repos -y sudo dnf distro-sync -y This will help you to solve this error:

  2. Failed to download metadata for repo ‘appstream’: Cannot prepare internal mirrorlist: No URLs in mirrorlist Error?

    To Fix Failed to download metadata for repo ‘appstream’: Cannot prepare internal mirrorlist: No URLs in mirrorlist Error Just run these commands.To solve this error the first thing you must have is gpg keys: wget 'http://mirror.centos.org/centos/8-stream/BaseOS/x86_64/os/Packages/centos-gpg-keys-8-3.el8.noarch.rpm' sudo rpm -i 'centos-gpg-keys-8-3.el8.noarch.rpm'Then just try the below command which is simply ignores all of yours information and downloads information. dnf --disablerepo '*' --enablerepo=extras swap centos-linux-repos centos-stream-repos And at the last just upgrade it by given command: sudo dnf distro-sync This will completely solve your error. Thank you!

Solution 1 : Run these commands

First of all you have to run these command one by one.

sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-Linux-*
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-Linux-*

Now You have to upgrade to centos 8 streams. So for upgrading use these commands:

 sudo dnf install centos-release-stream -y
 sudo dnf swap centos-{linux,stream}-repos -y
 sudo dnf distro-sync -y

This will help you to solve this error:

Solution 2 : Run these commands

To solve this error the first thing you must have is gpg keys:

wget 'http://mirror.centos.org/centos/8-stream/BaseOS/x86_64/os/Packages/centos-gpg-keys-8-3.el8.noarch.rpm'
sudo rpm -i 'centos-gpg-keys-8-3.el8.noarch.rpm'

Then just try the below command which is simply ignores all of yours information and downloads information.

dnf --disablerepo '*' --enablerepo=extras swap centos-linux-repos centos-stream-repos

And at the last just upgrade it by given command:

sudo dnf distro-sync

This will completely solve your error. Thank you!

Solution 3 : upgrade CentOS

To solve this error you have to just migrate from CentOS 8 to CentOS Stream 8. This will also solve your error.

Conclusion

So these were all possible solutions to this error. I hope your error has been solved by this article. In the comments, tell us which solution worked? If you liked our article, please share it on your social media and comment on your suggestions. Thank you.

Also Read This Solutions

Leave a Comment