首页 > 系统相关 >CentOS7更改yum源

CentOS7更改yum源

时间:2022-10-18 13:11:06浏览次数:50  
标签:repo CentOS 更改 repos CentOS7 Base yum 替换

1 进入 yum.repos.d

	cd /etc/yum.repos.d/

2 删除当前目录yum.repos.d下的所有文件(建议先备份)

3 阿里云yum源安装

	curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

4 使用vi编辑器打开 CentOS-Base.repo

	vi CentOS-Base.repo

5 末行模式下替换掉$releasever

	:%s/$releasever/7/g 
	#替换快捷指令 %s/a/b/g  其中%s表示所有行 g表示全局,a表示被替换的字符,b为替换字符 

6 wq退出即可

标签:repo,CentOS,更改,repos,CentOS7,Base,yum,替换
From: https://www.cnblogs.com/justanoob/p/16802242.html

相关文章

  • centos7离线安装Jenkins-rpm方式
    Jenkins有多种安装方式,下面通过rpm进行安装前提:Java的jdk已安装一、下载Jenkins的rpm包下载地址:https://jenkins.io/zh/download/或者https://mirrors.tuna.tsinghua.edu......
  • centos7安装redis6.2
    一、下载安装包[root@glusterfs03~]#wgethttps://download.redis.io/releases/redis-6.2.7.tar.gz--2022-10-1810:35:21--https://download.redis.io/releas......
  • 第三方的镜像站中均已移除CentOS 8的源,Centos 8版本已停止更新相应依赖导致的,下载新的
    yum命令失败:Errorsduringdownloadingmetadataforrepository'epel':-Statuscode:404forhttp://archives.fedoraproject.org/pub/archive/epel/8/Everything/x86......
  • 更改输入 空格不变
    #include<iostream>#include<string.h> #include<limits.h>#include<float.h>#include<stdio.h>#pragmawarning(disable :4996)usingnamespacestd; intmain()......
  • Linux下更改MySQL数据库存储路径
    1、home目录下建立data目录,data目录下建立mysql目录  2、首先停止掉mysql服务,在终端中执行"/etc/init.d/mysqlstop"或者执行"servicemysqldstop"并回车确定。3......
  • yum downgrade降级安装包
    问题安装gccgcc-c++make等编译包,提示glibc错误依赖-->FinishedDependencyResolutionError:Package:glibc-headers-2.17-317.el7.x86_64(centos7)R......
  • centos7中如何关闭、启动防火墙
     001、查看防火墙状态systemctlstatusfirewalld  002、关闭防火墙systemctlstopfirewalld 003、查看关闭防火墙状态systemctlstatusfirewalld......
  • svn搭建配置(centos7)
    svn搭建配置(centos7)1安装svn服务端yum-yinstallsubversion2建立版本库目录mkdir/www/svndata3启动svnsvnserve-d-r/www/svndata4创建版本库svna......
  • Samba资源共享服务搭建(centos7)
    Samba资源共享服务搭建1查询是否已经安装了Sambarpm-qisamba2下载Samba包并安装yuminstallsamba3查看已经安装好的Samba的信息rpm-qa|grepsamba4添加......
  • CentOS7 搭建 DNS 域名解析服务器
    CentOS7搭建DNS域名解析服务器1.安装BIND服务器软件并启动yum-yinstallbindbind-utilssystemctlstartnamed.service//启动服务systemctlenablenamed......