Archivo por meses: febrero 2021

Cómo arreglar el error YumRepo Error All mirror urls are not using ftp https or file

Seguro que muchos de los que administráis servidores con centOS queréis saber cómo arreglar el error YumRepo Error All mirror urls are not using ftp https or file cent YumRepo al realizar un update.

El otro día revisando el servidor de un amigo, me comentó que el plesk le generaba una serie de errores, que no conseguía actualizar el sistema correctamente.

Accedo a la máquina vía SSH y procedo a realizar un update:

root@servidor01:~$ yum -y update

A lo que el sistema me responde:

"YumRepo Error: All mirror URLs are not using ftp, http[s] or file."
 Eg. Invalid release/repo/arch combination/ removing mirrorlist with no valid mirrors: /var/cache/yum/x86_64/6/base/mirrorlist txt
"Error: Cannot find a valid baseurl for repo: base" 

Bien, parece ser que como es un centOS 6 y ha llegado al EOL pasan los repositorios al vault. Por lo que tendremos que modificar las url de los repositorios.

En primer lugar, proceded a realizar una copia de seguridad, por si las moscas del CentOS-BASE.repo, como sigue:

root@servidor01:~$ cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo-bak

De esta forma nos aseguramos que no lo perdemos.

Ahora modificamos con nuestro editor favorito, el fichero CentOS-BASE.repo, con lo siguiente:

[base] name=CentOS-$releasever - Base
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra
baseurl=http://vault.centos.org/6.10/os/$basearch/
gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
#released updates
[updates] name=CentOS-$releasever - Updates
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates&infra=$infra
baseurl=http://vault.centos.org/6.10/updates/$basearch/
gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
#additional packages that may be useful
[extras] name=CentOS-$releasever - Extras
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras&infra=$infra
baseurl=http://vault.centos.org/6.10/extras/$basearch/
gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
#additional packages that extend functionality of existing packages
[centosplus] name=CentOS-$releasever - Plus
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus&infra=$infra
baseurl=http://vault.centos.org/6.10/centosplus/$basearch/
gpgcheck=1 enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
#contrib - packages by Centos Users [contrib] name=CentOS-$releasever - Contrib
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib&infra=$infra baseurl=http://vault.centos.org/6.10/contrib/$basearch gpgcheck=1 enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

Una vez guardado realizamos un update

root@servidor01:~$ yum -y update

Si ha ido bien, nos actualizará el sistema.

En caso de detectar algún error. Prueba a realizar un update con skip-broken.

root@servidor01:~$ yum update --skip-broken

Espero os sea de ayuda.

Vía: How to fix YumRepo Error All mirror urls are not using ftp https or file cent YumRepo | Tech IT Admin