CentOS 7添加EPEL源和RPMforge源

确定系统架构及版本

[root@fgr conf]# cat /etc/redhat-release
CentOS Linux release 7.6.1810 (Core) 
[root@fgr conf]# uname -r
3.10.0-957.12.2.el7.x86_64
[root@fgr conf]# uname -a
Linux fgr.first 3.10.0-957.12.2.el7.x86_64 #1 SMP Tue May 14 21:24:32 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

查看当前系统已经有了哪些源

[root@fgr conf]# yum repolist
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: centos.ustc.edu.cn
 * extras: centos.ustc.edu.cn
 * updates: centos.ustc.edu.cn
源标识                             源名称                                 状态
base/7/x86_64                      CentOS-7 - Base                        10,019
epel-apache-maven/7/x86_64         maven from apache foundation.               4
extras/7/x86_64                    CentOS-7 - Extras                         413
google-chrome                      google-chrome                               3
updates/7/x86_64                   CentOS-7 - Updates                      1,945
repolist: 12,384

安装EPEL源

[root@fgr conf]# yum install epel-release
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: centos.ustc.edu.cn
 * extras: centos.ustc.edu.cn
 * updates: centos.ustc.edu.cn
正在解决依赖关系
--> 正在检查事务
---> 软件包 epel-release.noarch.0.7-11 将被 安装
--> 解决依赖关系完成

依赖关系解决

================================================================================
 Package                架构             版本            源                大小
================================================================================
正在安装:
 epel-release           noarch           7-11            extras            15 k

事务概要
================================================================================
安装  1 软件包

总下载量:15 k
安装大小:24 k
Is this ok [y/d/N]: y
Downloading packages:
epel-release-7-11.noarch.rpm                               |  15 kB   00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  正在安装    : epel-release-7-11.noarch                                    1/1 
  验证中      : epel-release-7-11.noarch                                    1/1 

已安装:
  epel-release.noarch 0:7-11                                                    

完毕!

手动更新源

[root@fgr conf]# yum makecache
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
epel/x86_64/metalink                                     | 6.5 kB     00:00     
 * base: centos.ustc.edu.cn
 * epel: mirrors.aliyun.com
 * extras: centos.ustc.edu.cn
 * updates: centos.ustc.edu.cn
base                                                     | 3.6 kB     00:00     
epel                                                     | 4.7 kB     00:00     
epel-apache-maven                                        | 3.3 kB     00:00     
extras                                                   | 3.4 kB     00:00     
google-chrome                                            | 1.3 kB     00:00     
updates                                                  | 3.4 kB     00:00     
(1/15): epel/x86_64/group_gz                               |  88 kB   00:00     
(2/15): epel/x86_64/prestodelta                            |  420 B   00:00     
(3/15): epel/x86_64/updateinfo                             | 1.0 MB   00:00     
(4/15): epel/x86_64/other_db                               | 3.2 MB   00:01     
(5/15): epel/x86_64/filelists_db                           |  11 MB   00:02     
(6/15): epel-apache-maven/7/x86_64/prestodelta             |   78 B   00:04     
(7/15): extras/7/x86_64/prestodelta                        |  62 kB   00:00     
(8/15): extras/7/x86_64/other_db                           | 126 kB   00:00     
(9/15): extras/7/x86_64/filelists_db                       | 243 kB   00:00     
(10/15): google-chrome/other                               |  369 B   00:00     
(11/15): updates/7/x86_64/filelists_db                     | 3.7 MB   00:00     
(12/15): google-chrome/filelists                           | 1.7 kB   00:03     
(13/15): epel-apache-maven/7/x86_64/other_db               | 2.5 kB   00:05     
epel-apache-maven/7/x86_64/fil FAILED                                           
http://repos.fedorapeople.org/repos/dchen/apache-maven/epel-7/x86_64/repodata/7a6c906282caaf29683c51338d259e0f990a929cef942ba7517c9a60503c9cf5-filelists.sqlite.bz2: [Errno 12] Timeout on https://repos.fedorapeople.org/repos/dchen/apache-maven/epel-7/x86_64/repodata/7a6c906282caaf29683c51338d259e0f990a929cef942ba7517c9a60503c9cf5-filelists.sqlite.bz2: (28, 'Operation too slow. Less than 1000 bytes/sec transferred the last 30 seconds')
正在尝试其它镜像。
(14/15): epel-apache-maven/7/x86_64/filelists_db           | 4.7 kB   00:02     
(15/15): epel/x86_64/primary_db                            | 6.7 MB   01:17     
google-chrome                                                               3/3
google-chrome                                                               3/3
元数据缓存已建立

