Centos7 更新yum报错http://nginx.org/packages/centos/$releaserver/x86_64/repodata/repomd.xml: [Errno 14]

时间:2024-03-15 11:23:16

新安装好的centos7,下载新的yum源,在yum update和yum makecache 时报错如下:

Centos7 更新yum报错http://nginx.org/packages/centos/$releaserver/x86_64/repodata/repomd.xml: [Errno 14]

修改nginx.repo

vim /etc/yum.repos.d/nginx.repo

[nginx]

name=nginx repo
baseurl=http://nginx.org/packages/centos/$releaserver/x86_64/
gpgcheck=0
enabled=1

修改为

[nginx]

name=nginx repo
baseurl=http://nginx.org/packages/centos/7/x86_64/     #7为当前centos的版本号
gpgcheck=0
enabled=1