教你优化yum源。配置阿里云的yum镜像源(base和epel)
一、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)的更多相关文章
- centos配置ADSL拨号 配置阿里云的yum源
如果系统yum源有问题可以更改yum源配置阿里云的yum源1)下载repo文件 wget http://mirrors.aliyun.com/repo/Centos-7.repo(没有 wget命令可 ...
- 更改yum网易、阿里云的yum源
更改yum源为网易的. 首先备份/etc/yum.repos.d/CentOS-Base.repomv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos ...
- CentOS 7 配置阿里云本地yum源
删除原有的yum源: rm -f /etc/yum.repos.d/* 重新下载阿里云的yum源: wget -O /etc/yum.repos.d/CentOS-Base.repo http://m ...
- linux安装配置阿里云的yum源和python3
一.yum源理解 yum源仓库的地址 在/etc/yum.repos.d/,并且只能读出第一层的repo文件 yum仓库的文件都是以.repo结尾的 二.下载阿里云的.repo仓库文件 ,放到/etc ...
- 配置阿里云作为yum 源
第一步:下载aliyum 的yum源配置文件. http://mirrors.aliyun.com/repo/ 第二步:把下载到的repo文件复制到/etc/yum.repo.d/目录下. ----- ...
- CentOS7用阿里云Docker Yum源在线安装Docker 17.03.2
参考文档 安装步骤 删除已安装的Docker 配置阿里云Docker Yum源 安装指定版本 启动Docker服务 参考文档 官方Docker安装文档:https://docs.docker. ...
- CentOS7用阿里云Docker Yum源在线安装Docker
一.参考文档 官方Docker安装文档:https://docs.docker.com/install/linux/docker-ce/centos 阿里云Docker安装文档:https://yq. ...
- debian设置软件源为阿里云
首先编辑sources.list这个文件 sudo vim /etc/apt/sources.list 把sources.list文件内容替换成如下 deb http://mirrors.aliyun ...
- CentOS7配置阿里云yum源和EPEL源
配置阿里云yum源(参考:http://mirrors.aliyun.com/help/centos) 1.备份 [root@bogon ~]# cd /etc/yum.repos.d/ [root@ ...
随机推荐
- MySQL 一些内部原理
1. MySQL 体系结构 如下图: Mysql是由SQL接口,解析器,优化器,缓存,存储引擎组成的(SQL Interface. Parser. Optimizer.Caches&Buffe ...
- java学习-消息队列rabbitmq的组成
rabbitMQ组成部分 rabbitmq有以下组成部分,分别为: 1. Server(broker)接受客户端连接,实现AMQP消息队列和路由功能的进程 2.虚拟主机virtual host虚拟主机 ...
- ionic的学习-01搭建App的起步准备
Part1 搭建App的起步准备(建立项目文件夹,配置开发环境) 第一步 初始化npm npm init 文件夹变化 第二步 使用npm安装git npm install git --save 文件 ...
- kafka集群partition分布原理分析
1. Kafka集群partition replication默认自动分配分析 下面以一个Kafka集群中4个Broker举例,创建1个topic包含4个Partition,2 Replication ...
- N最短路径分词
N最短路径算法是一种基于词典的分词算法. 每个句子将生成一个有向无环图, 每个字作为图的一个定点, 边代表可能的分词. 在上图中, 边的起点为词的第一个字, 边的终点为词尾的下一个字. 边1表示&qu ...
- MySQL基准测试(一)--原因,策略,思路
MySQL基准测试(一)--原因,策略,思路 运用benchmark的原因 验证一些你认为的问题,通过基准测试和模拟数据来验证. 解决生产系统的一些异常 测试系统的当前的运行情况,通过历史的基准测试结 ...
- java中的重载(overload)和重写(override)区别
方法重载(overload): 方法重载就是在一个类中可以创建多个方法,它们具有相同的名字,但是具有不同的参数和不同定义,调用方法时通过传递给他们的不同参数个数和参数列表决定具体使用 哪 ...
- 【Java】HashMap源码分析——常用方法详解
上一篇介绍了HashMap的基本概念,这一篇着重介绍HasHMap中的一些常用方法:put()get()**resize()** 首先介绍resize()这个方法,在我看来这是HashMap中一个非常 ...
- 【Java】XML文件的解析
import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import ja ...
- 在UWP中自定义半边框样式的输入框
Windows10发布已经有一阵子了,已经有一些公司上架了自己的UWP应用程序,为WindowsStore增添光彩.已经安装Windows10的用户也或多或少的安装了一些UWP的应用程序,针对这些UW ...