再次查看源,可以看到epel已经安装成功

[root@fgr conf]# yum repolist
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: centos.ustc.edu.cn
 * epel: mirrors.aliyun.com
 * extras: centos.ustc.edu.cn
 * updates: centos.ustc.edu.cn
源标识                     源名称                                         状态
base/7/x86_64              CentOS-7 - Base                                10,019
epel/x86_64                Extra Packages for Enterprise Linux 7 - x86_64 13,195
epel-apache-maven/7/x86_64 maven from apache foundation.                       4
extras/7/x86_64            CentOS-7 - Extras                                 413
google-chrome              google-chrome                                       3
updates/7/x86_64           CentOS-7 - Updates                              1,945
repolist: 25,579

添加RPMforge

下载RPM

下载地址
https://centos.pkgs.org/7/repoforge-x86_64/rpmforge-release-0.5.3-1.el7.rf.x86_64.rpm.html

安装

# 进到下载路径,每个人的路径应该不同
[root@fgr conf]# cd /home/fgr/下载
[root@fgr 下载]# ll
总用量 783168
-rw-rw-r--. 1 fgr fgr   9699102 5月  17 18:20 apache-tomcat-8.5.41.tar.gz
-rw-rw-r--. 1 fgr fgr  58409570 5月  17 17:50 google-chrome-stable_current_x86_64.rpm
-rw-rw-r--. 1 fgr fgr 700598701 5月  17 18:29 ideaIU-2019.1.2.tar.gz
-rw-r--r--. 1 fgr fgr         0 5月  17 16:13 jdk-8u211-linux-x64.rpm
-rw-------. 1 fgr fgr  19562035 5月  17 16:40 jdk-8u211-linux-x64.rpm.part
-rw-rw-r--. 1 fgr fgr     12520 5月  19 14:01 rpmforge-release-0.5.3-1.el7.rf.x86_64.rpm
-rw-rw-r--. 1 fgr fgr  13672413 5月  17 23:47 sublime_text_3_build_3207_x64.tar.bz2
#安装
[root@fgr 下载]# rpm -Uvh rpmforge-release*rpm
警告:rpmforge-release-0.5.3-1.el7.rf.x86_64.rpm: 头V3 DSA/SHA1 Signature, 密钥 ID 6b8d79e6: NOKEY
准备中...                          ################################# [100%]
正在升级/安装...
   1:rpmforge-release-0.5.3-1.el7.rf  ################################# [100%]

手动更新,查看源

[root@fgr 下载]# yum makecache
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
epel/x86_64/metalink                                     | 7.2 kB     00:00     
 * base: centos.ustc.edu.cn
 * epel: mirrors.aliyun.com
 * extras: centos.ustc.edu.cn
 * rpmforge: mirrors.tuna.tsinghua.edu.cn
 * updates: centos.ustc.edu.cn
base                                                     | 3.6 kB     00:00     
epel-apache-maven                                        | 3.3 kB     00:00     
extras                                                   | 3.4 kB     00:00     
google-chrome                                            | 1.3 kB     00:00     
rpmforge                                                 | 1.9 kB     00:00     
updates                                                  | 3.4 kB     00:00     
(1/2): rpmforge/other_db                                   |  34 kB   00:00     
(2/2): rpmforge/filelists_db                               |  96 kB   00:00     
元数据缓存已建立
[root@fgr 下载]# yum repolist
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: centos.ustc.edu.cn
 * epel: mirrors.aliyun.com
 * extras: centos.ustc.edu.cn
 * rpmforge: mirrors.tuna.tsinghua.edu.cn
 * updates: centos.ustc.edu.cn
源标识                     源名称                                         状态
base/7/x86_64              CentOS-7 - Base                                10,019
epel/x86_64                Extra Packages for Enterprise Linux 7 - x86_64 13,195
epel-apache-maven/7/x86_64 maven from apache foundation.                       4
extras/7/x86_64            CentOS-7 - Extras                                 413
google-chrome              google-chrome                                       3
rpmforge                   RHEL 7 - RPMforge.net - dag                       245
updates/7/x86_64           CentOS-7 - Updates                              1,945
repolist: 25,824

到这里,添加EPEL源和RPMforge源已经完成了。
参考地址:
http://www.cnblogs.com/sxdcgaq8080/p/7516186.html

你可能感兴趣的:(Linux,环境安装)