Arxiu d'etiquetes: configuració

Com arreglar l’errada YumRepo Error All mirror urls are not using ftp https or file

De ben segur que molts dels que administrau servidors amb CentOS voleu saber com arreglar l’errada YumRepo Error All mirror urls are not using ftp https or file quan heu realitzat un update recentment.

L’altre dia revisant el servidor d’un amic, me va comentar que el plesk li generava una serie d’errades, que no aconseguia actualitzar el sistema correctament.

Vaig accedir a la màquina mitjançant ssh i procedeixo a realitzar un update manualment:

root@servidor01:~$ yum -y update

A lo que el sistema respon:

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

Donc pel que sembla el CentOS 6 ha arribat al EOL i han passat els repositoris a vault. Per tant per arreglar-ho hem de canviar les url dels repositoris. Ara us mostraré com fer-ho.

En primer lloc, procediu a realitzar una còpia de seguretat del CentOS-Base.repo

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

Ara modificarem el fitxer CentOS-Base.repo de la següent forma:

[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 vegada hem desat, tornam a provar de fer un update.

root@servidor01:~$ yum -y update

Si tot ha anat bé, actualitzarà el sistema.

En cas de detectar alguna errada, prova de realitzar un update amb skip-broken

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

Espero sigui d’ajuda.

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