centos7配置镜像源(阿里)

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
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值