首页 > 系统相关 >CentOS7配置阿里云yum源和epel源

CentOS7配置阿里云yum源和epel源

时间:2022-11-21 20:58:09浏览次数:43  
标签:epel repo x86 mirrors CentOS7 yum aliyun 64

配置阿里云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
 

标签:epel,repo,x86,mirrors,CentOS7,yum,aliyun,64
From: https://www.cnblogs.com/A121/p/16913165.html

相关文章

  • 阿里云yum仓库配置
    centos下yum仓库配置地址:/etc/yum.repos.d/,这个目录下的*.repo文件都会被识别为yum仓库。阿里云yum仓库配置很简单:阿里云官方镜像站https://developer.aliyun.com/mirro......
  • centos7安装glibc_2.28
    centos7默认的gcc版本是4.8.5,无法编译高版本的glibc2.28,需要升级到gcc8.2版本注:gcc高版本和glibc2.28不兼容##查看自带默认的glibcstrings/lib64/lib.so.6|grep......
  • 虚拟机centos7上安装docker+jenkins
    虚拟机centos7上安装docker+jenkins学习某册子的CICD时,安装了docker和jenkins,记录的安装过程和中间碰到的问题。使用的虚拟机为ParallelsDesktop,配置为2核4G,系统为cento......
  • centos76网络/端口/防火墙常用命令
    查看防火墙所有开放的端口firewall-cmd--zone=public--list-ports开放/关闭端口firewall-cmd--zone=public--add-port=8888/tcp--permanentfirewall-cmd--r......
  • 利用nginx对yum源进行转发
    1.需求:内网10.10.10.78需要安装yum源,从10.20.20.216上利用nginx转发yum源获取。(10.20.20.216从内网173.1.1.10上获取yum源)2.前提条件:10.10.10.78与10.20.20.216网络和端口......
  • centos7防火墙设置
    奋斗的工程师于2022-08-2517:14:59发布2066收藏10————————————————版权声明:本文为CSDN博主「奋斗的工程师」的原创文章,遵循CC4.0BY-SA版权协议,转......
  • 配置本地yum源和局域网yum源
    引言:为什么要写这段引言呢,是因为在做配置局域网yum源的时候遇到了太多的疑问,于是把就这些问题记录下来,和大家分享一下。1、局域网yum源适用条件?举个例子,在公司里,某天断网......
  • CentOS EPEL
    EPEL是ExtraPackagesforEnterpriseLinux(EPEL)repository的简称,是企业级Linux版本额外的软件库。对于Base版本的Linux,其自带的repository包含有限的软件,部分软件并不......
  • Centos7编译安装mysql8.0.20
    相关下载地址:gcchttps://ftp.mpi-inf.mpg.de/mirrors/gnu/mirror/gcc.gnu.org/pub/gcc/releases/cmakehttps://cmake.org/files/mysqlhttps://downloads......
  • [Bug0055] centos7.x 报错/usr/libexec/grepconf.sh: line 5: grep: command not foun
    问题centos7.x报错:/usr/libexec/grepconf.sh:line5:grep:commandnotfound场景centos7.x修改java环境变量,保存后输入命令都不存在报错原因centos7.x修改java......