配置阿里云yum源(参考:http://mirrors.aliyun.com/help/centos)

1、备份

[root@bogon ~]# cd /etc/yum.repos.d/
[root@bogon yum.repos.d]# mkdir repo_bak
[root@bogon yum.repos.d]# mv *.repo repo_bak/
[root@bogon yum.repos.d]# ls
repo_bak

2、下载新的CentOS-Base.repo 到/etc/yum.repos.d/

[root@bogon yum.repos.d]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
---- ::-- http://mirrors.aliyun.com/repo/Centos-7.repo
Resolving mirrors.aliyun.com (mirrors.aliyun.com)... 124.14.2.234, 124.14.2.235, 124.14.2.217, ...
Connecting to mirrors.aliyun.com (mirrors.aliyun.com)|124.14.2.234|:... connected.
HTTP request sent, awaiting response... OK
Length: (.5K) [application/octet-stream]
Saving to: ‘/etc/yum.repos.d/CentOS-Base.repo’ %[========================================================================================>] , --.-K/s in 0s -- :: ( MB/s) - ‘/etc/yum.repos.d/CentOS-Base.repo’ saved [/] [root@bogon yum.repos.d]# ls
CentOS-Base.repo repo_bak

3、之后运行yum clean all 清除缓存,运行 yum makecache 生成新的缓存

[root@bogon 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
[root@bogon yum.repos.d]# yum makecache
Loaded plugins: fastestmirror
base | 3.6 kB ::
extras | 3.4 kB ::
updates | 3.4 kB ::
(/): base//x86_64/group_gz | kB ::
(/): extras//x86_64/filelists_db | kB ::
(/): extras//x86_64/primary_db | kB ::

安装EPEL(Extra Packages for Enterprise Linux )源

4、安装EPEL源

[root@bogon yum.repos.d]# yum list | grep epel-release
epel-release.noarch - extras
[root@bogon yum.repos.d]# yum install -y epel-release
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
Resolving Dependencies
--> Running transaction check
---> Package epel-release.noarch :- will be installed
--> Finished Dependency Resolution Dependencies Resolved ==================================================================================================================================
Package Arch Version Repository Size
==================================================================================================================================
Installing:
epel-release noarch - extras k Transaction Summary
==================================================================================================================================
Install Package Total download size: k
Installed size: k
Downloading packages:
epel-release--.noarch.rpm | kB ::
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : epel-release--.noarch /
Verifying : epel-release--.noarch / Installed:
epel-release.noarch :- Complete!
[root@bogon yum.repos.d]# ls #多了epel.repo和epel-testing.repo
CentOS-Base.repo epel.repo epel-testing.repo repo_bak

5、再次运行yum clean all 清除缓存,运行 yum makecache 生成新的缓存

6、查看启用的yum源和所有的yum源

[root@bogon yum.repos.d]# yum repolist enabled               #查看启用的仓库
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* epel: mirrors.ustc.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: ,
[root@bogon yum.repos.d]# yum repolist all #查看所有的仓库
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* epel: mirrors.ustc.edu.cn
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
repo id repo name status
base//x86_64 CentOS- - Base - mirrors.aliyun.com enabled: ,
centosplus//x86_64 CentOS- - Plus - mirrors.aliyun.com disabled
contrib//x86_64 CentOS- - Contrib - mirrors.aliyun.com disabled
epel/x86_64 Extra Packages for Enterprise Linux - x86_64 enabled: ,
epel-debuginfo/x86_64 Extra Packages for Enterprise Linux - x86_64 - Debug disabled
epel-source/x86_64 Extra Packages for Enterprise Linux - x86_64 - Source disabled
epel-testing/x86_64 Extra Packages for Enterprise Linux - Testing - x86_64 disabled
epel-testing-debuginfo/x86_64 Extra Packages for Enterprise Linux - Testing - x86_64 - Debug disabled
epel-testing-source/x86_64 Extra Packages for Enterprise Linux - Testing - x86_64 - Source disabled
extras//x86_64 CentOS- - Extras - mirrors.aliyun.com enabled:
updates//x86_64 CentOS- - Updates - mirrors.aliyun.com enabled: ,
repolist: ,

CentOS7配置阿里云yum源和EPEL源的更多相关文章

  1. CentOS7 配置阿里云yum源,vim编辑器,tab自动补全

    1.进入yum的文件夹 命令:cd   /etc/yum.repos.d/ 2.下载wget 命令:yum -y install wget 3.删除yum文件夹所有yum源 命令:rm -rf    ...

  2. CentOS7 配置阿里云yum源,非常之简单

    1.进入yum的文件夹 命令:cd   /etc/yum.repos.d/ 2.下载wget 命令:yum -y install wget 命令:yum install bash-completion ...

  3. CentOS7 配置阿里云yum源

    1)下载repo文件 wget http://mirrors.aliyun.com/repo/Centos-7.repo 2)备份并替换系统的repo文件 cp Centos-7.repo /etc/ ...

  4. centos7配置阿里云yum源

    1)下载repo文件 wget http://mirrors.aliyun.com/repo/Centos-7.repo 2)备份并替换系统的repo文件 cp Centos-7.repo /etc/ ...

  5. 超简单CentOS7 配置阿里云yum源

    1.打开centos的yum文件夹 输入命令cd  /etc/yum.repos.d/ 2.用wget下载repo文件 输入命令wget  http://mirrors.aliyun.com/repo ...

  6. Centos7一键配置阿里云yum源脚本

    Centos7一键配置阿里云yum源脚本 工作中linux系统经常要配置网络yum,故写了一个简单的配置阿里云yum源的的脚本可以单独使用也可以在做自动化部署的时候调用. #!/bin/bash # ...

  7. Centos 7 配置阿里云 yum 源

    Centos 7 配置阿里云 yum 源 一. 禁用 yum 插件 fastestmirror 修改插件的配置文件 cp /etc/yum/pluginconf.d/fastestmirror.con ...

  8. CentOS7——配置阿里云镜像源

    CentOS7--配置阿里云镜像源 #下载CentOS 7的repo文件 curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun ...

  9. CentOS换yum源和epel源为国内源

    CentOS换源 YUM源 备份原来的repo文件 mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bac ...

