# Linux更换阿里云yum源

Linux更换阿里云yum源

1.进入以下目录

cd /etc/yum.repos.d

2.清空目录内容

rm -rf *

3.创建文件目录,挂载iso镜像

mkdir /mnt/cdrom
mount /dev/cdrom /mnt/cdrom

4.创建repo文件,并填充以下内容

vi test.repo
[test-server]
name=test
baseurl=file:///mnt/cdrom
enabled=1
gpgcheck=0

5.此时本地yum源已经可以使用,但是地址是国外,如果要配置阿里云yum源,可以先下载wget工具

yum -y install wget

6.对本地yum源进行删除或者备份

备份命令如下:注意yum源的名字可能不同

 mv /etc/yum.repos.d/test.repo /etc/yum.repos.d/test.repo.backup

7.下载阿里云的yum源

阿里巴巴开源镜像站:阿里巴巴开源镜像站-OPSX镜像站-阿里云开发者社区

wget -O /etc/yum.repos.d/epel.repo https://mirrors.aliyun.com/repo/epel-7.repo

8.清除和创建缓存

yum clean all
yum makecache

原文链接:

[https://blog.csdn.net/qq_35796004/article/details/127328197]:

posted @ 2023-07-07 13:49  剑心空明  阅读(51)  评论(0编辑  收藏  举报  来源