Centos7 yum操作

配置地址:/etc/yum.repos.d/CentOS-Base.repo 

更换原有源到阿里云

阿里云帮助文件地址:mirrors.aliyun.com

# 备份
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
# 下载新配置文件
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
# 或者
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

 安装命令

# 安装命令
yum install 软件名 软件名2 软件名3 ...

# 不需要输入y的安装
yum install -y 软件名 软件名2 软件名3 ...
原文地址:https://www.cnblogs.com/wtil/p/12769823.html