centos7配置镜像源(阿里)
作者:蓝眼泪
配置centos镜像源整理
1 备份原文件
cd /etc/yum.repos.d
mkdir repo_bak
mv *.repo repo_bak/
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo_bak
2 下载阿里base基础源
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
3 更新base基础缓存
yum clean all
yum makecache
yum -y update
4 下载阿里epel拓展源
wget -O /etc/yum.repos.d/epel-7.repo http://mirrors.aliyun.com/repo/epel-7.repo
5 更新epel拓展缓存
yum clean all # 清除系统所有的yum缓存
yum makecache # 生成yum缓存
yum -y update
汇总如下:
cd /etc/yum.repos.d
mkdir repo_bak
mv *.repo repo_bak/
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
wget -O /etc/yum.repos.d/epel-7.repo http://mirrors.aliyun.com/repo/epel-7.repo
yum clean all
yum makecache
yum list | grep epel-release
yum repolist enabled
yum repolist all
附加信息
华为镜像站网址
https://mirrors.huaweicloud.com/
centos7.9系统配置华为镜像源
wget -O /etc/yum.repos.d/CentOS-Base.repo https://repo.huaweicloud.com/repository/conf/CentOS-7-reg.repo
搭建本地镜像源-centos7.9
1 用迅雷软件下载everything版本的centos7系统镜像,网址如下:
http://mirrors.aliyun.com/centos/7/isos/x86_64/CentOS-7-x86_64-Everything-2009.iso
2 虚拟机–>可移动设备–>CD/DVD–>连接
mkdir /mnt/cdrom
mount /dev/cdrom /mnt/cdrom
mv /etc/yum.repos.d/*.repo /tmp/
3 添加local.repo参数
vim /etc/yum.repos.d/local.repo
[LocalRepo]
name=LocalRepository
baseurl=file:///cdrom
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
4 测试环节,下载vsftpd软件
yum clean all
yum install vsftpd