Software⏱️ 3 min read📅 2026-06-19

How to Fix: yum install error

yum install error fix

Quick Answer: Change the permissions of yum.conf and yum.repos.d files to root:root, then try running the yum command again.

The error 'Config Error: Error accessing file for config file:///etc/yum.conf' occurs when the yum command is executed on a server, preventing the installation of packages. This issue affects users who rely on yum for package management and can be frustrating to resolve.

This error is caused by an incorrect configuration in the yum settings, specifically with regards to file permissions. The yum command requires read and write access to the /etc/yum.conf file, which is not being granted due to the 0666 permissions setting.

🔍 Why This Happens

  • The primary reason for this error is that the /etc/yum.conf file has incorrect permissions, preventing the yum command from accessing it. The current permissions of 0666 are too permissive and do not allow the root user to write to the file.
  • An alternative cause could be a misconfigured or missing /etc/yum.repos.d directory, which is required for yum to function correctly.

🚀 How to Resolve This Issue

Changing File Permissions

  1. Step 1: Change the permissions of the /etc/yum.conf file to allow the root user to write to it using the command 'chmod 644 /etc/yum.conf'. This will set the permissions to read and write for the owner (root) and group, while maintaining read-only access for others.
  2. Step 2: Verify that the yum command can now successfully install packages by running 'yum update' or 'yum install package_name'.
  3. Step 3: If the issue persists, check the yum configuration files for any other errors or misconfigurations.

Recreating the /etc/yum.repos.d Directory

  1. Step 1: Create a new directory called /etc/yum.repos.d using the command 'mkdir -p /etc/yum.repos.d'. This will ensure that the yum configuration files are properly organized and accessible.
  2. Step 2: Copy the existing yum repositories to the newly created /etc/yum.repos.d directory. For example, if you have a file called 'fedora.repo', copy it to '/etc/yum.repos.d/fedora.repo'.
  3. Step 3: Verify that the yum command can now successfully install packages by running 'yum update' or 'yum install package_name'.

✨ Wrapping Up

To resolve the 'Config Error: Error accessing file for config file:///etc/yum.conf' issue, change the permissions of the /etc/yum.conf file to allow the root user to write to it. Alternatively, recreate the /etc/yum.repos.d directory and copy the existing yum repositories to ensure proper configuration. If issues persist, verify the yum configuration files for any other errors or misconfigurations.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions