Linux系统之Centos安装epel源

简介: Linux系统之Centos安装epel源

一、检查本地系统环境

1.检查系统版本

[root@jeven ~]# cat /etc/os-release 
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"

CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"

2.检查系统内核版本

[root@jeven ~]# uname -r
6.1.8-1.el7.elrepo.x86_64

二、检查yum仓库

1.查看repo文件

进入/etc/yum.repos.d目录下,查看系统所有的repo文件

[root@jeven yum.repos.d]# ll
total 12
-rw-r--r--. 1 root root 1759 Jan 28 21:02 CentOS-Base.repo
-rw-r--r--. 1 root root 2081 Jul 26  2022 docker-ce.repo
-rw-r--r--. 1 root root 1946 Jul 10  2022 elrepo.repo

2.检查yum仓库的状态

检查yum仓库的所有镜像源状态


[root@jeven yum.repos.d]# yum repolist all |grep enable
!base/7/x86_64                       CentOS-7 - Base - mirrors.a enabled: 10,072
!docker-ce-stable/7/x86_64           Docker CE Stable - x86_64   enabled:    198
!elrepo                              ELRepo.org Community Enterp enabled:    154
!extras/7/x86_64                     CentOS-7 - Extras - mirrors enabled:    515
!updates/7/x86_64                    CentOS-7 - Updates - mirror enabled:  4,691

三、安装epel源

1.查看系统epel-release.noarch包


[root@jeven yum.repos.d]# yum list all | grep epel-release.noarch
epel-release.noarch                      7-14                          epel

2.yum直接安装

可直接安装epel-release.noarch包,配置epel源。

[root@jeven yum.repos.d]# yum install -y epel-release
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * elrepo: mirrors.tuna.tsinghua.edu.cn
Resolving Dependencies
--> Running transaction check
---> Package epel-release.noarch 0:7-11 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

====================================================================================================================================================================
 Package                                     Arch                                  Version                              Repository                             Size
====================================================================================================================================================================
Installing:
 epel-release                                noarch                                7-11                                 extras                                 15 k

Transaction Summary
====================================================================================================================================================================
Install  1 Package

Total download size: 15 k
Installed size: 24 k
Downloading packages:
epel-release-7-11.noarch.rpm                                                                                                                 |  15 kB  00:00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : epel-release-7-11.noarch                                                                                                                         1/1 
  Verifying  : epel-release-7-11.noarch                                                                                                                         1/1 

Installed:
  epel-release.noarch 0:7-11                                                                                                                                        

Complete!

3.检查epel源状态

  • 查看yum仓库的所有repo文件
[root@jeven yum.repos.d]# ll
total 20
-rw-r--r--. 1 root root 1759 Jan 28 21:02 CentOS-Base.repo
-rw-r--r--. 1 root root 2081 Jul 26  2022 docker-ce.repo
-rw-r--r--. 1 root root 1946 Jul 10  2022 elrepo.repo
-rw-r--r--. 1 root root  951 Oct  3  2017 epel.repo
-rw-r--r--. 1 root root 1050 Oct  3  2017 epel-testing.repo
  • 清理和重建yum缓存

yum -y clean all && yum makecache
  • 查看yum仓库状态
[root@jeven yum.repos.d]# yum repolist all |grep enable
base/7/x86_64                        CentOS-7 - Base - mirrors.a enabled: 10,072
docker-ce-stable/7/x86_64            Docker CE Stable - x86_64   enabled:    199
elrepo                               ELRepo.org Community Enterp enabled:    155
epel/x86_64                          Extra Packages for Enterpri enabled: 13,740
extras/7/x86_64                      CentOS-7 - Extras - mirrors enabled:    515
updates/7/x86_64                     CentOS-7 - Updates - mirror enabled:  4,691

4.查看epel.repo文件

[root@jeven yum.repos.d]# cat epel.repo 
[epel]
name=Extra Packages for Enterprise Linux 7 - $basearch
#baseurl=http://download.fedoraproject.org/pub/epel/7/$basearch
metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=$basearch
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7

[epel-debuginfo]
name=Extra Packages for Enterprise Linux 7 - $basearch - Debug
#baseurl=http://download.fedoraproject.org/pub/epel/7/$basearch/debug
metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-debug-7&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
gpgcheck=1

[epel-source]
name=Extra Packages for Enterprise Linux 7 - $basearch - Source
#baseurl=http://download.fedoraproject.org/pub/epel/7/SRPMS
metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-source-7&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
gpgcheck=1

四、使用第三方阿里的epel源

1.清空epel源

yum remove  -y epel-release

2.使用阿里的epel源

