vm的centos本地配置yum

vm的centos本地配置yum

关于上篇文章vmware安装centos7总结

出现关于配置yum源wget找不到命令,但是没安装yum就没法下载wget,也就没法使用wget

所以我们本地配置yum源,不用wget那个命令了

📕步骤:

java 复制代码
cd /etc/yum.repos.d
touch local.repo
vi local.repo 

然后把下面复制进去local.repo里

java 复制代码
# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client.  You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#
 
[base]
name=CentOS-$releasever - Base - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/os/$basearch/
        http://mirrors.aliyuncs.com/centos/$releasever/os/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
 
#released updates
[updates]
name=CentOS-$releasever - Updates - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/updates/$basearch/
        http://mirrors.aliyuncs.com/centos/$releasever/updates/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
 
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/extras/$basearch/
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7

然后

java 复制代码
yum makecache
yum clean all
yum repolist all
相关推荐
MAVER1CK2 小时前
Docker容器创建好后修改容器配置
运维·docker·容器
匆匆那年9673 小时前
VSCode 远程 Linux 使用Codex
linux·ide·vscode
NightReader5 小时前
CPU 高使用率,怎么降下来
运维·服务器
SWAGGY..5 小时前
Linux系统编程:(七)Makefile入门:轻松掌握编译自动化
linux·运维·自动化
开开心心就好5 小时前
免费流畅的远程控制实用工具
linux·运维·服务器·网络·智能手机·excel
黑猫学长呀7 小时前
存储宝典第2篇:盲封TT wafer是什么意思?
linux·嵌入式硬件·项目·芯片·ufs·晶圆·产测
Strugglingler7 小时前
【Linux 用户态操作 UART】
linux·uart
代码熬夜敲Q7 小时前
ENSP 网络工程实验
linux·运维·服务器
銳昊城7 小时前
项目七: 配置与管理Web服务器(2) C2
运维·服务器
Muyuan19987 小时前
30.通过Claude code做项目系统测试
运维·服务器·人工智能·fastapi