一、源列表

aliyun源

#各系统版本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

163源

#各系统版本repo文件对应的下载操作
CentOS
wget -O /etc/yum.repos.d/CentOS5-Base-.repo http://mirrors.163.com/.help/CentOS5-Base-163.repo
CentOS
wget -O /etc/yum.repos.d/CentOS6-Base-.repo http://mirrors.163.com/.help/CentOS6-Base-163.repo
CentOS
wget -O /etc/yum.repos.d/CentOS7-Base-.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo

二、配置源

  我用的是CentOS 7,以163源为例,操作如下:

[lz@mail lcap-0.0.]$ cat /etc/redhat-release
CentOS Linux release 7.3. (Core)
[lz@mail lcap-0.0.]$ sudo wget -O /etc/yum.repos.d/CentOS7-Base-.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo
[sudo] password for lz:
---- ::-- http://mirrors.163.com/.help/CentOS7-Base-163.repo
正在解析主机 mirrors..com (mirrors..com)... 59.111.0.251
正在连接 mirrors..com (mirrors..com)|59.111.0.251|:... 已连接。
已发出 HTTP 请求,正在等待回应... OK
长度: (.5K) [application/octet-stream]
正在保存至: “/etc/yum.repos.d/CentOS7-Base-.repo” %[=========================================================================================================================================================================>] , --.-K/s 用时 0s -- :: (89.9 MB/s) - 已保存 “/etc/yum.repos.d/CentOS7-Base-.repo” [/])

三、源缓存

Step 1 : 清除旧的源缓存:

[lz@mail lcap-0.0.]$ yum clean all
已加载插件:fastestmirror, langpacks
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Repodata is over weeks old. Install yum-cron? Or run: yum makecache fast
正在清理软件源: base epel extras mysql-connectors-community mysql-tools-community mysql56-community updates
Cleaning up everything

Step 2 : 构建新的源缓存:(只展示一部分)

[lz@mail lcap-0.0.]$ yum makecache
已加载插件:fastestmirror, langpacks
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Repodata is over weeks old. Install yum-cron? Or run: yum makecache fast
base | 3.6 kB ::
epel/x86_64/metalink | 5.2 kB ::
epel | 3.2 kB ::
extras | 3.4 kB ::
mysql-connectors-community | 2.5 kB ::
mysql-tools-community | 2.5 kB ::
mysql56-community | 2.5 kB ::
updates | 3.4 kB ::
(/): base//x86_64/group_gz | kB ::
(/): epel/x86_64/group_gz | kB ::
(/): epel/x86_64/updateinfo
...
(/): updates//x86_64/filelists_db | 2.3 MB ::
(/): updates//x86_64/primary_db | 4.2 MB ::
Determining fastest mirrors
* base: mirrors..com
* epel: mirrors.tuna.tsinghua.edu.cn
* extras: mirrors..com
* updates: mirrors..com
epel /
epel /
epel /
元数据缓存已建立

  之后再使用yum安装软件,速度就可以起飞了。

