yum源配置 centos
时间: 2023-08-03 17:55:21 浏览: 105
yum 源配置
好的,以下是在CentOS中配置yum源的步骤:
1.备份原有的yum源配置文件
```bash
sudo mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak
```
2.下载新的yum源配置文件
CentOS 7:
```bash
sudo wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
```
CentOS 8:
```bash
sudo wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-8.repo
```
3.更新yum缓存
```bash
sudo yum makecache
```
4.测试yum命令是否正常
```bash
sudo yum install vim
```
以上就是在CentOS中配置yum源的步骤,希望能对你有所帮助!
阅读全文