×

CentOS 7 – Yum post mortem

Come tutte le cose belle, anche CentOS 7 ci ha salutato. Nel caso non avessimo fatto in tempo a gestire la migrazione a qualcosa di più recente, ma sopratutto supportato, potremmo incorrere in qualche problema con yum.

Non che ci serva più aggiornare il sistema, ma nel caso avessimo bisogno di installare un pacchetto o una dipendenza yum andrebbe a scaricare quest’ultimo da un mirror, i quali elenchi non funzionano più.

Per sistemare questo problema bisogna andare nella configurazione di ogni repository di CentOS, commentare la voce mirrorlist e decommentare la voce baseurl come spiegato nei commenti del file

[luca@centos7-server ~]$ cat /etc/yum.repos.d/CentOS-Base.repo

Ecco come appare

#CentOS-Base.repo

# 

#The mirror system uses the connecting IP address of the client and the

#update status of each mirror to pick mirrors that are updated to and

#geographically close to the client. You should use this for CentOS updates

#unless you are manually picking other mirrors.

#

#If the #mirrorlist= does not work for you, as a fall back you can try the

#remarked out baseurl= line instead.

[base]
name=CentOS-$releasever - Base

#mirrorlist=http://#mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra

baseurl=http://vault.centos.org/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

Essendo parecchi, due sed possono fare il lavoro al posto nostro

sed -i.bak 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
sed -i.bak 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*

Essendo parecchi, due sed possono fare il lavoro al posto nostro

sed -i.bak 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
sed -i.bak 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*

Dopodiché

yum clean all
yum update

Per avere la conferma “No packages marked for update”, ma almeno non avremo errore.

Giusto una soluzione tampone fino a quando non migreremo a qualcos’altro oppure tenteremo l’aggiornamento a AlmaLinux 8.