Symptoms
You may see YUM return a 404 error like the following.
Loaded plugins: fastestmirror, langpacks, universal-hooks
Loading mirror speeds from cached hostfile
Could not retrieve mirrorlist http://httpupdate.cpanel.net/ea4-c$releasever-x86_64-mirrorlist error was
14: HTTP Error 404 - Not Found
Description
This is caused by the distroverpkg package not being installed. This package contains files that tell YUM what the operating system version is, for example, CentOS 6 or CentOS 7. Without this package, YUM will not be able to properly populate the $releasever variable and consequently, it will not be able to properly form the repository URL.
Workaround
The distroverpkg package will need to be installed manually from the appropriate repository. For this example, we will use a CentOS 7 server.
1) Determine what the name of the distroverpkg package is.
# grep distroverpkg /etc/yum.conf
distroverpkg=centos-release
2) Find the OS repository. The exact commands needed will depend on the OS used. Typically
# ls -l /etc/yum.repos.d/
total 68
-rw-r--r--. 1 root root 1668 Dec 9 15:27 CentOS-Base.repo
-rw-r--r--. 1 root root 1309 Dec 9 15:27 CentOS-CR.repo
-rw-r--r--. 1 root root 649 Dec 9 15:27 CentOS-Debuginfo.repo
-rw-r--r--. 1 root root 315 Dec 9 15:27 CentOS-fasttrack.repo
-rw-r--r--. 1 root root 630 Dec 9 15:27 CentOS-Media.repo
-rw-r--r--. 1 root root 1331 Dec 9 15:27 CentOS-Sources.repo
-rw-r--r--. 1 root root 8515 Dec 9 15:27 CentOS-Vault.repo
-rw-r--r--. 1 root root 616 Dec 9 15:27 CentOS-x86_64-kernel.repo
-rw-r--r-- 1 root root 257 Dec 9 17:44 cPAddons.repo
-rw------- 1 root root 241 Dec 11 02:23 cpanel-plugins.repo
-rw-r--r-- 1 root root 204 Aug 7 2015 EA4.repo
-rw-r--r--. 1 root root 1050 Oct 31 15:33 epel.repo
-rw-r--r--. 1 root root 1149 Oct 31 15:33 epel-testing.repo
-rw-r--r-- 1 root root 775 Dec 9 17:41 Mysql57.repo
-rw-r--r-- 1 root root 286 Dec 10 03:10 wp-toolkit-cpanel.repo
[root@10-2-34-249 ~]# grep baseurl /etc/yum.repos.d/CentOS-Base.repo|grep "/os"
#baseurl=http://centos.cpanel.net/centos/$releasever/os/$basearch/
3) Navigate to the repository in your browser and find the package named in the distroverpkg line from step 1. In this example using a CentOS 7 server, the centos-release package is located in:
http://centos.cpanel.net/centos/7/os/x86_64/Packages/
4) Copy the link address for the package named in the distroverpkg line from step 1. In this example using a CentOS 7 server, the link address will be similar to the following.
http://centos.cpanel.net/centos/7/os/x86_64/Packages/centos-release-7-9.2009.0.el7.centos.x86_64.rpm
5) Install the rpm directly from the repo using the "rpm -i" command, pasting in the previously copied link address. For this example, the following command would be used.
# rpm -i http://centos.cpanel.net/centos/7/os/x86_64/Packages/centos-release-7-9.2009.0.el7.centos.x86_64.rpm
6) Check that YUM is now working by checking the distroverpkg package.
# yum info centos-release
Loaded plugins: fastestmirror, universal-hooks
Loading mirror speeds from cached hostfile
* EA4: 184.94.196.93
* cpanel-addons-production-feed: 184.94.196.93
* cpanel-plugins: 184.94.196.93
* base: centos1.cpanel.net
* epel: pubmirror1.math.uh.edu
* extras: centos1.cpanel.net
* updates: centos1.cpanel.net
Installed Packages
Name : centos-release
Arch : x86_64
Version : 7
Release : 9.2009.0.el7.centos
Size : 44 k
Repo : installed
Summary : CentOS Linux release file
License : GPLv2
Description : CentOS Linux release files
Available Packages
Name : centos-release
Arch : x86_64
Version : 7
Release : 9.2009.1.el7.centos
Size : 27 k
Repo : updates/7/x86_64
Summary : CentOS Linux release file
License : GPLv2
Description : CentOS Linux release files
7) Update the distroverpkg package to ensure it is at the proper version. YUM will prompt you to confirm its actions. If everything looks okay, you can type "Y" and press enter to proceed.
[root@10-2-34-249 ~]# yum update centos-release
Loaded plugins: fastestmirror, universal-hooks
Loading mirror speeds from cached hostfile
* EA4: 184.94.196.93
* cpanel-addons-production-feed: 184.94.196.93
* cpanel-plugins: 184.94.196.93
* base: centos1.cpanel.net
* epel: pubmirror2.math.uh.edu
* extras: centos1.cpanel.net
* updates: centos1.cpanel.net
Resolving Dependencies
--> Running transaction check
---> Package centos-release.x86_64 0:7-9.2009.0.el7.centos will be updated
---> Package centos-release.x86_64 0:7-9.2009.1.el7.centos will be an update
--> Finished Dependency Resolution
Dependencies Resolved
=========================================================================================================================================================================================================================
Package Arch Version Repository Size
=========================================================================================================================================================================================================================
Updating:
centos-release x86_64 7-9.2009.1.el7.centos updates 27 k
Transaction Summary
=========================================================================================================================================================================================================================
Upgrade 1 Package
Total download size: 27 k
Is this ok [y/d/N]: