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
相关推荐
落日漫游6 分钟前
DockerCE与cri-docker核心区别解析
运维·docker·kubernetes
-水火-15 分钟前
【IDE】Linux下使用openocd烧录bin文件
linux·ide·openocd·bin
YongCheng_Liang19 分钟前
Linux 基础命令的 7 大核心模块
linux·运维·服务器
Light6031 分钟前
领码方案|微服务与SOA的世纪对话(3):方法论新生——DDD、服务网格与AI Ops的融合之道
运维·人工智能·微服务·ddd·soa·服务网格·ai ops
tt55555555555536 分钟前
嵌入式启动全流程详解:从SPL到内核
linux
Madison-No72 小时前
【Linux】基础开发工具---yum / apt
linux·运维·服务器
dot to one2 小时前
应用层:Http、Https
linux·c++·网络协议
K_i1343 小时前
Linux的几种版本详细介绍
linux
YongCheng_Liang3 小时前
网络工程师笔记10-BGP协议
运维·网络·笔记
東雪蓮☆3 小时前
LNMP 环境部署 WordPress
linux·运维·mysql·nginx·php