Error: Failed to download metadata for repo ‘AppStream‘Failed to download metadata for repo ‘AppS...

Solve the error: Failed to download metadata for repo 'AppStream'Error: Failed to download metadata for repo 'AppStream'

When yum install -y httpdinstalling httpd, an error message appears:

Failed to download metadata for repo 'AppStream'
Error: Failed to download metadata for repo 'AppStream'

insert image description here

Solution:

1. Go to the repos directory of yum

cd /etc/yum.repos.d/

2. Modify the content of the centos file

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

3. Generate a cache update (the first update, the speed is a little slow, wait patiently for about two minutes)

yum makecache

4. Run yum install -y httpd

yum install -y httpd

insert image description here

So far, the problem has been successfully solved!

  • View httpd status
systemctl status httpd.service
  • open httpd
sudo service httpd start

insert image description here

Guess you like

Origin blog.csdn.net/weixin_43576565/article/details/131460643