Centos 8 : Failed to download metadata for repo 'appstream'
Introducción
Algunasveces con los cambios que existen en el ecosistema linux, como pueden ser los movimientos derivados de las actividades de Redhat, y en consecuencia sus derivados más directo Fedora y Centos, te saltan problemas esta vez y gracias a Proyectoa no perdi mucho el tiempo. ¡¡Gracias!!
Error
El error es simple, quieres actualiza o instalar algo y zas.
CentOS Linux 8 – AppStream Error: Failed to download metadata for repo ‘appstream’: Cannot prepare internal mirrorlist: No URLs in mirrorlist
yum -y install elink
CentOS Linux 8 - AppStream 163 B/s | 38 B 00:00
Error: Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: No URLs in mirrorlist
Solución
Comentar los mirrorlist
sed -i -e "s|mirrorlist=|#mirrorlist=|g" /etc/yum.repos.d/CentOS-*
Modificar el baseurl
Modificaremos el baseurl de todos los ficheros del yum.repos.d
sed -i -e "s|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g" /etc/yum.repos.d/CentOS-*
Limpieza de caches y actualización del repositorio
[root@monitor01 ~] dnf clean all
91 files removed
[root@monitor01 ~]# dnf swap centos-linux-repos centos-stream-repos
CentOS Linux 8 - AppStream 2.2 MB/s | 8.4 MB 00:03
CentOS Linux 8 - BaseOS 2.5 MB/s | 4.6 MB 00:01
CentOS Linux 8 - Extras 70 kB/s | 10 kB 00:00
MariaDB 516 kB/s | 601 kB 00:01
ELRepo.org Community Enterprise Linux Repository - el8 321 kB/s | 171 kB 00:00
Extra Packages for Enterprise Linux 8 - x86_64 3.1 MB/s | 11 MB 00:03
Extra Packages for Enterprise Linux Modular 8 - x86_64 1.1 MB/s | 1.0 MB 00:00
Remi's Modular repository for Enterprise Linux 8 - x86_64 1.3 MB/s | 973 kB 00:00
Safe Remi's RPM repository for Enterprise Linux 8 - x86_64 2.4 MB/s | 2.1 MB 00:00
Webmin Distribution Neutral 3.2 MB/s | 18 MB 00:05
Zabbix Official Repository - x86_64 212 kB/s | 240 kB 00:01
Zabbix Official Repository non-supported - x86_64 1.9 kB/s | 1.2 kB 00:00
Dependencies resolved.
=============================================================================================================================================================================================
Package Architecture Version Repository Size
=============================================================================================================================================================================================
Installing:
centos-stream-repos noarch 8-3.el8 extras 19 k
Removing:
centos-linux-repos noarch 8-3.el8 @baseos 26 k
Transaction Summary
=============================================================================================================================================================================================
Install 1 Package
Remove 1 Package
Total download size: 19 k
Is this ok [y/N]: y
Downloading Packages:
centos-stream-repos-8-3.el8.noarch.rpm 227 kB/s | 19 kB 00:00
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 216 kB/s | 19 kB 00:00
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : centos-stream-repos-8-3.el8.noarch 1/2
Erasing : centos-linux-repos-8-3.el8.noarch 2/2
warning: /etc/yum.repos.d/CentOS-Linux-PowerTools.repo saved as /etc/yum.repos.d/CentOS-Linux-PowerTools.repo.rpmsave
warning: /etc/yum.repos.d/CentOS-Linux-Plus.repo saved as /etc/yum.repos.d/CentOS-Linux-Plus.repo.rpmsave
warning: /etc/yum.repos.d/CentOS-Linux-HighAvailability.repo saved as /etc/yum.repos.d/CentOS-Linux-HighAvailability.repo.rpmsave
warning: /etc/yum.repos.d/CentOS-Linux-FastTrack.repo saved as /etc/yum.repos.d/CentOS-Linux-FastTrack.repo.rpmsave
warning: /etc/yum.repos.d/CentOS-Linux-Extras.repo saved as /etc/yum.repos.d/CentOS-Linux-Extras.repo.rpmsave
warning: /etc/yum.repos.d/CentOS-Linux-Devel.repo saved as /etc/yum.repos.d/CentOS-Linux-Devel.repo.rpmsave
warning: /etc/yum.repos.d/CentOS-Linux-ContinuousRelease.repo saved as /etc/yum.repos.d/CentOS-Linux-ContinuousRelease.repo.rpmsave
warning: /etc/yum.repos.d/CentOS-Linux-BaseOS.repo saved as /etc/yum.repos.d/CentOS-Linux-BaseOS.repo.rpmsave
warning: /etc/yum.repos.d/CentOS-Linux-AppStream.repo saved as /etc/yum.repos.d/CentOS-Linux-AppStream.repo.rpmsave
Verifying : centos-stream-repos-8-3.el8.noarch 1/2
Verifying : centos-linux-repos-8-3.el8.noarch 2/2
Installed:
centos-stream-repos-8-3.el8.noarch
Removed:
centos-linux-repos-8-3.el8.noarch
Complete!
Ya lo tienes.
Aviso
Esta documentación y su contenido, no implica que funcione en tu caso o determinados casos. También implica que tienes conocimientos sobre lo que trata, y que en cualquier caso tienes copias de seguridad. El contenido el contenido se entrega, tal y como esta, sin que ello implique ningún obligación ni responsabilidad por parte de Castris
Si necesitas soporte profesional puedes contratar con Castris soporte profesional.