网站首页 安全运维 Centos7 换阿里云yum源
yum list wget
若没有安装:
yum -y install wget
备份原来的文件CentOS-Base.repo:给自己留条后路
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup1
进入 yum.repos.d 目录
cd /etc/yum.repos.d/1
下载需要更新的yum源配置文件(或者自己下载,然后上传到 /etc/yum.repos.d/ 目录中)
centos 机器上下载命令: wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo Windows机器上下载的网站:http://mirrors.aliyun.com/repo/Centos-7.repo 上传到 centos 机器
生成缓存
yum clean allyum makecache1
更新yum
yum -y update