RHEL 7 安裝 epel

 

epel RPM套件的位置改了,之前【RHEL 7 64位元 安裝 Adobe Reader 9】及【RHEL 7 安裝 XRDP】兩篇提到的位置,已經改到 https://dl.fedoraproject.org/pub/epel/7/x86_64/Packages/e/epel-release-7-11.noarch.rpm

image

先用 wget 將套件 download 到本地端

# wget https://dl.fedoraproject.org/pub/epel/7/x86_64/Packages/e/epel-release-7-11.noarch.rpm
--2019-07-28 22:17:25--  https://dl.fedoraproject.org/pub/epel/7/x86_64/Packages/e/epel-release-7-11.noarch.rpm
Resolving dl.fedoraproject.org (dl.fedoraproject.org)... 209.132.181.25, 209.132.181.24, 209.132.181.23
Connecting to dl.fedoraproject.org (dl.fedoraproject.org)|209.132.181.25|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 15080 (15K) [application/x-rpm]
Saving to: ‘epel-release-7-11.noarch.rpm’

100%[=================================================================================>] 15,080      92.1KB/s   in 0.2s

2019-07-28 22:17:25 (92.1 KB/s) - ‘epel-release-7-11.noarch.rpm’ saved [15080/15080]

這個 RPM 套件並不是重點,重點是 /etc/yum.repos.d/*.repo

# rpm -qlp epel-release-7-11.noarch.rpm
warning: epel-release-7-11.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID 352c64e5: NOKEY
/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
/etc/yum.repos.d/epel-testing.repo
/etc/yum.repos.d/epel.repo
/usr/lib/systemd/system-preset/90-epel.preset
/usr/share/doc/epel-release-7
/usr/share/doc/epel-release-7/GPL

其中以 /etc/yum.repos.d/epel.repo 最為重要【要確認baseurl 是否可以正常連線?

# cat /etc/yum.repos.d/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

確認 public key

# ls -l /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
-rw-r--r--. 1 root root 1662 Jul 28 22:39 /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7

然後就可以安裝個 RPM 套件試試看

]# yum install sshpass -y
Loaded plugins: langpacks
Resolving Dependencies
--> Running transaction check
---> Package sshpass.x86_64 0:1.06-1.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

==================================================================================================================================================
 Package                            Arch                              Version                               Repository                       Size
==================================================================================================================================================
Installing:
 sshpass                            x86_64                            1.06-1.el7                            epel                             21 k

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

Total size: 21 k
Installed size: 38 k
Downloading packages:
warning: /var/cache/yum/x86_64/7Server/epel/packages/sshpass-1.06-1.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID 352c64e5: NOKEY
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
Importing GPG key 0x352C64E5:
 Userid     : "Fedora EPEL (7) "
 Fingerprint: 91e9 7d7c 4a5e 96f1 7f3e 888f 6a2f aea2 352c 64e5
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : sshpass-1.06-1.el7.x86_64                                                                                                      1/1
  Verifying  : sshpass-1.06-1.el7.x86_64                                                                                                      1/1

Installed:
  sshpass.x86_64 0:1.06-1.el7

Complete!

這樣就大功告成了!

廣告
本篇發表於 CentOS 7, Linux, RHEL 7。將永久鏈結加入書籤。

發表迴響

在下方填入你的資料或按右方圖示以社群網站登入:

WordPress.com 標誌

您的留言將使用 WordPress.com 帳號。 登出 /  變更 )

Google photo

您的留言將使用 Google 帳號。 登出 /  變更 )

Twitter picture

您的留言將使用 Twitter 帳號。 登出 /  變更 )

Facebook照片

您的留言將使用 Facebook 帳號。 登出 /  變更 )

連結到 %s