Sometimes, we may come across the error "CRITICAL:yum.cli: Config Error: Error accessing file for config file:///etc/yum.conf" while performing certain actions with yum.
This error mainly happens when we switch local yum sources.
In this context, we shall look into methods to fix this yum error.
What triggers "Error accessing file for config file ///etc/yum.conf" ?
Basically, this error happens mainly due to switching local yum sources.
However, in DirectAdmin servers, it triggers due to a broken link to the newer curl library from python.
How to fix "Error accessing file for config file ///etc/yum.conf" ?
1. Switch local yum source
In order to repair, we run:
tar xvf yum-3.2.28.tar.gz
yummain.py install yum
We will have a prompt like this:
base | 3.7 kB 00:00
base/primary_db | 3.5 MB 00:05
epel/metalink | 4.6 kB 00:00
To fix this error in DirectAdmin:
Generally, Custombuild has the permission to allow the curl compile to disable.
In order to do this, in case we have CentOS 6, we use:
./build set curl no
Then we remove custombuild compiled curl libraries/includes.
We need to be very careful with this. There is only minimal testing made on it so far.
mv /usr/local/lib/libcurl* .
mv /usr/local/include/curl .
In addition, we ensure PHP still works and is correctly re-linked.
[root@es6 ~]# ldd /usr/local/bin/php | grep curl
libcurl.so.4 => /usr/lib/libcurl.so.4 (0x005df000)
Usually, we replace the source-compiled version of curl in order to use the RPMs instead
$ yum install libcurl-devel
Since yum need them, the libcurl and curl rpms should already be there by default.
We can also see that the "–with-curl=/usr/local/lib \" line in the configure.php5 did not hurt the inclusion of curl into PHP during the PHP compile. Hence will be left, unless new information about it surfaces.