skip to Main Content

I got issue in centos
Error: Failed to download metadata for repo ‘AppStream’: Cannot prepare internal mirrorlist |Centos

try below steps:

Please mentions your issue messages and solution too

my Solution to this issue is
Solution.1

Go to /etc/yum.repos.d/

cd /etc/yum.repos.d/

Run

sudo sed -i ‘s/mirrorlist/#mirrorlist/g’ /etc/yum.repos.d/CentOS-*
sudo sed -i ‘s|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g’ /etc/yum.repos.d/CentOS-*
sudo yum update -y

i was still getting error below

CentOS Linux 8 – AppStream 111 B/s | 38 B 00:00
Error: Failed to download metadata for repo ‘appstream’: Cannot prepare internal mirrorlist: No URLs in mirrorlist

Solution worked.

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-*

2

Answers


  1. I send the commands and now it is working:

    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-*
    

    Thanks so much.

    Login or Signup to reply.
  2. [root@ip-172-31-39-44 yum.repos.d]# sed -i ‘s/mirrorlist/#mirrorlist/g’ /etc/yum.repos.d/CentOS-*
    sed: can’t read /etc/yum.repos.d/CentOS-*: No such file or directory

    i got this error when i apply abouve links on my ec2 server

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search