[root@jeven yum.repos.d]# wget -O /etc/yum.repos.d/epel.repo https://mirrors.aliyun.com/repo/epel-7.repo
--2023-02-01 15:09:07--  https://mirrors.aliyun.com/repo/epel-7.repo
Resolving mirrors.aliyun.com (mirrors.aliyun.com)... 123.6.21.248, 123.6.21.240, 123.6.21.244, ...
Connecting to mirrors.aliyun.com (mirrors.aliyun.com)|123.6.21.248|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 664 [application/octet-stream]
Saving to: ‘/etc/yum.repos.d/epel.repo’

100%[==========================================================================================================================>] 664         --.-K/s   in 0.007s  

2023-02-01 15:09:07 (90.0 KB/s) - ‘/etc/yum.repos.d/epel.repo’ saved [664/664]

3.查看epel源状态

[root@jeven yum.repos.d]# yum repolist all |grep epel
epel/x86_64                          Extra Packages for Enterpri enabled: 13,740
epel-debuginfo/x86_64                Extra Packages for Enterpri disabled
epel-source                          Extra Packages for Enterpri disabled

4.查看epel.repo文件

[root@jeven yum.repos.d]# cat epel.repo 
[epel]
name=Extra Packages for Enterprise Linux 7 - $basearch
baseurl=http://mirrors.aliyun.com/epel/7/$basearch
failovermethod=priority
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7

[epel-debuginfo]
name=Extra Packages for Enterprise Linux 7 - $basearch - Debug
baseurl=http://mirrors.aliyun.com/epel/7/$basearch/debug
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
gpgcheck=0

