1、在线地址配置yum源
配置在线yum源,首先查看自己的centos版本;
[root@localhost etc]# cat /etc/redhat-release
CentOS Linux release 7.9.2009 (Core)
我把我本地的yum源都转移出去,这样来配置在线地址比较好一些;
找到阿里云开源镜像
需要找到Packages和repodata的同级目录即可;
配置成功;
2、使用wgat自动配置yum
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
yum clean all 清除缓存
yum repolist all 建立索引
安装完毕;
3、本地安装yum源
安装完毕;