一、Centos7的base源配置阿里云的yum源:

1、备份旧的yum源目录下的所有文件

[root@ELK-chaofeng07 yum.repos.d]# mkdir ../yum.repos.d.bak ; mv ./* ../yum.repos.d.bak

2、下载base文件

#各系统版本repo文件对应的下载操作
CentOS
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo
CentOS
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
CentOS
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

3、清空缓存

yum clean all

4、构建新的缓存

yum makecache

5、查看基本yum源

[root@ELK-chaofeng07 yum.repos.d]# yum repolist
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* epel: mirrors.tuna.tsinghua.edu.cn
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
repo id repo name status
base//x86_64 CentOS- - Base - mirrors.aliyun.com ,
*epel/x86_64 Extra Packages for Enterprise Linux - x86_64 ,
extras//x86_64 CentOS- - Extras - mirrors.aliyun.com
updates//x86_64 CentOS- - Updates - mirrors.aliyun.com ,
repolist: ,

二、配置阿里云的epel源

1、下载阿里云的epel源。我们到官网:http://mirrors.aliyun.com

2、开始备份旧的epel-release源

mv /etc/yum.repos.d/epel.repo /etc/yum.repos.d/epel.repo.backup
mv /etc/yum.repos.d/epel-testing.repo /etc/yum.repos.d/epel-testing.repo.backup

3、下载新的阿里云的epel源

epel(RHEL )

    wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
epel(RHEL ) wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-6.repo
epel(RHEL ) wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-5.repo

4、清空缓存

[root@ELK-chaofeng07 yum.repos.d]# yum clean all
Loaded plugins: fastestmirror
Cleaning repos: base extras updates
Cleaning up everything
Maybe you want: rm -rf /var/cache/yum, to also free up space taken by orphaned data from disabled or removed repos
Cleaning up list of fastest mirrors

4、构建新的缓存

[root@ELK-chaofeng07 yum.repos.d]# yum makecache
Loaded plugins: fastestmirror
base | 3.6 kB ::
epel | 4.7 kB ::
extras | 3.4 kB ::
updates | 3.4 kB ::
(/): base//x86_64/group_gz | kB ::
(/): base//x86_64/primary_db | 6.0 MB ::
(/): base//x86_64/filelists_db | 7.1 MB ::
(/): epel/x86_64/group_gz | kB ::
(/): base//x86_64/other_db | 2.6 MB ::
(/): epel/x86_64/updateinfo | kB ::
(/): epel/x86_64/prestodelta | kB ::
(/): epel/x86_64/primary_db | 6.6 MB ::
(/): epel/x86_64/filelists_db | MB ::
(/): extras//x86_64/prestodelta | kB ::
(/): extras//x86_64/filelists_db | kB ::
(/): epel/x86_64/other_db | 3.2 MB ::
(/): extras//x86_64/primary_db | kB ::
(/): extras//x86_64/other_db | kB ::
(/): updates//x86_64/prestodelta | kB ::
(/): updates//x86_64/filelists_db | 2.2 MB ::
(/): updates//x86_64/other_db | kB ::
(/): updates//x86_64/primary_db | 2.5 MB ::
Determining fastest mirrors
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
Metadata Cache Created

5、查看yum源

[root@ELK-chaofeng07 yum.repos.d]# yum makecache
Loaded plugins: fastestmirror
base | 3.6 kB ::
epel | 4.7 kB ::
extras | 3.4 kB ::
updates | 3.4 kB ::
(/): base//x86_64/group_gz | kB ::
(/): base//x86_64/primary_db | 6.0 MB ::
(/): base//x86_64/filelists_db | 7.1 MB ::
(/): epel/x86_64/group_gz | kB ::
(/): base//x86_64/other_db | 2.6 MB ::
(/): epel/x86_64/updateinfo | kB ::
(/): epel/x86_64/prestodelta | kB ::
(/): epel/x86_64/primary_db | 6.6 MB ::
(/): epel/x86_64/filelists_db | MB ::
(/): extras//x86_64/prestodelta | kB ::
(/): extras//x86_64/filelists_db | kB ::
(/): epel/x86_64/other_db | 3.2 MB ::
(/): extras//x86_64/primary_db | kB ::
(/): extras//x86_64/other_db | kB ::
(/): updates//x86_64/prestodelta | kB ::
(/): updates//x86_64/filelists_db | 2.2 MB ::
(/): updates//x86_64/other_db | kB ::
(/): updates//x86_64/primary_db | 2.5 MB ::
Determining fastest mirrors
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
Metadata Cache Created

此时再次下载东西你会发现非常快。不懂请点击

