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)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • SpringBoot框架理解[通俗易懂]

    SpringBoot框架理解[通俗易懂]文章目录SpringBoot框架1SpringBoot入门1.2什么是SpringBoot1官网的解释2我的理解3SpringBoot的优缺点4构建项目1使用Spring官方提供页面构建2使用IDEA构建3pom包介绍1.3SpringBoot核心1约定优于配置2Starter启动器3自动配置工作原理学习SpringBoot后对它的理解,进行一个总结SpringBoot框架1SpringBoot入门1.2什么是SpringBoot1官网的解释​ Sprin

    2022年8月21日
    7
  • java远程关机,Win7远程桌面以及远程关机设置注意事项

    java远程关机,Win7远程桌面以及远程关机设置注意事项远程桌面注意点在开启远程桌面的时候提示 必须为远程桌面启用 Windows 防火墙例外 顾名思义就是防火墙给阻止了 但是在防火墙里找了又找还是没有找到远程桌面的选项 为了系统的安装也不能把防火墙给关闭 怎么才能把远程桌面添加到防火墙信任呢 原因分析 出现此现象是由于 Windows7 组策略的设置才没有远程桌面这一选项 我们只需要修改下组策略才行解决方法 开始 运行 gpedit msc 计算机配置

    2025年8月25日
    3
  • 笛卡尔坐标系,它结合了_笛卡尔坐标系的故事

    笛卡尔坐标系,它结合了_笛卡尔坐标系的故事第一节:1D数学1.基本数学概念自然数:人类在大自然中对自己的羊或者牛进行计数,而出现自然数,所以从0到N的整数被称为自然数。负数:有时候人类在交易物品的时候会先赊着,此时就是用负数表示。分数

    2022年8月5日
    6
  • ZOJ-1188「建议收藏」

    ZOJ-1188「建议收藏」也很水,直接统计权值然后排序即可

    2022年7月12日
    17
  • 零基础HTML5游戏制作教程 第1章

    零基础HTML5游戏制作教程 第1章第一章绪论HTML一直是网络编程的基石,其他任何编程语言,不论是PHP、Phython、CSS还是JavaScript,都必须以HTML为基础。上一代的标准,HTML4.01在1999年制定之后

    2022年8月1日
    6
  • nginx负载均衡算法8种_权重负载均衡算法实现

    nginx负载均衡算法8种_权重负载均衡算法实现Nginx是一个很强大的高性能Web和反向代理服务,它具有很多非常优越的特性:在连接高并发的情况下,Nginx是Apache服务不错的替代品:Nginx在美国是做虚拟主机生意的老板们经常选择的软件平台之一。能够支持高达50,000个并发连接数的响应,感谢Nginx为我们选择了epollandkqueue作为开发模型。下面是五种负载均衡算法:roundrobin(默认) weight IP_hash url_hash(第三方) fair(第三方)1.roundr…

    2022年10月12日
    7

发表回复

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

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