Easyapache failing on CentOS server

Had an issue with one on our CentOS cPanel servers running 64 bit and cPanels easyapache upgrade. The folks at cPanel helped out with their usual professional response

The cause of the EasyApache failure, according to the log, was a failure of the package manager, in this case yum.  This was caused by a problem with domain name resolution, which was preventing yum from accessing its mirrors.  Here is what I found:

[root@server ~]# yum check-update
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=5&arch=x86_64&repo=os error was
[Errno 4] IOError: <urlopen error (-2, ‘Name or service not known’)>
Error: Cannot retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and try again
[root@server ~]# host mirrorlist.centos.org
[root@server ~]#

Note that no result was returned for mirrorlist.centos.org.  To correct this, I added the following to the top of the /etc/resolv.conf file:


This is one of the root nameservers.  After I made this change, mirrorlist.centos.org was resolvable, and yum worked correctly:

[root@server ~]# host mirrorlist.centos.org
mirrorlist.centos.org has address
[root@server ~]# yum check-update
base                      100% |=========================| 1.1 kB    00:00    
updates                   100% |=========================|  951 B    00:00    
addons                    100% |=========================|  951 B    00:00    
extras                    100% |=========================| 1.1 kB    00:00    
Excluding Packages in global exclude list

wget.x86_64                              1.10.2-7.el5           base           
[root@server ~]#

Adding a root nameserver to /etc/resolv.conf is meant to be a temporary measure, so you will need to take a look at the other nameservers listed in the file and make sure they are valid recursive nameservers that will do host look-ups for domains that they do not host.

EasyApache should work properly now.