热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

CentOS7配置阿里云yum源和EPEL源

配置阿里云yum源(参考:http:mirrors.aliyun.comhelpcentos)1、备份[root@bogon~]#cdetcyum.repos.d[

配置阿里云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
--2018-02-09 16:33:46--  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|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2573 (2.5K) [application/octet-stream]
Saving to: ‘/etc/yum.repos.d/CentOS-Base.repo’

100%[========================================================================================>] 2,573       --.-K/s   in 0s      

2018-02-09 16:33:47 (182 MB/s) - ‘/etc/yum.repos.d/CentOS-Base.repo’ saved [2573/2573]

[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  00:00:00     
extras                                                                                                     | 3.4 kB  00:00:00     
updates                                                                                                    | 3.4 kB  00:00:00     
(1/12): base/7/x86_64/group_gz                                                                             | 156 kB  00:00:00     
(2/12): extras/7/x86_64/filelists_db                                                                       | 636 kB  00:00:07     
(3/12): extras/7/x86_64/primary_db                                                                         | 166 kB  00:00:02   

 

安装EPEL(Extra Packages for Enterprise Linux )源

4、安装EPEL源

[root@bogon yum.repos.d]# yum list | grep epel-release
epel-release.noarch                         7-9                        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 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.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/7/x86_64                                  CentOS-7 - Base - mirrors.aliyun.com                                          9,591
epel/x86_64                                    Extra Packages for Enterprise Linux 7 - x86_64                               12,277
extras/7/x86_64                                CentOS-7 - Extras - mirrors.aliyun.com                                          388
updates/7/x86_64                               CentOS-7 - Updates - mirrors.aliyun.com                                       1,929
repolist: 24,185
[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/7/x86_64                          CentOS-7 - Base - mirrors.aliyun.com                                        enabled:  9,591
centosplus/7/x86_64                    CentOS-7 - Plus - mirrors.aliyun.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,277
epel-debuginfo/x86_64                  Extra Packages for Enterprise Linux 7 - x86_64 - Debug                      disabled
epel-source/x86_64                     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 - mirrors.aliyun.com                                      enabled:    388
updates/7/x86_64                       CentOS-7 - Updates - mirrors.aliyun.com                                     enabled:  1,929
repolist: 24,185

 


推荐阅读
  • 本文介绍了Android 7的学习笔记总结,包括最新的移动架构视频、大厂安卓面试真题和项目实战源码讲义。同时还分享了开源的完整内容,并提醒读者在使用FileProvider适配时要注意不同模块的AndroidManfiest.xml中配置的xml文件名必须不同,否则会出现问题。 ... [详细]
  • Java太阳系小游戏分析和源码详解
    本文介绍了一个基于Java的太阳系小游戏的分析和源码详解。通过对面向对象的知识的学习和实践,作者实现了太阳系各行星绕太阳转的效果。文章详细介绍了游戏的设计思路和源码结构,包括工具类、常量、图片加载、面板等。通过这个小游戏的制作,读者可以巩固和应用所学的知识,如类的继承、方法的重载与重写、多态和封装等。 ... [详细]
  • Iamtryingtomakeaclassthatwillreadatextfileofnamesintoanarray,thenreturnthatarra ... [详细]
  • 在Android开发中,使用Picasso库可以实现对网络图片的等比例缩放。本文介绍了使用Picasso库进行图片缩放的方法,并提供了具体的代码实现。通过获取图片的宽高,计算目标宽度和高度,并创建新图实现等比例缩放。 ... [详细]
  • PHP图片截取方法及应用实例
    本文介绍了使用PHP动态切割JPEG图片的方法,并提供了应用实例,包括截取视频图、提取文章内容中的图片地址、裁切图片等问题。详细介绍了相关的PHP函数和参数的使用,以及图片切割的具体步骤。同时,还提供了一些注意事项和优化建议。通过本文的学习,读者可以掌握PHP图片截取的技巧,实现自己的需求。 ... [详细]
  • Commit1ced2a7433ea8937a1b260ea65d708f32ca7c95eintroduceda+Clonetraitboundtom ... [详细]
  • 开发笔记:加密&json&StringIO模块&BytesIO模块
    篇首语:本文由编程笔记#小编为大家整理,主要介绍了加密&json&StringIO模块&BytesIO模块相关的知识,希望对你有一定的参考价值。一、加密加密 ... [详细]
  • 本文讨论了在Windows 8上安装gvim中插件时出现的错误加载问题。作者将EasyMotion插件放在了正确的位置,但加载时却出现了错误。作者提供了下载链接和之前放置插件的位置,并列出了出现的错误信息。 ... [详细]
  • 阿,里,云,物,联网,net,core,客户端,czgl,aliiotclient, ... [详细]
  • Android Studio Bumblebee | 2021.1.1(大黄蜂版本使用介绍)
    本文介绍了Android Studio Bumblebee | 2021.1.1(大黄蜂版本)的使用方法和相关知识,包括Gradle的介绍、设备管理器的配置、无线调试、新版本问题等内容。同时还提供了更新版本的下载地址和启动页面截图。 ... [详细]
  • Spring特性实现接口多类的动态调用详解
    本文详细介绍了如何使用Spring特性实现接口多类的动态调用。通过对Spring IoC容器的基础类BeanFactory和ApplicationContext的介绍,以及getBeansOfType方法的应用,解决了在实际工作中遇到的接口及多个实现类的问题。同时,文章还提到了SPI使用的不便之处,并介绍了借助ApplicationContext实现需求的方法。阅读本文,你将了解到Spring特性的实现原理和实际应用方式。 ... [详细]
  • eclipse学习(第三章:ssh中的Hibernate)——11.Hibernate的缓存(2级缓存,get和load)
    本文介绍了eclipse学习中的第三章内容,主要讲解了ssh中的Hibernate的缓存,包括2级缓存和get方法、load方法的区别。文章还涉及了项目实践和相关知识点的讲解。 ... [详细]
  • 自动轮播,反转播放的ViewPagerAdapter的使用方法和效果展示
    本文介绍了如何使用自动轮播、反转播放的ViewPagerAdapter,并展示了其效果。该ViewPagerAdapter支持无限循环、触摸暂停、切换缩放等功能。同时提供了使用GIF.gif的示例和github地址。通过LoopFragmentPagerAdapter类的getActualCount、getActualItem和getActualPagerTitle方法可以实现自定义的循环效果和标题展示。 ... [详细]
  • 本文讨论了在数据库打开和关闭状态下,重新命名或移动数据文件和日志文件的情况。针对性能和维护原因,需要将数据库文件移动到不同的磁盘上或重新分配到新的磁盘上的情况,以及在操作系统级别移动或重命名数据文件但未在数据库层进行重命名导致报错的情况。通过三个方面进行讨论。 ... [详细]
  • 本文介绍了在Android开发中使用软引用和弱引用的应用。如果一个对象只具有软引用,那么只有在内存不够的情况下才会被回收,可以用来实现内存敏感的高速缓存;而如果一个对象只具有弱引用,不管内存是否足够,都会被垃圾回收器回收。软引用和弱引用还可以与引用队列联合使用,当被引用的对象被回收时,会将引用加入到关联的引用队列中。软引用和弱引用的根本区别在于生命周期的长短,弱引用的对象可能随时被回收,而软引用的对象只有在内存不够时才会被回收。 ... [详细]
author-avatar
laladuosahdaj
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有