一、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. sql server 备份与恢复系列六 文件组备份与还原

    一. 概述 文件备份是指备份一个或多个文件或文件组中的所有数据.使用文件备份能够只还原损坏的文件,而不用还原数据库的其余部份,从而加快恢复速度.例如,如果数据库由位于不同磁盘上的若干文件组成,在其中一 ...

  2. MapReduce-深度剖析

    1.概述 在接触了第一代MapReduce和第二代MapReduce之后,或许会有这样的疑惑,我们从一些书籍和博客当中获取MapReduce的一些原理和算法,在第一代当中会有JobTrack,Task ...

  3. 通过 CLI 管理 Jenkins Server

    Jenkins 内置的命令行接口允许管理员通过命令行工具访问并管理 Jenkins.这让我们可以通过脚本自动化的创建配置或执行任务,也就是把 Jenkins 中的配置代码化了.Jenkins 同时支持 ...

  4. JavaWeb学习 (二十八)————文件上传和下载

    在Web应用系统开发中,文件上传和下载功能是非常常用的功能,今天来讲一下JavaWeb中的文件上传和下载功能的实现. 对于文件上传,浏览器在上传的过程中是将文件以流的形式提交到服务器端的,如果直接使用 ...

  5. PHP 网页数据api采集

    一个简单的数据采集,这里用的方法是API数据采集 //api地址,读取文本 $result = file_get_contents("https://feed.mix.sina.com.cn ...

  6. c++中运算符重载

    c++语言中运算符重载都是通过函数来实现的,所以其实质为函数重载,当c++语言原有的一个运算符被重载之后,它原来所具有的语义并没有消失,只相当于针对一个特定的类定义了一个新的运算符. <1> ...

  7. [转]在Node.js中使用RabbitMQ系列一 Hello world

    本文转自:https://www.cnblogs.com/cpselvis/p/6288330.html 在前一篇文章中可伸缩架构简短系列中提到过关于异步的问题.当时推荐使用RabbitMQ来做任务队 ...

  8. 关于toggle事件委托的处理

    当html页面加载后,页面上需要再次动态加载的按钮等事件的绑定,我们有两种处理方案 一.再次加载后进行绑定 二.使用委托进行绑定 而toggle事件是无法直接绑定的,这时可以转化为click的事件,并 ...

  9. 一个mui扩展插件mui.showLoading加载框【转】

    转:http://ask.dcloud.net.cn/article/12856 写在前面:好像mui目前dialog系列唯独缺少showLoading加载框(加载中)组件,为了统一组件样式和体验,写 ...

  10. HTTP 错误 500 调用loadlibraryex失败

    HTTP 错误 500.0 - Internal Server Error 调用 LoadLibraryEx 失败,在 ISAPI 筛选器 C:\Windows\Microsoft.NET\Frame ...