Bobcares

Error accessing file for config file ///etc/yum.conf – How to fix

by | May 31, 2021

It is quite common that we come across the error “CRITICAL:yum.cli: Config Error: Error accessing file for config file:///etc/yum.conf” while performing certain actions with yum.

Generally, this happens when we switch local yum sources.

As part of our Server Management Services, we assist our customers with several yum queries.

Today, let us see how to fix this error.

 

What causes “Error accessing file for config file ///etc/yum.conf”?

As we mentioned earlier, 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.

 

Solution to the error

Moving ahead, let us see how our Support Techs fix this error for our customers.

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

Fix for DirectAdmin server

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.

[Finding the method hard? We can help you]

 

Conclusion

To conclude, the error, “CRITICAL:yum.cli: Config Error: Error accessing file for config file:///etc/yum.conf” occurs while performing certain actions with yum. Today, we saw how our Support Techs fix it.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

var google_conversion_label = "owonCMyG5nEQ0aD71QM";

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.