Files
Linux/Docs/Centos7更换阿里源.md
offends cd4e994942
All checks were successful
continuous-integration/drone Build is passing
修改Centos7更换阿里源文档不足
2025-11-06 20:25:40 +08:00

30 lines
526 B
Markdown

> 本文作者:丁辉
# Centos7更换阿里源
1. 备份本地Yum源
```bash
mkdir -p /etc/yum.repos.d/backup/
mv /etc/yum.repos.d/*.repo /etc/yum.repos.d/backup/
```
2. 下载阿里云Yum源
```bash
curl -so /etc/yum.repos.d/Centos-7.repo http://mirrors.aliyun.com/repo/Centos-7.repo
curl -so /etc/yum.repos.d/epel-7.repo http://mirrors.aliyun.com/repo/epel-7.repo
```
3. *删除缓存数据*
```bash
yum clean all
```
4. *创建元数据缓存*
```bash
yum makecache
```