CentOS7系统配置国内yum源和epel源
1.首先进入/etc/yum.repos.d/
目录下,新建一个repo_bak目录,用于保存系统中原来的repo文件
[root@bogon ~]# cd /etc/yum.repos.d/
[root@bogon yum.repos.d]# mkdir repo_bak
[root@bogon yum.repos.d]# mv *.repo repo_bak/
2.在CentOS中配置使用网易和阿里的开源镜像
到网易和阿里开源镜像站点下载系统对应版本的repo文件
[root@bogon yum.repos.d]# wget http://mirrors.aliyun.com/repo/Centos-7.repo
[root@bogon yum.repos.d]# wget http://mirrors.163.com/.help/CentOS7-Base-163.repo
[root@bogon yum.repos.d]# ls
Centos-7.repo CentOS-Base-163.repo repo.bak
或者手动下载repo文件并上传到/etc/yum.repos.d/
目录
3.清除系统yum缓存并生成新的yum缓存
[root@bogon yum.repos.d]# ls # 列出/etc/yum.repos.d/目录下的文件
Centos-7.repo CentOS-Base-163.repo repo.bak
[root@bogon yum.repos.d]# yum clean all # 清除系统所有的yum缓存
Loaded plugins: 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
Cleaning repos: base extras updates
Cleaning up everything
Cleaning up list of fastest mirrors
[root@bogon yum.repos.d]# yum makecache # 生成yum缓存
Loaded plugins: 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
base | 3.6 kB 00:00:00
extras | 3.4 kB 00:00:00
updates | 3.4 kB 00:00:00
(1/12): base/7/x86_64/filelists_db | 6.7 MB 00:00:02
(2/12): base/7/x86_64/group_gz | 156 kB 00:00:02
(3/12): base/7/x86_64/other_db | 2.5 MB 00:00:01
(4/12): base/7/x86_64/primary_db | 5.7 MB 00:00:02
(5/12): extras/7/x86_64/prestodelta | 51 kB 00:00:01
(6/12): extras/7/x86_64/filelists_db | 494 kB 00:00:02
(7/12): extras/7/x86_64/other_db | 86 kB 00:00:00
(8/12): extras/7/x86_64/primary_db | 130 kB 00:00:01
(9/12): updates/7/x86_64/prestodelta | 406 kB 00:00:01
(10/12): updates/7/x86_64/filelists_db | 2.1 MB 00:00:01
(11/12): updates/7/x86_64/other_db | 354 kB 00:00:00
(12/12): updates/7/x86_64/primary_db | 3.6 MB 00:00:01
Determining fastest mirrors
Metadata Cache Created
4.安装epel源
[root@bogon yum.repos.d]# yum list | grep epel-release
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
epel-release.noarch 7-9 extras
[root@bogon yum.repos.d]# yum install -y epel-release
Loaded plugins: 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
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package epel-release.noarch 0:7-9 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=============================================================================================================
Package Arch Version Repository Size
=============================================================================================================
Installing:
epel-release noarch 7-9 extras 14 k
Transaction Summary
=============================================================================================================
Install 1 Package
Total download size: 14 k
Installed size: 24 k
Downloading packages:
epel-release-7-9.noarch.rpm | 14 kB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : epel-release-7-9.noarch 1/1
Verifying : epel-release-7-9.noarch 1/1
Installed:
epel-release.noarch 0:7-9
Complete!
[root@bogon yum.repos.d]# ls # epel源安装成功,比原来多了一个epel.repo和epel-testing.repo文件
Centos-7.repo CentOS-Base-163.repo epel.repo epel-testing.repo repo.bak
5.使用阿里开源镜像提供的epel源
[root@bogon yum.repos.d]# wget -O /etc/yum.repos.d/epel-7.repo http://mirrors.aliyun.com/repo/epel-7.repo # 下载阿里开源镜像的epel源文件
--2018-03-08 20:22:14-- http://mirrors.aliyun.com/repo/epel-7.repo
Resolving mirrors.aliyun.com (mirrors.aliyun.com)... 183.2.199.237, 113.96.109.95, 113.96.109.93, ...
Connecting to mirrors.aliyun.com (mirrors.aliyun.com)|183.2.199.237|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1084 (1.1K) [application/octet-stream]
Saving to: ‘/etc/yum.repos.d/epel-7.repo’
100%[=================================================================================================>] 1,084 --.-K/s in 0s
2018-03-08 20:22:14 (130 MB/s) - ‘/etc/yum.repos.d/epel-7.repo’ saved [1084/1084]
[root@bogon yum.repos.d]# ls
CentOS7-Base-163.repo Centos-7.repo epel-7.repo epel.repo epel-testing.repo repo_bak
6.再次清除系统yum缓存,并重新生成新的yum缓存
[root@bogon yum.repos.d]# yum clean all
Loaded plugins: 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
Repository epel is listed more than once in the configuration
Repository epel-debuginfo is listed more than once in the configuration
Repository epel-source is listed more than once in the configuration
Cleaning repos: base epel extras updates
Cleaning up everything
Cleaning up list of fastest mirrors
[root@bogon yum.repos.d]# yum makecache
Loaded plugins: 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
Repository epel is listed more than once in the configuration
Repository epel-debuginfo is listed more than once in the configuration
Repository epel-source is listed more than once in the configuration
base | 3.6 kB 00:00:00
epel | 4.7 kB 00:00:00
extras | 3.4 kB 00:00:00
updates | 3.4 kB 00:00:00
(1/18): base/7/x86_64/group_gz | 156 kB 00:00:01
(2/18): base/7/x86_64/filelists_db | 6.7 MB 00:00:07
(3/18): base/7/x86_64/primary_db | 5.7 MB 00:00:06
(4/18): epel/x86_64/group_gz | 266 kB 00:00:01
(5/18): epel/x86_64/updateinfo | 899 kB 00:00:02
(6/18): epel/x86_64/prestodelta | 7.1 kB 00:00:00
(7/18): base/7/x86_64/other_db | 2.5 MB 00:00:05
(8/18): epel/x86_64/primary_db | 6.3 MB 00:00:04
(9/18): extras/7/x86_64/filelists_db | 636 kB 00:00:00
(10/18): extras/7/x86_64/primary_db | 166 kB 00:00:00
(11/18): extras/7/x86_64/other_db | 108 kB 00:00:00
(12/18): extras/7/x86_64/prestodelta | 102 kB 00:00:01
(13/18): epel/x86_64/other_db | 3.0 MB 00:00:01
(14/18): epel/x86_64/filelists_db | 10 MB 00:00:09
(15/18): updates/7/x86_64/filelists_db | 3.5 MB 00:00:02
(16/18): updates/7/x86_64/prestodelta | 771 kB 00:00:02
(17/18): updates/7/x86_64/other_db | 621 kB 00:00:00
(18/18): updates/7/x86_64/primary_db | 6.0 MB 00:00:03
Determining fastest mirrors
* epel: mirrors.aliyun.com
Metadata Cache Created
7.查看系统可用的yum源和所有的yum源
[root@bogon yum.repos.d]# yum repolist enabled
Loaded plugins: 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
Repository epel is listed more than once in the configuration
Repository epel-debuginfo is listed more than once in the configuration
Repository epel-source is listed more than once in the configuration
Loading mirror speeds from cached hostfile
* epel: mirrors.aliyun.com
repo id repo name status
base/7/x86_64 CentOS-7 - Base - 163.com 9,591
epel/x86_64 Extra Packages for Enterprise Linux 7 - x86_64 12,382
extras/7/x86_64 CentOS-7 - Extras - 163.com 390
updates/7/x86_64 CentOS-7 - Updates - 163.com 1,941
repolist: 24,304
[root@bogon yum.repos.d]# yum repolist all
Loaded plugins: 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
Repository epel is listed more than once in the configuration
Repository epel-debuginfo is listed more than once in the configuration
Repository epel-source is listed more than once in the configuration
Loading mirror speeds from cached hostfile
* epel: mirrors.aliyun.com
repo id repo name status
base/7/x86_64 CentOS-7 - Base - 163.com enabled: 9,591
centosplus/7/x86_64 CentOS-7 - Plus - 163.com disabled
contrib/7/x86_64 CentOS-7 - Contrib - mirrors.aliyun.com disabled
epel/x86_64 Extra Packages for Enterprise Linux 7 - x86_64 enabled: 12,382
epel-debuginfo/x86_64 Extra Packages for Enterprise Linux 7 - x86_64 - Debug disabled
epel-source Extra Packages for Enterprise Linux 7 - x86_64 - Source disabled
epel-testing/x86_64 Extra Packages for Enterprise Linux 7 - Testing - x86_64 disabled
epel-testing-debuginfo/x86_64 Extra Packages for Enterprise Linux 7 - Testing - x86_64 - Debug disabled
epel-testing-source/x86_64 Extra Packages for Enterprise Linux 7 - Testing - x86_64 - Source disabled
extras/7/x86_64 CentOS-7 - Extras - 163.com enabled: 390
updates/7/x86_64 CentOS-7 - Updates - 163.com enabled: 1,941
repolist: 24,304
CentOS7系统配置国内yum源和epel源的更多相关文章
- CentOS7配置阿里云yum源和EPEL源
配置阿里云yum源(参考:http://mirrors.aliyun.com/help/centos) 1.备份 [root@bogon ~]# cd /etc/yum.repos.d/ [root@ ...
- CentOS换yum源和epel源为国内源
CentOS换源 YUM源 备份原来的repo文件 mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bac ...
- centos6更换yum源和epel源
epel是yum的一个软件用源,包含了很多基本源中没有的软件,cobbler就属于基本源中没有的软件,所以需要安装epel源. yum源: wget -O /etc/yum.repos.d/CentO ...
- Docker国内Yum源和国内镜像仓库
Docker国内Yum源和国内镜像仓库 2018年05月29日 :: nklinsirui 阅读数 6295更多 分类专栏: Docker 版权声明:本文为博主原创文章,遵循 CC 4.0 by-sa ...
- centos7配置国内yum源
文章目录 1.什么是yum仓库? 2.yum仓库配置 2.1.阿里镜像仓库配置 2.1.1.配置步骤 2.1.2.epel源 安装和配置 2.1.3.查看yum源 2.2.配置 清华大学镜像仓库 1. ...
- CentOS6、CentOS7配置Base源和epel源
1.用yum安装软件报错 Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=6&arch=x86_64&a ...
- 配置centos7阿里镜像源和epel源
[root@runstone yum.repos.d]# pwd /etc/yum.repos.d [root@runstone yum.repos.d]# cat aliBase.repo #镜像源 ...
- yum安装epel源
国内yum源的安装(163,阿里云,epel) 国内yum源的安装(163,阿里云,epel) ----阿里云镜像源 1.备份 mv /etc/yum.repos.d/CentOS-Base.re ...
- centos7 升级php7 添加配置epel源 报错:Cannot retrieve metalink for repository: epel. Please verify its path and try again
文章来自:循序渐渐linux:基础知识 一书 7.3章LAMP服务器搭建 日常故障 centos上好多软件升级需要配置epel源 其中有一点小插曲 需要手动更改 1.很多时候,对PHP环境要求较新的版 ...
随机推荐
- AtCoder Grand Contest 019
最近比较懒,写了俩题就跑了 A - Ice Tea Store 简化背包 #include<cstdio> #include<algorithm> using namespac ...
- Codeforces Round #423 (Div. 2, rated, based on VK Cup Finals)爆零记
昨晚一个瓜皮说今晚有cf,听说是晚间场,我瞅了一眼,娃,VK Cup,上分的好机会,看着比赛时间就有点心酸了,0:35,当时一直在纠结要不要打的问题,当时想着应该不难吧,要不打一下吧,要不还是看看题先 ...
- [国嵌攻略][108][Linux内核链表]
链表简介 链表是一种常见的数据结构,它通过指针将一系列数据节点连接成一条数据链.相对于数组,链表具有更好的动态性,建立链表时无需预先知道数据总量,可以随机分配空间,可以高效地在链表中的任意位置实时插入 ...
- java中JFrame类中函数addWindowListener(new WindowAdapter)
转自:http://blog.csdn.net/datouniao1/article/details/46984987:侵删. 在java编写的过程中常常遇到样的一段代码: frame.addWind ...
- Java入门篇(五)——Java的字符串/String类
前面在举例时有出现过String的例子,当时肯定有一部分朋友不知道这个是做什么用的.其实String类是Java中一个比较特殊的类,字符串即String类,它不是Java的基本数据类型之一,但可以像基 ...
- 工作小结(关于webpack)
今天在工作中遇到了一个新问题,是关于webpack的. 是这样的,我在项目中添加了一个新页面,修改完配置文件后,开始运行,刚开始并没有什么问题,很顺利,后来我又添加了一个页面,然后修改配置文件,然后运 ...
- spring cloud-zuul的Filter详解
在前面我们使用zuul搭建了网关http://blog.csdn.net/liuchuanhong1/article/details/59056278 关于网关的作用,这里就不再次赘述了,我们今天的重 ...
- 我的第一个python web开发框架(21)——小结
这个小网站终于成功上线,小白除了收获一笔不多的费用外,还得到女神小美的赞赏,心中满满的成就感.这一天下班后,他请老菜一起下馆子,兑现请吃饭的承诺,顺便让老菜点评一下. 小白:老大,在你的指导下终于完成 ...
- mysql 远程连接数据库的二种方法
一.连接远程数据库: 1.显示密码 如:MySQL 连接远程数据库(192.168.5.116),端口"3306",用户名为"root",密码"123 ...
- vuejs中执行npm run dev出现页面cannot GET/问题
1.问题描述 最近用vue-cli搭建了一个小项目,其中在对项目进行打包测试时修改了webpack.base.conf.js中的配置信息,之后再用npm run dev之后出现如下的情况: 最近又有网 ...