Centos 7 替换镜像源
1 备份原始源
[root@localhost ~]# mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
2 下载新的镜像源
方法1:wget直接下载
执行命令:wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
操作如下:
[root@localhost yum.repos.d]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
--2018-02-09 05:54:04-- http://mirrors.aliyun.com/repo/Centos-7.repo
正在解析主机 mirrors.aliyun.com (mirrors.aliyun.com)... 180.101.150.31, 180.101.150.28, 180.101.150.26, ...
正在连接 mirrors.aliyun.com (mirrors.aliyun.com)|180.101.150.31|:80... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:2573 (2.5K) [application/octet-stream]
正在保存至: “/etc/yum.repos.d/CentOS-Base.repo”100%[==============================================================================>] 2,573 --.-K/s 用时 0s
2018-02-09 05:54:05 (281 MB/s) - 已保存 “/etc/yum.repos.d/CentOS-Base.repo” [2573/2573])
方法2:curl直接下载
执行命令:curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
操作如下:
[root@localhost yum.repos.d]# curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 2573 100 2573 0 0 8533 0 --:--:-- --:--:-- --:--:-- 8548方法3:在CentOS-Base.repo 写入地址[root@localhost yum.repos.d]# vi CentOS-Base.repo
[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/
http://mirrors.aliyuncs.com/centos/$releasever/extras/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7 #additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/centosplus/$basearch/
http://mirrors.aliyuncs.com/centos/$releasever/centosplus/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
gpgcheck=1
enabled=0
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7 #contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/contrib/$basearch/
http://mirrors.aliyuncs.com/centos/$releasever/contrib/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
gpgcheck=1
enabled=0
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
3 更新缓存
[root@localhost yum.repos.d]# yum makecache
已加载插件:fastestmirror, langpacks
http://mirrors.aliyuncs.com/centos/7/os/x86_64/repodata/repomd.xml: [Errno 12] Timeout on http://mirrors.aliyuncs.com/centos/7/os/x86_64/repodata/repomd.xml: (28, 'Connection timed out after 30000 milliseconds')
正在尝试其它镜像。
base | 3.6 kB 00:00:00
extras | 3.4 kB 00:00:00
updates | 3.4 kB 00:00:00
(1/5): extras/7/x86_64/prestodelta | 102 kB 00:00:01
(2/5): extras/7/x86_64/other_db | 108 kB 00:00:00
(3/5): extras/7/x86_64/filelists_db | 636 kB 00:00:01
(4/5): base/7/x86_64/other_db | 2.5 MB 00:00:02
(5/5): base/7/x86_64/filelists_db | 6.7 MB 00:00:02
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
元数据缓存已建立
Centos 7 替换镜像源的更多相关文章
- 基于centos 创建stress镜像——源码安装stress
上一篇文章进行了yum安装stress,这次对stress进行源码编译安装,并且生成新的镜像 创建Dockerfile目录 [vagrant@localhost ~]$ mkdir -p /tmp/s ...
- Centos下替换yum源为阿里云源
阿里云Linux安装镜像源地址:http://mirrors.aliyun.com/ 第一步:备份原镜像文件 mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum ...
- 软路由openwrt中替换国内镜像源(以阿里云为例)
镜像下载.域名解析.时间同步请点击 阿里巴巴开源镜像站 一.打开openwrt终端 二.找到distfeeds.conf 进入opkg cd /etc/opkg 查看opkg内文件 ls 可以找到di ...
- Linux镜像源
1. 国内镜像源 (1.)备份原有镜像源文件 mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup ...
- pip 更换镜像源
国内的pip源 阿里云:https://mirrors.aliyun.com/pypi/simple/ 清华:https://pypi.tuna.tsinghua.edu.cn/simple 中国科技 ...
- 修改CentOS默认yum源为国内yum镜像源
CentOS默认的yum源不是国内的yum源,在通过yum安装一些软件的时候,会出现这样那样的错误,以及在下载安装的速度上也是非常慢的. 所以这个时候就需要将yum源替换成国内的yum源,国内主要开源 ...
- 替换 Docker 或 Laradock 中 Debian 系统镜像源解决软件安装问题
Docker Debian 镜像源替换 因多数默认的 Docker 镜像为国外的,而采用的镜像源也是国外的,故访问很慢,所以我们需要替换为国内的(比如阿里云或163等). 163 - Debian A ...
- CentOS配置本地yum源(使用镜像iso文件)
本人在使用yum安装软件的时候,感觉最不爽的是网络不佳时,安装的速度特别慢.所以,个人就上网search了一下如何使用Linux的安装文件作为其yum源.经过几次尝试,已经可以成功的配置了.下面是详细 ...
- Centos更改镜像源
阿里云Linux安装镜像源: 1.备份原镜像文件以便于恢复. [root@localhost ~]#mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repo ...
随机推荐
- 一篇文章了解Github和Git教程
有趣有内涵的文章第一时间送达! 喝酒I创作I分享 关注我,每天都有优质技术文章推送,工作,学习累了的时候放松一下自己. 本篇文章同步微信公众号 欢迎大家关注我的微信公众号:「醉翁猫咪」 生活中总有些东 ...
- 你对SQA的职责和工作活动(如软件度量)的理解?
SQA就是独立于软件开发的项目组,通过对软件开发过程的监控,来保证软件的开发流程按照指定的CMM规程(如果有相应的CMM规程),对于不符合项及时提出建议和改进方案,必要时可以向高层经理汇报以求问题的解 ...
- Shell脚本实现对文件编辑
常见Linux文件的编辑命令 vi/vim,有时候我们想写一个脚本实现对文件编辑,这个时候,可能就不够用了,下面介绍一些办法 1.echo命令 Shell的echo命令常用于字符串的输出 例如: [r ...
- 刷题记录:[SUCTF 2019]EasyWeb(EasyPHP)
目录 刷题记录:[SUCTF 2019]EasyWeb(EasyPHP) 一.涉及知识点 1.无数字字母shell 2.利用.htaccess上传文件 3.绕过open_basedir/disable ...
- hadoop作业
作业要求:https://edu.cnblogs.com/campus/gzcc/GZCC-16SE1/homework/3223 一.准备一个ubantu 系统 二.创建hadoop用户 创建 设密 ...
- 非静态内部类中 static/final 成员变量相关知识
原文链接:https://blog.csdn.net/qq_20328181/article/details/81391956
- 第10组 Beta冲刺(4/5)
链接部分 队名:女生都队 组长博客: 博客链接 作业博客:博客链接 小组内容 恩泽(组长) 过去两天完成了哪些任务 描述 将数据分析以可视化形式展示出来 新增数据分析展示等功能API 服务器后端部署, ...
- Spark2.x(五十七):User capacity has reached its maximum limit(用户容量已达到最大限制)
背景: 目前服务器资源是43个节点,每个节点配置信息如下:24VCores 64G yarn配置情况: yarn.scheduler.minimum-allocation-mb 单个容器可申请的最小 ...
- Error:(23, 0) Could not find method implementation() for arguments [directory 'libs'] on object of t
Error:(28, 0) Could not find method implementation() for arguments [com.android.support:appcompat-v7 ...
- ngxtop安装和使用
监控nginx的请求信息,总共收到了多少个请求,有哪些成功的,有哪些失败的 ngxtop安装 1.安装python-pip 1) yum install epel-release 出现如下错误:No ...