yum 安装错误

yum 安装错误

如果没有收到此信息,我就无法yum在我的服务器上运行命令:

CRITICAL:yum.cli:Config Error: Error accessing file for config file:///etc/yum.conf

这就是我的yum.conf样子:

# This is the fedorafaq.org yum.conf for Fedora Core 5.
#
# Note that you also need the rest of the configuration
# as described at http://www.fedorafaq.org/#yumconf

[main]
cachedir=/var/cache/yum
keepcache=0
debuglevel=2
logfile=/var/log/yum.log
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1
metadata_expire=1800

# PUT YOUR REPOS HERE OR IN separate files named file.repo
# in /etc/yum.repos.d

这就是我的yum.repos.d样子:

fedora.repo
fedora-updates.repo
fedora-updates-testing.repo

这些文件的权限是 0666,它不允许我制作它们root:root

答案1

如果您无法将文件更改为 root:root; 并且您是 root。那么最可能的情况是该文件已设置 immutable 参数。确认并更改文件的属性。

# lsattr /etc/yum.conf
----i--------e-- /etc/yum.conf 

如果这是上一个命令的输出,请执行以下操作。

# chattr -i /etc/yum.conf
# lsattr /etc/yum.conf
-------------e-- /etc/yum.conf

相关内容