当前位置: 代码网 > 服务器>服务器>Linux > CentOS系统使用yum命令报错问题及解决

CentOS系统使用yum命令报错问题及解决

2024年12月29日 Linux 我要评论
centos系统使用yum命令报错找到文件/etc/yum.repos.d/centos-base.repo替换源文件为# centos-base.repo## the mirror system u

centos系统使用yum命令报错

找到文件

/etc/yum.repos.d/centos-base.repo

替换源文件为

# centos-base.repo
#
# the mirror system uses the connecting ip address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client.  you should use this for centos updates
# unless you are manually picking other mirrors.
#
# if the mirrorlist= does not work for you, as a fall back you can try the 
# remarked out baseurl= line instead.
#
#
 
[base]
name=centos-$releasever - base - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/os/$basearch/
        http://mirrors.aliyuncs.com/centos/$releasever/os/$basearch/
        http://mirrors.cloud.aliyuncs.com/centos/$releasever/os/$basearch/
gpgcheck=0
gpgkey=http://mirrors.aliyun.com/centos/rpm-gpg-key-centos-7
 
#released updates 
[updates]
name=centos-$releasever - updates - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/updates/$basearch/
        http://mirrors.aliyuncs.com/centos/$releasever/updates/$basearch/
        http://mirrors.cloud.aliyuncs.com/centos/$releasever/updates/$basearch/
gpgcheck=0
gpgkey=http://mirrors.aliyun.com/centos/rpm-gpg-key-centos-7
 
#additional packages that may be useful
[extras]
name=centos-$releasever - extras - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/extras/$basearch/
        http://mirrors.aliyuncs.com/centos/$releasever/extras/$basearch/
        http://mirrors.cloud.aliyuncs.com/centos/$releasever/extras/$basearch/
gpgcheck=0
gpgkey=http://mirrors.aliyun.com/centos/rpm-gpg-key-centos-7
 
#additional packages that extend functionality of existing packages
[centosplus]
name=centos-$releasever - plus - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/centosplus/$basearch/
        http://mirrors.aliyuncs.com/centos/$releasever/centosplus/$basearch/
        http://mirrors.cloud.aliyuncs.com/centos/$releasever/centosplus/$basearch/
gpgcheck=0
enabled=0
gpgkey=http://mirrors.aliyun.com/centos/rpm-gpg-key-centos-7
 
#contrib - packages by centos users
#[contrib]
#name=centos-$releasever - contrib - mirrors.aliyun.com
#failovermethod=priority
#baseurl=http://mirrors.aliyun.com/centos/$releasever/contrib/$basearch/
#        http://mirrors.aliyuncs.com/centos/$releasever/contrib/$basearch/
#        http://mirrors.cloud.aliyuncs.com/centos/$releasever/contrib/$basearch/
#gpgcheck=1
#enabled=0
#gpgkey=http://mirrors.aliyun.com/centos/rpm-gpg-key-centos-7

总结

以上为个人经验,希望能给大家一个参考,也希望大家多多支持代码网。

(0)

相关文章:

版权声明:本文内容由互联网用户贡献,该文观点仅代表作者本人。本站仅提供信息存储服务,不拥有所有权,不承担相关法律责任。 如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 2386932994@qq.com 举报,一经查实将立刻删除。

发表评论

验证码:
Copyright © 2017-2025  代码网 保留所有权利. 粤ICP备2024248653号
站长QQ:2386932994 | 联系邮箱:2386932994@qq.com