CentOS yum 更换源
linux-dash
A beautiful web dashboard for Linux
项目地址:https://gitcode.com/gh_mirrors/li/linux-dash
·
Reference: blog.csdn.net/weixin_53502673/article/details/124869083
1、yum源进行备份
sudo mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
2、获取阿里的yum源配置文件
在文件夹 yum.repos.d 中下载新的配置文件 Centos-7.repo
# 阿里云
sudo wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
# 或腾讯云
# sudo wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.cloud.tencent.com/repo/centos7_base.repo
# 或华为云
# sudo wget -O /etc/yum.repos.d/CentOS-Base.repo https://repo.huaweicloud.com/repository/conf/CentOS-7-reg.repo
如果没有安装 wget , 则通过本地下载https://mirrors.aliyun.com/repo/Centos-7.repo这个文件
改成CentOS-Base.repo 复制到 /etc/yum.repos.d/
3、对yum源生成缓存
执行命令:
sudo yum clean all
sudo yum makecache
如果yum.repos.d中有不可识别的 repo文件,需要删除。
例如之前有文件是isoyum.repo 但是他的内容是
[isoyum]
name=isoyum
baseurl=file:///root/isoyum
enabled=1
gpgcheck=0
而对应的isoyum中没有任何内容,导致yum makecache时失败。后来删除了isoyum.repo 就能完成makecache 了
4、更新yum源
这一步似乎不做也没关系
执行命令:yum -y install update
执行完成之后就可以使用yum源了,到此yum源就更换成功了。
A beautiful web dashboard for Linux
最近提交(Master分支:4 个月前 )
186a802e
added ecosystem file for PM2 5 年前
5def40a3
Add host customization support for the NodeJS version 5 年前
AtomGit 是由开放原子开源基金会联合 CSDN 等生态伙伴共同推出的新一代开源与人工智能协作平台。平台坚持“开放、中立、公益”的理念,把代码托管、模型共享、数据集托管、智能体开发体验和算力服务整合在一起,为开发者提供从开发、训练到部署的一站式体验。
更多推荐



所有评论(0)