[epel-source]
name=Extra Packages for Enterprise Linux 7 - $basearch - Source
baseurl=http://mirrors.aliyun.com/epel/7/SRPMS
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
gpgcheck=0
[root@jeven yu

五、安装links工具

1.在epel仓库中安装links工具

[root@jeven yum.repos.d]# yum -y install links
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * elrepo: mirrors.tuna.tsinghua.edu.cn
Resolving Dependencies
--> Running transaction check
---> Package links.x86_64 1:2.20.2-1.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

====================================================================================================================================================================
 Package                              Arch                                  Version                                       Repository                           Size
====================================================================================================================================================================
Installing:
 links                                x86_64                                1:2.20.2-1.el7                                epel                                2.9 M

Transaction Summary
====================================================================================================================================================================
Install  1 Package

Total download size: 2.9 M
Installed size: 4.4 M
Downloading packages:
links-2.20.2-1.el7.x86_64.rpm                                                                                                                | 2.9 MB  00:00:28     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : 1:links-2.20.2-1.el7.x86_64                                                                                                                      1/1 
  Verifying  : 1:links-2.20.2-1.el7.x86_64                                                                                                                      1/1 

Installed:
  links.x86_64 1:2.20.2-1.el7                                                                                                                                       

Complete!

2.使用links

inks -dump  https://www.baidu.com/
[root@jeven yum.repos.d]# links -dump  https://mirrors.aliyun.com/centos/
   Link: canonical
   [IMG]
   开源镜像站
   免费体验Linux沙箱实验室 全部镜像 域名解析DNS 网站授时NTP 反馈与建议
   阿里云镜像站> centos镜像配置页> centos镜像下载页> 详细内容

                               Index of /centos/

   File Name                     File Size Date             
   Parent directory/             -         -                
   2/                            -         2010-05-07 01:48 
   2.1/                          -         2009-09-09 13:18 
   3/                            -         2010-05-07 01:48 
   3.1/                          -         2010-05-07 01:48 
   3.3/                          -         2010-05-07 01:48 
   3.4/                          -         2010-05-07 01:48 
   3.5/                          -         2010-05-07 01:48 
   3.6/                          -         2010-05-07 01:48 
   3.7/                          -         2010-05-07 01:48 
   3.8/                          -         2010-05-07 01:48 
   3.9/                          -         2011-03-03 07:44 
   4/                            -         2012-03-13 08:24 
   4.0/                          -         2005-07-19 05:11 
   4.1/                          -         2005-10-22 01:54 
   4.2/                          -         2006-11-04 20:43 
   4.3/                          -         2006-11-11 06:15 
   4.4/                          -         2007-07-08 02:21 
   4.5/                          -         2008-01-11 00:12 
   4.6/                          -         2009-03-31 19:55 
   4.7/                          -         2010-03-08 18:56 
   4.8/                          -         2012-03-13 08:14 
   4.9/                          -         2017-04-03 19:34 
   5/                            -         2017-04-03 19:35 
   5.0/                          -         2014-10-16 21:37 
   5.1/                          -         2014-10-16 21:37 
   5.10/                         -         2017-04-03 19:30 
   5.11/                         -         2017-04-03 19:34 
   5.2/                          -         2014-10-16 21:37 
   5.3/                          -         2014-10-16 21:37 
   5.4/                          -         2014-10-16 21:37 
   5.5/                          -         2014-10-16 21:37 
   5.6/                          -         2014-10-16 21:37 
   5.7/                          -         2014-10-16 21:37 
   5.8/                          -         2014-10-16 21:37 
   5.9/                          -         2014-10-16 21:38 
   6/                            -         2018-07-04 01:21 
   6.0/                          -         2014-10-16 21:42 
   6.1/                          -         2014-10-16 21:42 
   6.10/                         -         2020-12-02 17:00 
   6.2/                          -         2014-10-16 21:42 
   6.3/                          -         2014-10-16 21:42 
   6.4/                          -         2014-10-16 21:42 
   6.5/                          -         2015-01-05 22:33 
   6.6/                          -         2015-08-12 20:23 
   6.7/                          -         2016-06-02 00:09 
   6.8/                          -         2017-06-12 20:38 
   6.9/                          -         2018-07-25 23:42 
   7/                            -         2020-11-12 20:29 
   7.0.1406/                     -         2015-04-07 22:24 
   7.1.1503/                     -         2016-01-08 23:25 
   7.2.1511/                     -         2017-01-28 22:29 
   7.3.1611/                     -         2017-10-25 22:57 
   7.4.1708/                     -         2018-05-24 21:25 
   7.5.1804/                     -         2019-01-05 00:00 
   7.6.1810/                     -         2019-09-25 17:47 
   7.7.1908/                     -         2020-05-05 00:25 
   7.8.2003/                     -         2020-11-17 15:28 
   7.9.2009/                     -         2021-01-18 22:12 
   8/                            -         2021-11-16 20:47 
   8-stream/                     -         2023-01-26 15:44 
   8.0.1905/                     -         2020-10-21 15:52 
   8.1.1911/                     -         2020-10-21 15:53 
   8.2.2004/                     -         2020-12-22 23:27 
   8.3.2011/                     -         2021-09-08 14:57 
   8.4.2105/                     -         2021-11-17 15:29 
   8.5.2111/                     -         2021-12-22 08:53 
   HEADER.html                   1.2 KB    2014-09-30 03:27 
   HEADER.images/                -         2013-11-07 23:21 
   RPM-GPG-KEY-CentOS-3          1.8 KB    2004-03-16 07:16 
   RPM-GPG-KEY-CentOS-4          1.8 KB    2010-05-07 01:48 
   RPM-GPG-KEY-CentOS-5          1.5 KB    2007-02-20 01:57 
   RPM-GPG-KEY-CentOS-6          1.7 KB    2011-07-10 22:28 
   RPM-GPG-KEY-CentOS-7          1.7 KB    2014-07-05 00:01 
   RPM-GPG-KEY-CentOS-Debug-6    1.7 KB    2011-07-10 22:28 
   RPM-GPG-KEY-CentOS-Debug-7    1004.0 B  2015-12-09 17:59 
   RPM-GPG-KEY-CentOS-Official   1.6 KB    2019-09-12 15:39 
   RPM-GPG-KEY-CentOS-Security-6 1.7 KB    2011-07-10 22:28 
   RPM-GPG-KEY-CentOS-Testing-6  1.7 KB    2011-07-10 22:28 
   RPM-GPG-KEY-CentOS-Testing-7  1.7 KB    2015-12-09 17:59 
   RPM-GPG-KEY-beta              1.5 KB    2007-02-20 01:56 
   RPM-GPG-KEY-centos4           1.8 KB    2005-02-27 01:51 
   TIME                          11.0 B    2023-02-01 12:55 
   build/                        -         2005-06-12 20:56 
   dir_sizes                     1.1 KB    2023-02-01 12:10 
   dostools/                     -         2007-04-04 17:45 
   filelist.gz                   7.2 MB    2023-02-01 12:10 
   graphics/                     -         2014-06-12 19:59 
   timestamp.txt                 29.0 B    2023-02-01 12:55 

   镜像源配置帮助 立即查看
   下载排行榜
   最热
   最新
   1 centos镜像源
   2 ubuntu镜像源
   3 pypi镜像源
   4 alinux镜像源
   5 epel镜像源
   6 debian镜像源
   7 fedora镜像源
   8 opensuse镜像源
   9 kali镜像源
   10 rockylinux镜像源
   1 almalinux镜像源
   2 calculate-linux镜像源
   3 blender镜像源
   4 grafana镜像源
   5 centos-debuginfo镜像源
   6 oceanbase镜像源
   7 circlelinux镜像源
   8 termux镜像源
   9 centos-stream镜像源
   10 libreoffice镜像源
   大家都在搜
   archlinux镜像源
   xbmc镜像源
   rubygems镜像源
   mariadb镜像源
   alpine镜像源
   elrepo镜像源
   pypi镜像源
   clfs镜像源
   deepin镜像源
   centos-debuginfo镜像源
相关文章
|
3月前
|
Ubuntu Linux Anolis
Linux系统禁用swap
本文介绍了在新版本Linux系统(如Ubuntu 20.04+、CentOS Stream、openEuler等)中禁用swap的两种方法。传统通过注释/etc/fstab中swap行的方式已失效,现需使用systemd管理swap.target服务或在/etc/fstab中添加noauto参数实现禁用。方法1通过屏蔽swap.target适用于新版系统,方法2通过修改fstab挂载选项更通用,兼容所有系统。
275 3
Linux系统禁用swap
|
3月前
|
存储 分布式计算 Linux
安装篇--CentOS 7 虚拟机安装
VMware 装 CentOS 7 不知道从哪下手?这篇超详细图文教程手把手教你在 VMware Workstation 中完成 CentOS 7 桌面系统的完整安装流程。从 ISO 镜像下载、虚拟机配置,到安装图形界面、设置用户密码,每一步都有截图讲解,适合零基础新手快速上手。装好之后无论你是要搭 Hadoop 集群,还是练 Linux ,这个环境都够你折腾一整天!
1277 2
|
3月前
|
Linux
Linux系统修改网卡名为eth0、eth1
在Linux系统中,可通过修改GRUB配置和创建Udev规则或使用systemd链接文件,将网卡名改为`eth0`、`eth1`等传统命名方式,适用于多种发行版并支持多网卡配置。
411 3
|
2月前
|
监控 关系型数据库 MySQL
在CentOS系统中,如何统计哪个进程打开了文件描述符?
利用上述方法,你可以有效地监控和统计CentOS系统中的进程打开的文件描述符数量,以帮助排查错误或优化系统配置。通过组合使用各种工具和命令,可以获得对系统状态和行为的深入了解,进而做出相应的调整和
147 5
|
3月前
|
安全 关系型数据库 MySQL
CentOS 7 yum 安装 MySQL教程
在CentOS 7上安装MySQL 8,其实流程很清晰。首先通过官方Yum仓库来安装服务,然后启动并设为开机自启。最重要的环节是首次安全设置:需要先从日志里找到临时密码来登录,再修改成你自己的密码,并为远程连接创建用户和授权。最后,也别忘了在服务器防火墙上放行3306端口,这样远程才能连上。
657 16
|
Ubuntu Linux 网络安全
Linux系统初始化脚本
一款支持Rocky、CentOS、Ubuntu、Debian、openEuler等主流Linux发行版的系统初始化Shell脚本,涵盖网络配置、主机名设置、镜像源更换、安全加固等多项功能,适配单/双网卡环境,支持UEFI引导,提供多版本下载与持续更新。
372 0
Linux系统初始化脚本
|
3月前
|
安全 Linux Shell
Linux系统提权方式全面总结:从基础到高级攻防技术
本文全面总结Linux系统提权技术,涵盖权限体系、配置错误、漏洞利用、密码攻击等方法,帮助安全研究人员掌握攻防技术,提升系统防护能力。
327 1
|
3月前
|
监控 安全 Linux
Linux系统提权之计划任务(Cron Jobs)提权
在Linux系统中,计划任务(Cron Jobs)常用于定时执行脚本或命令。若配置不当,攻击者可利用其提权至root权限。常见漏洞包括可写的Cron脚本、目录、通配符注入及PATH变量劫持。攻击者通过修改脚本、创建恶意任务或注入命令实现提权。系统管理员应遵循最小权限原则、使用绝对路径、避免通配符、设置安全PATH并定期审计,以防范此类攻击。
1051 1
|
缓存 关系型数据库 MySQL
百度搜索:蓝易云【CentOS8服务器安装MySQL报错:no match mysql-community-server】
现在,你已经成功安装了MySQL服务器并解决了"no match mysql-community-server"的报错问题。祝你使用愉快!
421 1
|
Linux 数据库管理 Python
CentOS7编译安装Python3.10(含OpenSSL1.1.1安装),创建虚拟环境,运行Django项目(含sqlite版本报错)
CentOS7编译安装Python3.10(含OpenSSL1.1.1安装),创建虚拟环境,运行Django项目(含sqlite版本报错)
1841 4

热门文章

最新文章