找回密码
立即注册
发新帖

672

积分

0

好友

207

主题
发表于 2025-3-4 23:15:05 | 查看: 33| 回复: 0
在CentOS系统中,可以通过以下步骤更换yum源:
1.备份原始yum源配置文件:
cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
2.下载新的yum源配置文件(阿里源):
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
3.清空缓存并重新生成缓存:
sudo yum clean allsudo yum makecache
4.更新系统软件包:
sudo yum update
5.完成yum源的更换。
注意事项:
更换yum源可能会导致软件包版本变更或不可用,请谨慎操作。
如果更换yum源后遇到问题,可以恢复原始yum源配置文件:
mv /etc/yum.repos.d/CentOS-Base.repo.backup /etc/yum.repos.d/CentOS-Base.repo

Let the time tell the truth
您需要登录后才可以回帖 登录 | 立即注册

手机版|小黑屋|企业IT论坛

GMT+8, 2025-10-26 17:47 , Processed in 0.066689 second(s), 24 queries .

快速回复 返回顶部 返回列表