记一次Centos7更新yum源

首先备份yum

 mv  /etc/yum.repos.d/CentOS-Base.repo  /ect/yum.repos.d/CentOS-Base.repo.backup

替换yum源为阿里源

wget -O  /etc/yum.repos.d/CentOS-Base.repo  http://mirrors.aliyun.com/repo/Centos-7.repo

生成缓存

yum makecache

更新系统

yum -y update

如果yum正在运行,要先关掉进程

rm -f  /var/run/yum.pid

如果yum install没有可用软件包

yum install epel-release;

说明

本文只做学习参考,如有任何不准确的地方欢迎指正。

猜你喜欢

转载自blog.csdn.net/lulongji2035/article/details/107980764