centos更换阿里源

本文详细介绍了如何将CentOS 6、7、8操作系统更换为阿里云的YUM源,包括备份原有源,下载阿里云源配置文件,清理缓存并生成新缓存的步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Centos6更换阿里源

yum -y install wget

1.首先备份原来的cent os官方yum源

cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak

2.获取阿里的yum源覆盖本地官方yum源

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo

3.清理yum缓存,并生成新的缓存

yum clean all

yum makecache

 

 

Centos7更换阿里源

yum -y install wget

1.首先备份原版/etc/yum.repos.d/CentOS-Base.repo

cd /etc/yum.repos.d sudo mv CentOS-Base.repo CentOS-Base.repo.bak

2.下载阿里的yum源配置文件,放入/etc/yum.repos.d/CentOS-Base.repo

wget -O CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

3.运行yum makecache生成缓存

yum clean all yum makecache

 

 

Centos8更换阿里源

yum -y install wget

1、备份

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

2、下载新的CentOS-Base.repo 到/etc/yum.repos.d/

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-8.repo

3、生成缓存

yum clean all

yum makecache

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值