您的位置:首页 > 运维架构 > Linux

CentOS7更新YUM源

2018-01-22 16:49 369 查看
通过脚本更新YUM源

#!/usr/bin/env bash

# the first is backup original yum folder to the .bak
sudo mv /etc/yum.repos.d/ /etc/yum.repos.d.bak

# new make directory of the `/etc/yum.repos.d/`
sudo mkdir /etc/yum.repos.d/

# download the aliyun yum resource
sudo wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo 
# clean cache of the old yum resource
sudo yum clean all

# reestablishment yum resource
sudo yum makecache


手动更新YUM源

依次执行上面脚本shell命令即可
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: