一、源列表

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. EOS开发基础之五:使用cleos命令行客户端操作EOS——智能合约之Exchange

    先回答一下上一节中留下的问题,为什么我就看不到eosio这个账户中的钱呢?我明明为它create了很多token啊. 对,你是create了,但是没有issue啊.create了1000000000 ...

  2. SimpleDateFormat的一些常用用法

    /** SimpleDateFormat函数语法: G 年代标志符 y 年 M 月 d 日 h 时 在上午或下午 (1~12) H 时 在一天中 (0~23) m 分 s 秒 S 毫秒 E 星期 D ...

  3. PAT甲题题解-1108. Finding Average (20)-字符串处理

    求给出数的平均数,当然有些是不符合格式的,要输出该数不是合法的. 这里我写了函数来判断是否符合题目要求的数字,有点麻烦. #include <iostream> #include < ...

  4. java入门--4110:圣诞老人的礼物-Santa Clau’s Gifts

    学习了一下java的语法,就用poj上的题目做作练习,好更快的熟悉常用的java语法. 题目在这里 http://bailian.openjudge.cn/practice/4110/ import ...

  5. asp.net简述Web Forms开发模式

    详情请查阅:http://www.runoob.com/aspnet/aspnet-intro.html 1.Web Forms 是三种创建 ASP.NET 网站和 Web 应用程序的编程模式中的一种 ...

  6. delphi 登陆窗口的问题 [问题点数:30分,结帖人tianhuo_soft]

    http://bbs.csdn.net/topics/200053917 有两个窗口formLogin是登陆窗口,formMain是主窗口我想让formMain显示出来,并且formLogin窗口关闭 ...

  7. 【版本管理】git分支管理

    创建与合并分支: 首先,我们创建dev分支,然后切换到dev分支: git checkout -b dev,命令加上-b参数表示创建并切换, 相当于以下两条命令: git branch dev: gi ...

  8. BZOJ5467 PKUWC2018Slay the Spire(动态规划)

    即求所有情况的最大伤害之和.容易发现应该先打强化牌,至少打一张攻击牌.同样显然的是强化牌和攻击牌都应该按从大到小的顺序打.进一步可以发现,只要还有强化牌,就应该使用(当然至少留一次攻击的机会). 于是 ...

  9. poj 2299 Ultra-QuickSort(树状数组)

    Ultra-QuickSort Time Limit: 7000MS   Memory Limit: 65536K Total Submissions: 67681   Accepted: 25345 ...

  10. Spring Shell参考文档

    Spring Shell的核心组件是它的插件模型(plugin model).内置命令(built-in commands)和转换器( converters). 1.1 Plugin Model(插件 ...