首页 > 编程知识 正文

更换yum源,ubuntu更换阿里源

时间:2023-05-03 14:26:46 阅读:238246 作者:4800

CentOS8 更换阿里yum源

1 查看 epel.repo信息

cd /etc/yum.repos.d/cat epel.repo

2 配置epel 配置包

yum install -y https://mirrors.aliyun.com/epel/epel-release-latest-8.noarch.rpm

3 查看 epel.repo信息

cd /etc/yum.repos.d/cat epel.repo

4 备份原有的源

mv /etc/yum.repos.d/epel.repo /etc/yum.repos.d/epel.repo.backupmv /etc/yum.repos.d/epel-testing.repo /etc/yum.repos.d/epel-testing.repo.backup

5 安装CentOS-8.repo

wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-8.repo

6 将repo 配置中的地址替换为阿里云镜像站地址

sed -i 's|^#baseurl=https://download.fedoraproject.org/pub|baseurl=https://mirrors.aliyun.com|' /etc/yum.repos.d/epel*sed -i 's|^metalink|#metalink|' /etc/yum.repos.d/epel*

7 列出所有的yum repo

yum repolist

8 清除yum 缓存

yum makecache

9 查看源

cd /etc/yum.repos.d/cat CentOS-Base.repocat CentOS-AppStream.repocat CentOS-Extras.repo

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。