博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
CentOS配置源
阅读量:4707 次
发布时间:2019-06-10

本文共 5914 字,大约阅读时间需要 19 分钟。

一、源列表

aliyun源

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

163源

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

二、配置源

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

[lz@mail lcap-0.0.3]$ cat /etc/redhat-releaseCentOS Linux release 7.3.1611 (Core) [lz@mail lcap-0.0.3]$ sudo wget -O /etc/yum.repos.d/CentOS7-Base-163.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo[sudo] password for lz: --2018-07-23 14:11:05--  http://mirrors.163.com/.help/CentOS7-Base-163.repo正在解析主机 mirrors.163.com (mirrors.163.com)... 59.111.0.251正在连接 mirrors.163.com (mirrors.163.com)|59.111.0.251|:80... 已连接。已发出 HTTP 请求,正在等待回应... 200 OK长度:1572 (1.5K) [application/octet-stream]正在保存至: “/etc/yum.repos.d/CentOS7-Base-163.repo”100%[=========================================================================================================================================================================>] 1,572       --.-K/s 用时 0s      2018-07-23 14:11:05 (89.9 MB/s) - 已保存 “/etc/yum.repos.d/CentOS7-Base-163.repo” [1572/1572])

三、源缓存

Step 1 : 清除旧的源缓存:

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

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

[lz@mail lcap-0.0.3]$ yum makecache已加载插件:fastestmirror, langpacksRepository base is listed more than once in the configurationRepository updates is listed more than once in the configurationRepository extras is listed more than once in the configurationRepository centosplus is listed more than once in the configurationRepodata is over 2 weeks old. Install yum-cron? Or run: yum makecache fastbase                                                                                                                                                                                        | 3.6 kB  00:00:00     epel/x86_64/metalink                                                                                                                                                                        | 5.2 kB  00:00:00     epel                                                                                                                                                                                        | 3.2 kB  00:00:00     extras                                                                                                                                                                                      | 3.4 kB  00:00:00     mysql-connectors-community                                                                                                                                                                  | 2.5 kB  00:00:00     mysql-tools-community                                                                                                                                                                       | 2.5 kB  00:00:00     mysql56-community                                                                                                                                                                           | 2.5 kB  00:00:00     updates                                                                                                                                                                                     | 3.4 kB  00:00:00     (1/27): base/7/x86_64/group_gz                                                                                                                                                              | 166 kB  00:00:00     (2/27): epel/x86_64/group_gz                                                                                                                                                                |  88 kB  00:00:00     (3/27): epel/x86_64/updateinfo  ...(26/27): updates/7/x86_64/filelists_db                                                                                                                                                      | 2.3 MB  00:00:04     (27/27): updates/7/x86_64/primary_db                                                                                                                                                        | 4.2 MB  00:00:04     Determining fastest mirrors * base: mirrors.163.com * epel: mirrors.tuna.tsinghua.edu.cn * extras: mirrors.163.com * updates: mirrors.163.comepel                                                                                                                                                                                                   12618/12618epel                                                                                                                                                                                                   12618/12618epel                                                                                                                                                                                                   12618/12618元数据缓存已建立

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

转载于:https://www.cnblogs.com/Hi-blog/p/9354441.html

你可能感兴趣的文章
Android之背景选择器selector用法汇总
查看>>
Java读文件
查看>>
windows下启动mysql服务的命令行启动和手动启动方法
查看>>
识别网络应用所使用的协议Amap
查看>>
iOS 9应用开发教程之显示编辑文本标签文本框
查看>>
puppet安装
查看>>
博客中的文本编辑器+源码下载
查看>>
linux内核情景分析之强制性调度
查看>>
用于生日计算的参数
查看>>
matlab中如何根据t检验参数查找t检验值
查看>>
《JAVA核心技术》观后感
查看>>
Search in Rotated Sorted Array - LeetCode
查看>>
倒计时
查看>>
iOS UIImagePickerController拍照与摄像
查看>>
recover(错误捕获)
查看>>
scientific linux 6.x 下如何播放音樂?
查看>>
2019.01.02 poj3046 Ant Counting(生成函数+dp)
查看>>
2019.01.17 bzoj1854: [Scoi2010]游戏(二分图匹配)
查看>>
2019.03.28 bzoj3322: [Scoi2013]摩托车交易(kruskal重构树+贪心)
查看>>
jQuery dataTables 列不对齐的原因
查看>>