centos 添加软件源
时间: 2023-08-24 18:10:53 浏览: 94
Opensuse11.0 软件源添加
要在CentOS上添加软件源,可以按照以下步骤进行操作:
1. 备份原软件源文件:
运行以下命令备份原软件源文件:
```
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
```
2. 下载新的软件源配置文件:
运行以下命令下载新的软件源配置文件:
```
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
```
3. 生成本地缓存:
运行以下命令生成本地缓存,以加快搜索和安装软件的速度:
```
yum clean all && yum makecache
```
4. 验证软件源是否添加成功:
运行以下命令查看软件源是否添加成功:
```
yum repolist
```
通过以上步骤,你可以在CentOS上成功添加新的软件源。\[2\]\[3\]
#### 引用[.reference_title]
- *1* *2* [在CentOS上添加软件源](https://blog.csdn.net/cgm625637391/article/details/112196503)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
- *3* [CentOS7配置软件源](https://blog.csdn.net/weixin_45855175/article/details/122029750)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文