Site icon Learning & Doing

Could not retrieve mirrorlist http://mirrorlist.centos.org/ on CentOS 7

“Could not retrieve mirrorlist http://mirrorlist.centos.org/ on CentOS 7”

Daftar Isi

Pengantar

Untuk Centos 7 sudah EOL pada tanggal 30 Juni 2024. Sehingga dari developer memindahkan repo domain seperti informasi berikut :

On July 1, 2024, CentOS 7 reached end of life, and the CentOS team has moved its repositories to the archive at vault.centos.org. Without manually updating the repository URLs, packages cannot be updated or validated, resulting in these errors.
Could not retrieve mirrorlist http://mirrorlist.centos.org?arch=x86_64&release=7&repo=sclo-sclo error was
14: curl#6 - "Could not resolve host: mirrorlist.centos.org; Name or service not known"
 
As a workaround, it's possible to manually change the repositories to the archive URL: vault.centos.org

Maka mulai 1 juli 2024 repositori Centos 7 di pindahkan dari mirrorlist.centos.org ke vault.centos.org. Sehingga jika masih menggunakan repository yang lama ketika melakukan yum update akan mengalami error berikut :

Could not retrieve mirrorlist http://mirrorlist.centos.org?arch=x86_64&release=7&repo=sclo-sclo error was
14: curl#6 - "Could not resolve host: mirrorlist.centos.org; Name or service not known"

Solution

yum repolist all
cp -v /etc/yum.repos.d/CentOS-Base.repo{,-backup}

hasilnya setelah di backup

nano /etc/yum.repos.d/CentOS-Base.repo

Ganti jadi file berikut :

[base]
priority=1
name=CentOS-$releasever - Base
baseurl=https://vault.centos.org/7.9.2009/os/$basearch
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

#released updates 
[updates]
priority=1
name=CentOS-$releasever - Updates
baseurl=https://vault.centos.org/7.9.2009/updates/$basearch
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

#additional packages that may be useful
[extras]
priority=1
name=CentOS-$releasever - Extras
baseurl=https://vault.centos.org/7.9.2009/extras/$basearch
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

#additional packages that extend functionality of existing packages
[centosplus]
priority=1
name=CentOS-$releasever - Plus
baseurl=https://vault.centos.org/7.9.2009/centosplus/$basearch
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
yum clean all && yum makecache
yum update

Penutup

Sahabat Blog Learning & Doing demikianlah penjelasan mengenai Could not retrieve mirrorlist http://mirrorlist.centos.org/ on CentOS 7. Semoga Bermanfaat . Sampai ketemu lagi di postingan berikut nya.

Exit mobile version