教你优化yum源。配置阿里云的yum镜像源(base和epel)的更多相关文章

  1. centos配置ADSL拨号 配置阿里云的yum源

    如果系统yum源有问题可以更改yum源配置阿里云的yum源1)下载repo文件 wget http://mirrors.aliyun.com/repo/Centos-7.repo(没有 wget命令可 ...

  2. 更改yum网易、阿里云的yum源

    更改yum源为网易的. 首先备份/etc/yum.repos.d/CentOS-Base.repomv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos ...

  3. CentOS 7 配置阿里云本地yum源

    删除原有的yum源: rm -f /etc/yum.repos.d/* 重新下载阿里云的yum源: wget -O /etc/yum.repos.d/CentOS-Base.repo http://m ...

  4. linux安装配置阿里云的yum源和python3

    一.yum源理解 yum源仓库的地址 在/etc/yum.repos.d/,并且只能读出第一层的repo文件 yum仓库的文件都是以.repo结尾的 二.下载阿里云的.repo仓库文件 ,放到/etc ...

  5. 配置阿里云作为yum 源

    第一步:下载aliyum 的yum源配置文件. http://mirrors.aliyun.com/repo/ 第二步:把下载到的repo文件复制到/etc/yum.repo.d/目录下. ----- ...

  6. CentOS7用阿里云Docker Yum源在线安装Docker 17.03.2

        参考文档 安装步骤 删除已安装的Docker 配置阿里云Docker Yum源 安装指定版本 启动Docker服务 参考文档 官方Docker安装文档:https://docs.docker. ...

  7. CentOS7用阿里云Docker Yum源在线安装Docker

    一.参考文档 官方Docker安装文档:https://docs.docker.com/install/linux/docker-ce/centos 阿里云Docker安装文档:https://yq. ...

  8. debian设置软件源为阿里云

    首先编辑sources.list这个文件 sudo vim /etc/apt/sources.list 把sources.list文件内容替换成如下 deb http://mirrors.aliyun ...

  9. CentOS7配置阿里云yum源和EPEL源

    配置阿里云yum源(参考:http://mirrors.aliyun.com/help/centos) 1.备份 [root@bogon ~]# cd /etc/yum.repos.d/ [root@ ...

随机推荐

  1. c#构造初使化的顺序

    这个很基础的知识,但我至今才意识到它.想想也很失败. 直接上代码:很简单 public class Base { ; public Base() { System.Console.WriteLine( ...

  2. Android多线程编程<二>Handler异步消息处理机制之Message

      Message(消息):       一. Message的字段:    在Android中,Message作为线程之间(主要是子线程和UI主线程之间)数据交换的载体,通过Handler去传递.它 ...

  3. 全网最详细的Eclipse里如何正确新建普通的Java web项目并发布到Tomcat上运行成功【博主强烈推荐】(图文详解)

    不多说,直接上干货! 首先,大家要明确,IDEA.Eclipse和MyEclipse等编辑器之间的新建和运行手法是不一样的. 如果是在Myeclipse里,则是File -> new -> ...

  4. 从零开始学 Web 之 JavaScript(二)变量

    大家好,这里是「 Daotin的梦呓 」从零开始学 Web 系列教程.此文首发于「 Daotin的梦呓 」公众号,欢迎大家订阅关注.在这里我会从 Web 前端零基础开始,一步步学习 Web 相关的知识 ...

  5. TCP/IP 笔记 - 广播和本地组播

    在之前第二章介绍IP寻址的时候有介绍到,IP地址有4种:单播.组播.广播.任播. 单播,客户端与服务器之间点到点连接通信: 组播,在发送者和多个接收者(如某个特定的分组)之间实现点对多点的连接通信: ...

  6. Python中property的使用

  7. redis linux(centos) 安装

    前言 redis 大家都使用过, 可以安装在windows下, 也可以安装在linux下, 一般还是linux下安装比较多. 这里来介绍一下redis在linux下的安装 一. 下载 https:// ...

  8. visual studio code 在 mac 下按 F12无效

    vsc 默认通过 F12可以查看定义(Go to Definition),可以查看类或方法的定义: 但是在 mac 环境下,有时按 F12并不生效,但是菜单栏的 Go 选项是被启动的,此时需要进行 2 ...

  9. 【杂谈】Spring Boot 默认支持的并发量

    Spring Boot应用支持的最大并发量是多少? Spring Boot 能支持的最大并发量主要看其对Tomcat的设置,可以在配置文件中对其进行更改.当在配置文件中敲出max后提示值就是它的默认值 ...

  10. Jenkins CLI 命令详解

    笔者在前文<通过 CLI 管理 Jenkins Server>中介绍了如何通过 SSH 或客户端命令行的方式管理 Jenkins Server,限于篇幅,前文主要的目的是介绍连接 Jenk ...