随机推荐

  1. 关于<!DOCTYPE html>的学习(转)

    DOCTYPE是对Document type的缩写,说明用XHTML或者HTML是什么版本的.必须出现在<html>标签的前面,不需要关闭标签. <!DOCTYPE>声明不是标 ...

  2. java获取本机器的IP(linux和windows)

    目录 描述 方案描述 获取Windows下的IP 获取linux下的IP 判断操作系统的类型 最后将上面三个方法进行整合 参考 描述 由于项目是部署在集群上的,需要项目能够自动采集各机器的信息.jav ...

  3. NET中解决KafKa多线程发送多主题

    NET中解决KafKa多线程发送多主题 一般在KafKa消费程序中消费可以设置多个主题,那在同一程序中需要向KafKa发送不同主题的消息,如异常需要发到异常主题,正常的发送到正常的主题,这时候就需要实 ...

  4. ASP.NET页面之间传值QueryString(1)

    QueryString是一种非常简单的传值方式,他可以将传送的值显示在浏览器的地址栏中.如果是传递一个或多个安全性要求不高或是结构简单的数值时,可以使用这个方法.但是对于传递数组或对象的话,就不能用这 ...

  5. react router路由传参

    今天,我们要讨论的是react router中Link传值的三种表现形式.分别为通过通配符传参.query传参和state传参. ps:进入正题前,先说明一下,以下的所有内容都是在react-rout ...

  6. Android中使用RadioButton代替ImageButton

    画外音————好久没上来发文章了,这几个月一直忙着一些跟编程不沾边的事,拖了好久,现在还在持续中,顺利的话7月份应该能解放了..今天偶尔上来写一段番外篇性质的心得发现. 之前搞的Android项目,作 ...

  7. MySQL使用笔记(四)数据的操作

    By francis_hao    Dec 14,2016 数据的操作包括插入数据记录.更新数据记录和删除数据记录. 插入数据记录 插入单条数据记录 field表示的字段名和value表示数据要一一对 ...

  8. css的padding,border,margin的意思

    下面的内边距(padding).边框(border) .外边距(margin)的意思是我自己的理解. 代码如下: <!DOCTYPE html> <html lang="e ...

  9. SQL 学习小笔记

    1.FOUND_ROWS() 题目: ,; 在上边sql中使用什么选项可以使 SELECT FOUND_ROWS()忽略LIMIT子句,返回总数? *答案* : SQL_CALC_FOUND_ROWS ...

  10. c#之字符串函数

    1.常用的字符串函数 Compare 比较字符串的内容,考虑文化背景(场所),确定某些字符是否相等 int Compare(string str1,string str2) int Compare(s ...