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
相关推荐
Chief_fly19 分钟前
ARM 麒麟系统服务器构建docker镜像
运维·服务器·docker
Dawn-bit25 分钟前
Linux文本处理三剑客之sed详解
linux·运维·服务器·云计算·运维开发
dok1238 分钟前
Johannes 《Linux内核模块与设备驱动开发:编写Linux驱动程序》 (9)manual_cdev
linux·运维·驱动开发
czhaii1 小时前
汇川注塑机伺服驱动器故障维修排除方法
运维·服务器
Cx330❀1 小时前
【Linux网络】深入 HTTP 协议(五):从 Cookie/Session 原理到 C++ 源码实战
linux·运维·服务器·开发语言·网络·c++·http
Dobby_051 小时前
【CICD】Jenkins Pipeline 快速学习入门
运维·学习·jenkins
小小、码农3 小时前
Linux进程概念
linux·服务器·网络
nxb55610 小时前
haproxy算法,ip透传,自定义haproxy错误页面
运维·服务器
Nebula嵌入式11 小时前
【C语言】09-深入解析main函数
linux·c语言·开发语言·嵌入式
AKAMAI11 小时前
你的源服务器可能是你做出的最昂贵决定
运维·人工智能·云计算