# 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 @   剑心空明  阅读(121)  评论(0编辑  收藏  举报  
相关博文:
阅读排行:
· 分享4款.NET开源、免费、实用的商城系统
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· 上周热点回顾(2.24-3.2)
点击右上角即可分享
微信分享提示