1.更新
# 升级所有包同时也升级软件和系统内核
yum -y update
# 只升级所有包,不升级软件和系统内核
yum -y upgrade
2.删除
cd /etc/yum.repos.d
# 删除原yum源
rm -rf /etc/yum.repos.d/*
3.下载源
# wget命令下载: wget [options] [url]
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
# curl命令下载: curl [options] [url]
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
4.缓存
# 清除yum缓存
yum clean all
# 缓存阿里云镜像
yum makecache
5.查看源
yum repolist