配置[yum,epel]源
配置阿里云[yum,epel]源备份系统原有yum源mkdir /etc/yum.repos.d/OldRepo
mv /etc/yum.repos.d/*.repo /etc/yum.repos.d/OldRepo/
下载yum源文件curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
下载epel源文件curl -o /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
[清除,生成]yum缓存yum clean all
yum makecache
配置本地yum源创建挂载目录mkdir /mnt/cd
挂载光盘echo "/dev/sr0 /mnt/cd iso9660 defaults 0 0" >>/etc/fstab
mount -a
创建yum源文件123456cat <<EOF >/etc/yum.repos.d/local.repo[Local-YUM]name=Linux CentOS 7.4baseurl=file:///mnt/cdgpgcheck=0EOF
[清除,生成]yu
...