CentOS配置源的更多相关文章

  1. CentOS配置源、wget、ifconfig基础环境

    执行命令: curl http://10.200.0.14:8000/portal.cgi -X POST -d 'username=lishuai&password=test@cetc38& ...

  2. centos yum源配置 与yum配置文件

    参考博客 http://www.cnblogs.com/mchina/archive/2013/01/04/2842275.html 1.centos . yum配置文件在目录 /etc/yum.re ...

  3. CentOS配置yum源(补充)

    这是对yum命令的补充 Yum命令 一.用Centos镜像搭建本地yum源 由于安装centos后的默认yum源为centos的官方地址,所以在国内使用很慢甚至无法访问,所以一般的做法都是把默认的yu ...

  4. CentOS配置本地yum源/阿里云yum源/163yuan源,并配置yum源的优先级

    一.用Centos镜像搭建本地yum源 由于安装centos后的默认yum源为centos的官方地址,所以在国内使用很慢甚至无法访问,所以一般的做法都是把默认的yum源替换成aliyun的yum源或者 ...

  5. RHEL6配置CentOS yum源

    RHEL6配置CentOS yum源

  6. CentOS、RHEL、Asianux、Neokylin、湖南麒麟、BC Linux、普华、EulerOS请参考“1.1 CentOS本地源配置”;

      本文档适用于CentOS.RHEL.Asianux.Neokylin.湖南麒麟.BC Linux.普华.EulerOS.SLES.Ubuntu.Deepin.银河麒麟. CentOS.RHEL.A ...

  7. Centos配置yum本地源最简单的办法

    有关centos配置yum本地源的方法 一.前提 先连接镜像 然后在命令行输入如下命令 mount /dev/sr0 /mnt cd /etc/yum.repos.d/ ls 之后会看到如下的界面 二 ...

  8. Linux配置mysql (centos配置java环境 mysql配置篇 总结四)

    ♣安装的几种方法和比较 ♣配置yum源 ♣安装mysql ♣启动mysql ♣修改密码 ♣导入.sql文件 ♣缓存设置 ♣允许远程登录(navicat) ♣配置编码为utf8  1.关于Linux系统 ...

  9. RedHat 更新CentOS Yum源(转)

    经测试,可用.转自:https://www.cnblogs.com/tangsen/p/5151994.html 一.随笔引言 1.1随笔内容: 1.RedHat 配置Centos yum源 2.yu ...

随机推荐

  1. 《陪孩子像搭积木一样学编程》,一起来玩Scratch(1)使用Scratch编程的基本流程

    编程是一件很有趣的事情.初次接触编程,你可能不知所措,别担心,这并不复杂.首先,为了让读者对编程有大概的了解,可以把编写Scratch程序的过程分成7个步骤(如图1.8).注意,这是理想状态.在实际的 ...

  2. npm安装时一些错误

    1. npm install 提示no such file or directory 缺少package.json 首先初始化, npm init -f 然后安装依赖 npm install form ...

  3. EOS开发基础之二:使用cleos命令行客户端操作EOS(钱包wallet基础操作)

    不知道下边这一段英文你们是不是能看懂,如果看不懂那就算了,我就是转过来随便看看的. 总之你记住nodeos.cleos和keosd这三个工程十分重要就行了,回头咱们的研究都从这三个工程杀进去. EOS ...

  4. Hexo初体验

    title: Hexo初体验 date: 2018-05-10 tags: Hexo categories: Hexo --- Hexo本地安装 Node.js安装 Hexo npm安装如下 npm ...

  5. PAT甲题题解-1105. Spiral Matrix (25)-(模拟顺时针矩阵)

    题意:给定N,以及N个数.找出满足m*n=N且m>=n且m-n最小的m.n值,建立大小为m*n矩阵,将N个数从大到下顺时针填入矩阵中. #include <iostream> #in ...

  6. Ubuntu环境如何上传项目到GitHub网站?

    http://blog.csdn.net/ajianyingxiaoqinghan/article/details/70544159

  7. group by 和count的联合使用问题 [转]

    group by 和count的联合使用问题 今天写查询语句遇到一个问题,就是用group by进行分组以后,用count统计分组以后的个数, 开始写的语句大体是: select count(m.fb ...

  8. Book Review 《构建之法》-2

    -敏捷流程包括了几大原则:Backlog.burn-down.Sprint.Scrum. 敏捷开发注重个人之间的交流,提倡尽早的交付有价值的软件满足顾客的需求, 在开发过程中不断与客户进行交互,变化. ...

  9. (Alpha)Let's-个人贡献分

    Alpha阶段个人贡献分如下: (1201)林珣玙 60 (1190)康家华 55 (1194)刘彦熙 53 (1168)仇栋民 48 (1183)马瑶华 42 (1222)张启东 42

  10. Android map转json格式,附上Jackson包下载地址,导入过程

    android中的map转json,需要下载jackson包,下载地址: http://www.java2s.com/Code/Jar/j/Downloadjacksonall199jar.htm 下 ...