在之前的博客我们了解了使用本地ISO 文件配置yum 源,如下:
Linux 平台下 yum 源 配置 手册
https://www.cndba.cn/dave/article/154
本地yum 源的包只能是ISO 镜像内的包,如果安装依赖的是外部包,则安装还是会失败。
因此CentOS 社区有一个扩展包EPEL(Extra Packages for Enterprise Linux),是为企业级Linux提供的一组高质量的额外软件包,包括但不限于Red Hat Enterprise Linux (RHEL), CentOS and Scientific Linux (SL), Oracle Enterprise Linux (OEL)。 安装epel 后就可以使用iso 镜像之外的包。
如果操作系统是授权的系统,可以直接使用yum 进行安装:
[dave@www.cndba.cn Code]# yum -y install epel-release
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
No package epel-release available.
Error: Nothing to do
[dave@www.cndba.cn Code]#
但我们这里未授权,所以选择手工安装:
epel 包地址:
https://dl.fedoraproject.org/pub/epel/7/x86_64/Packages/e/epel-release-7-12.noarch.rpm
如果是其他版本,在该网站重新选择。
[dave@www.cndba.cn Code]# rpm -ivh https://dl.fedoraproject.org/pub/epel/7/x86_64/Packages/e/epel-release-7-12.noarch.rpm
Retrieving https://dl.fedoraproject.org/pub/epel/7/x86_64/Packages/e/epel-release-7-12.noarch.rpm
warning: /var/tmp/rpm-tmp.RPCZBZ: Header V3 RSA/SHA256 Signature, key ID 352c64e5: NOKEY
Preparing... ################################# [100%]
Updating / installing...
1:epel-release-7-12 ################################# [100%]
[dave@www.cndba.cn Code]#
更新yum 数据:
yum clean all && yum makecache
然后就可以利用epel 安装外部包了,当前这里的前提是机器能访问外网:
[dave@www.cndba.cn Code]# yum install python-pip -y
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
Resolving Dependencies
--> Running transaction check
---> Package python2-pip.noarch 0:8.1.2-10.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=================================================================================================================================================
Package Arch Version Repository Size
=================================================================================================================================================
Installing:
python2-pip noarch 8.1.2-10.el7 epel 1.7 M
Transaction Summary
=================================================================================================================================================
Install 1 Package
Total download size: 1.7 M
Installed size: 7.2 M
Downloading packages:
warning: /var/cache/yum/x86_64/7Server/epel/packages/python2-pip-8.1.2-10.el7.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID 352c64e5: NOKEY
Public key for python2-pip-8.1.2-10.el7.noarch.rpm is not installed
python2-pip-8.1.2-10.el7.noarch.rpm | 1.7 MB 00:00:00
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
Importing GPG key 0x352C64E5:
Userid : "Fedora EPEL (7) <epel@fedoraproject.org>"
Fingerprint: 91e9 7d7c 4a5e 96f1 7f3e 888f 6a2f aea2 352c 64e5
Package : epel-release-7-12.noarch (installed)
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Warning: RPMDB altered outside of yum.
Installing : python2-pip-8.1.2-10.el7.noarch 1/1
Verifying : python2-pip-8.1.2-10.el7.noarch 1/1
Installed:
python2-pip.noarch 0:8.1.2-10.el7
Complete!
[dave@www.cndba.cn Code]#
版权声明:本文为博主原创文章,未经博主允许不得转载。