×


Error accessing file for config file ///etc/yum.conf – Fix it Now ?

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.

Here at Ibmi Media, as part of our Server Management Services, we regularly help our Customers to perform related yum queries.

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:

wget http://yum.baseurl.org/download/3.2/yum-3.2.28.tar.gz
tar xvf yum-3.2.28.tar.gz
cd yum-3.2.28
touch/etc/yum.conf
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:

cd /usr/local/directadmin/custombuild
./build update
./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.

cd /root
mkdir curl
cd curl
mv /usr/local/lib/libcurl* .
mv /usr/local/include/curl .
ldconfig

In addition, we ensure PHP still works and is correctly re-linked.

For example,

[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

For example,

$ 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.


[Need to fix Linux System yum error? We can help you. ]


Conclusion

This article covers methods to resolve the error, "CRITICAL:yum.cli: Config Error: Error accessing file for config file:///etc/yum.conf" occurs while performing certain actions with yum. 

The replacement of the source-compiled version of curl is to use the rpms instead, eg:

$ yum install libcurl-devel

As the libcurl and curl rpms should already be there by default, as yum needs them.