更新yum源

安装wget

yum install -y wget

备份

cd /etc/yum.repos.d/
mkdir repo_bak
mv *.repo repo_bak/

下载新的CentOS-Base.repo 到/etc/yum.repos.d/

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

#
sed -i -e '/mirrors.cloud.aliyuncs.com/d' -e '/mirrors.aliyuncs.com/d' /etc/yum.repos.d/CentOS-Base.repo 

yum clean all 清除缓存,运行 yum makecache 生成新的缓存

yum clean all
yum makecache

安装EPEL(Extra Packages for Enterprise Linux )源

yum install -y epel-release

再次运行yum clean all 清除缓存,运行 yum makecache 生成新的缓存

查看启用的yum源和所有的yum源

yum repolist enabled
yum repolist all

更新yum

yum -y update

关闭NetworkManager

systemctl stop NetworkManager
systemctl disable NetworkManager

安装vim

yum install -y vim

关闭防火墙

systemctl stop firewalld
systemctl disable firewalld

作者 小户

在 “安装docker 更新yum源” 有 1 条评论

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注