Centos7更换yum镜像源

Centos7更换yum镜像源Centos7更换yum镜像源1、首先备份/etc/yum.repos.d/CentOS-Base.repomv/etc/yum.repos.d/CentOS-Base.repo/etc/yum.repos.d/CentOS-Base.repo.backup2、下载对应版本repo文件,放入/etc/yum.repos.d/(操作前请做好相应备份)以CentOS7-Base-163.repo为例#CentOS-Base.repo##Themirrorsystemusesth

大家好,又见面了,我是你们的朋友全栈君。

Centos7更换yum镜像源

1、首先备份/etc/yum.repos.d/CentOS-Base.repo

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

2、下载对应版本repo文件, 放入/etc/yum.repos.d/(操作前请做好相应备份)
以CentOS7-Base-163.repo为例

# 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 - 163.com
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
baseurl=http://mirrors.163.com/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7

#released updates
[updates]
name=CentOS-$releasever - Updates - 163.com
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
baseurl=http://mirrors.163.com/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7

#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras - 163.com
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
baseurl=http://mirrors.163.com/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus - 163.com
baseurl=http://mirrors.163.com/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7

注意文件中$releasever有可能对应不上要手动写死
3、运行以下命令生成缓存

yum clean all
yum makecache

4、yum代理
在/etc/yum.conf中加入下面几句.

vim /etc/yum.conf
proxy=http://210.45.72.XX:808
proxy_username=username
proxy_password=password
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/138947.html原文链接:https://javaforall.net

(0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • HashMap遍历的四种常用方式「建议收藏」

    HashMap遍历的四种常用方式「建议收藏」古人云:温故而知新。最近闲来无事就去翻阅了一下之前的一些基础java知识点。本想着随便看看,然而就发现有了意外收获。比如本文所讲HashMap遍历的四种常用方式。大伙们一起学习一起进步,记得点赞关注以示鼓励哈!!!准备工作首选我们先准备一个HashMap。publicclassTest1{publicstaticvoidmain(String[]args){Map<String,String>map=newHashMap<St

    2025年10月12日
    2
  • 宽度学习(Broad Learning System)

    宽度学习(Broad Learning System)宽度学习系统(BLS)一词的提出源于澳门大学科技学院院长陈俊龙于2018年1月发表的《BroadLearningSystem:AnEffectiveandEfficientIncrementalLearningSystemWithouttheNeedforDeepArchitecture》

    2022年5月22日
    35
  • 整数规划

    整数规划2、整数规划2.1定义规划中的变量(部分或全部)限制为整数时,称为整数规划。若在线性规划模型中,变量限制为整数,则称为整数线性规划。2.2分类变量全限制为整数时,称纯(完全)整数规

    2022年7月4日
    34
  • ANSI编码对照表「建议收藏」

    ANSI编码对照表「建议收藏」目前计算机中用得最广泛的字符集及其编码,是由美国国家标准局(ANSI)制定的ASCII码(AmericanStandardCodeforInformationInterchange,美国标准信息交换码),它已被国际标准化组织(ISO)定为国际标准,称为ISO646标准。适用于所有拉丁文字字母,ASCII码有7位码和8位码两种形式。因为1位二进制数可以表示(21=)2种状态:0、1;而2位二进制数可以表示(22)=4种状态:00、01、10、11;依次类推,7位二进制数可以表示(27=)128种

    2022年9月23日
    5
  • 软件测试外包_为什么不能去外包公司

    软件测试外包_为什么不能去外包公司【随笔】测试外包的正确打开方式

    2022年4月21日
    55
  • Python一日一练05—-怒刷点击量[通俗易懂]

    Python一日一练05—-怒刷点击量

    2022年1月30日
    97

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号