Applicable to:
- Plesk for Linux
Symptoms
Errors like these appear during various actions that use yum
on CentOS 7 (e.g. Plesk updates, system updates, package installations, etc.)
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock error was
14: curl#6 - "Could not resolve host: mirrorlist.centos.org; Name or service not known"
14: curl#6 - "Failed to resolve host: mirrorlist.centos.org; Unknown error"
Cannot find a valid baseurl for repo: base/7/x86_64
Cause
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 updating the repository URLs, packages cannot be updated or validated, resulting in these errors.
Solution
An automated fix was released for Plesk 18.0.61 and 18.0.62. The repositories will be adjusted automatically once the latest Plesk updates have been installed.
For Plesk 18.0.60 and earlier
-
Log in via SSH
-
Run this command to download and execute a fix script:
# curl -fsSL https://autoinstall.plesk.com/PSA_18.0.62/examiners/repository_check.sh | bash -s -- update >/dev/null
Manual Steps-
Log in via SSH
-
Edit
/etc/yum.repos.d/CentOS-Base.repo
-
Replace its contents with the following:
[base]
name=CentOS-$releasever - Base
baseurl=http://vault.centos.org/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
[updates]
name=CentOS-$releasever - Updates
baseurl=http://vault.centos.org/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
[extras]
name=CentOS-$releasever - Extras
baseurl=http://vault.centos.org/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 -
Run these commands to refresh package cache:
# yum clean all && yum makecache
-
Note: Once the solution has been applied, consider ugprading to a newer OS using one of the available options.
Comments
2 comments
Hello, I get a 404 error when I try to run the script :
http://centos.mirrors.ovh.net/ftp.centos.org/7/os/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 404 - Not Found Trying other mirror. To address this issue please refer to the below wiki article https://wiki.centos.org/yum-errors If above article doesn't help to resolve this issue please use https://bugs.centos.org/. http://centos.mirrors.ovh.net/ftp.centos.org/7/extras/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 404 - Not Found Trying other mirror. http://centos.mirrors.ovh.net/ftp.centos.org/7/updates/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 404 - Not Found Trying other mirror. Unable to create yum cache for 'base' OS repository. Make sure the repository is available, otherwise either disable it or fix its configuration, then try again. Unable to create yum cache for 'extras' OS repository. Make sure the repository is available, otherwise either disable it or fix its configuration, then try again. Unable to create yum cache for 'updates' OS repository. Make sure the repository is available, otherwise either disable it or fix its configuration, then try again.
Best regards Eric
Thanks for the valuable information. Really appreciate it. URL
Please sign in to leave a comment.