快捷搜索:  汽车  科技

centos怎么更换yum源(Centos7更换国内的yum源)

centos怎么更换yum源(Centos7更换国内的yum源)yum makecache升级Linux系统:yum clean all重建缓存:阿里云:wget -O CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo163:wget -O CentOS-Base.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo5、清理缓存、重建缓存、升级Linux系统清理yum缓存:

centos怎么更换yum源(Centos7更换国内的yum源)(1)

1、下载wget工具

yum install –y wget


2、进入yum源配置文件所在文件夹

cd /etc/yum.repos.d/


3、备份本地yum源

mv CentOS-Base.repo CentOS-Base.repo_bak


4、获取国内yum源(阿里、163二选一)

阿里云:

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

163:

wget -O CentOS-Base.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo


5、清理缓存、重建缓存、升级Linux系统
清理yum缓存:

yum clean all

重建缓存:

yum makecache

升级Linux系统:

yum -y update

猜您喜欢: