mg4377娱乐娱城官网_mg4377娱乐手机版_www.mg4377.com

CentOS系统自动下载RPM包及其具备信赖的包,包及

时间:2019-08-23 13:07来源:mg4377娱乐娱城官网
linux系统下怎样使用yumdownloadonly下载RPM包及依赖包,yumdownloadonlyrpm 如何使用yumdownloadonly下载RPM包及重视包的步子: 1 下载yumdownloadonly插件 yum install yum-plugin-downloadonly 2 下载到钦点目录(

linux系统下怎样使用yumdownloadonly下载RPM包及依赖包,yumdownloadonlyrpm

如何使用yumdownloadonly下载RPM包及重视包的步子:

1 下载yumdownloadonly插件

yum install yum-plugin-downloadonly

2 下载到钦点目录(正视包会一齐下载)

yum install --downloadonly --downloaddir=/root/httpd httpd

怎么着使用yumdownloadonly下载RPM包及重视包的步骤: 1 下载yumdownloadonly插件...

前几日作者尝试去创制叁个仅包涵大家平日在 CentOS 7 下采纳的软件的本土货仓。当然,大家能够使用 curl 只怕 wget 下载任何软件包,然则那么些命令并不能下载供给的重视软件包。你必得去花一些时光还要手动的去搜索和下载被安装的软件商讨所正视的软件包。不过,大家而不是必得这么。在那些轻便的课程中,笔者将会指点你以二种情势下载软件包及其全数信赖包。作者早就在 CentOS 7 下进展了测验,不过那几个同样的步调只怕在任何依照 RPM 管理连串的发行版上也能够干活,举个例子 哈弗HEL,Fedora 和 Scientific Linux。

CentOS下载 RPM 包及其具备注重包

您无法不去花一些岁月还要手动的去搜索和下载被设置的软件切磋所注重的软件包。但是,大家并不是必得这么。在这么些轻便的课程中,小编将会指点你以二种方式下载软件包及其全数正视包。笔者早就在 CentOS 7 下进展了测量试验,不过这几个同样的步调或然在任何依据 RPM 管理体系的发行版上也能够干活,举个例子 OdysseyHEL,Fedora 和 Scientific Linux。

CentOS系统自动下载RPM包及其具备信赖的包,包及其全体信赖。办法1 利用 Downloadonly 插件下载 RPM 软件包及其具有注重包

咱俩得以通过 yum 命令的 Downloadonly 插件下载 RPM 软件包及其具有重视包。
为了设置 Downloadonly 插件,以 root 身份运营以下命令。

yum install yum-plugin-downloadonly

到现在,运营以下命令去下载二个 RPM 软件包。

yum install --downloadonly <package-name>

暗中同意情形下,这么些命令将会下载并把软件包保存到 /var/cache/yum/ 的 rhel-{arch}-channel/packageslocation 目录,可是,你也得以下载和封存软件包到别的职务,你能够因而 –downloaddir 选项来钦定。

yum install --downloadonly --downloaddir=<directory> <package-name>

例子:

yum install --downloadonly --downloaddir=/root/mypackages/ httpd

终端输出:

Loaded plugins: fastestmirrorLoading mirror speeds from cached hostfile * base: centos.excellmedia.net * epel: epel.mirror.angkasa.id * extras: centos.excellmedia.net * updates: centos.excellmedia.netResolving Dependencies--> Running transaction check---> Package httpd.x86_64 0:2.4.6-40.el7.centos.4 will be installed--> Processing Dependency: httpd-tools = 2.4.6-40.el7.centos.4 for package: httpd-2.4.6-40.el7.centos.4.x86_64--> Processing Dependency: /etc/mime.types for package: httpd-2.4.6-40.el7.centos.4.x86_64--> Processing Dependency: libaprutil-1.so.0()(64bit) for package: httpd-2.4.6-40.el7.centos.4.x86_64--> Processing Dependency: libapr-1.so.0()(64bit) for package: httpd-2.4.6-40.el7.centos.4.x86_64--> Running transaction check---> Package apr.x86_64 0:1.4.8-3.el7 will be installed---> Package apr-util.x86_64 0:1.5.2-6.el7 will be installed---> Package httpd-tools.x86_64 0:2.4.6-40.el7.centos.4 will be installed---> Package mailcap.noarch 0:2.1.41-2.el7 will be installed--> Finished Dependency ResolutionDependencies Resolved======================================================================================================================================= Package Arch Version Repository Size=======================================================================================================================================Installing: httpd x86_64 2.4.6-40.el7.centos.4 updates 2.7 MInstalling for dependencies: apr x86_64 1.4.8-3.el7 base 103 k apr-util x86_64 1.5.2-6.el7 base 92 k httpd-tools x86_64 2.4.6-40.el7.centos.4 updates 83 k mailcap noarch 2.1.41-2.el7 base 31 kTransaction Summary=======================================================================================================================================Install 1 Package ( 4 Dependent packages)Total download size: 3.0 MInstalled size: 10 MBackground downloading packages, then exiting:(1/5): apr-1.4.8-3.el7.x86_64.rpm | 103 kB 00:00:01 (2/5): apr-util-1.5.2-6.el7.x86_64.rpm | 92 kB 00:00:01 (3/5): mailcap-2.1.41-2.el7.noarch.rpm | 31 kB 00:00:01 (4/5): httpd-tools-2.4.6-40.el7.centos.4.x86_64.rpm | 83 kB 00:00:01 (5/5): httpd-2.4.6-40.el7.centos.4.x86_64.rpm | 2.7 MB 00:00:09 ---------------------------------------------------------------------------------------------------------------------------------------Total 331 kB/s | 3.0 MB 00:00:09 exiting because "Download Only" specified

图片 1
今后去你钦定的目录地点下,你将会看出这里有下载好的软件包和重视的软件。在小编这种景况下,作者早已把软件包下载到 /root/mypackages/ 目录下。让大家来查看一下剧情:

ls /root/mypackages/

样本输出:

apr-1.4.8-3.el7.x86_64.rpmapr-util-1.5.2-6.el7.x86_64.rpmhttpd-2.4.6-40.el7.centos.4.x86_64.rpmhttpd-tools-2.4.6-40.el7.centos.4.x86_64.rpmmailcap-2.1.41-2.el7.noarch.rpm

图片 2
正如你在上头输出所看到的, httpd软件包已经被依附全体信赖性下载达成了 。
请留意,这几个插件适用于 yum install/yum update, 可是并不适用于 yum groupinstall 。暗中同意情形下,那一个插件将会下载仓库颅骨缺损行可用的软件包。可是你能够因此点名版本号来下载有个别特定的软件版本。
例子:

yum install --downloadonly --downloaddir=/root/mypackages/ httpd-2.2.6-40.el7

除此以外,你也足以如下叁遍性下载四个包:

yum install --downloadonly --downloaddir=/root/mypackages/ httpd vsftpd

格局 2使用 Yumdownloader 工具来下载 RPM 软件包及其全体依赖包

Yumdownloader是一款轻巧,可是却相当管用的命令行工具,它能够贰回性下载任何 RPM 软件包及其具备重视包。
以 root 身份运转如下命令安装 Yumdownloader 工具。

yum install yum-utils

一经设置达成,运维如下命令去下载二个软件包,举个例子 httpd。

yumdownloader httpd

为了遵照全部重视性下载软件包,咱们运用 --resolve参数:

yumdownloader --resolve httpd

私下认可景况下,Yumdownloader 将会下载软件包到当前职业目录下。
为了将软件下载到一个一定的目录下,我们采取 --destdir 参数:

yumdownloader --resolve --destdir=/root/mypackages/ httpd

或者,

yumdownloader --resolve --destdir /root/mypackages/ httpd

极限输出:

Loaded plugins: fastestmirrorLoading mirror speeds from cached hostfile * base: centos.excellmedia.net * epel: epel.mirror.angkasa.id * extras: centos.excellmedia.net * updates: centos.excellmedia.net--> Running transaction check---> Package httpd.x86_64 0:2.4.6-40.el7.centos.4 will be installed--> Processing Dependency: httpd-tools = 2.4.6-40.el7.centos.4 for package: httpd-2.4.6-40.el7.centos.4.x86_64--> Processing Dependency: /etc/mime.types for package: httpd-2.4.6-40.el7.centos.4.x86_64--> Processing Dependency: libaprutil-1.so.0()(64bit) for package: httpd-2.4.6-40.el7.centos.4.x86_64--> Processing Dependency: libapr-1.so.0()(64bit) for package: httpd-2.4.6-40.el7.centos.4.x86_64--> Running transaction check---> Package apr.x86_64 0:1.4.8-3.el7 will be installed---> Package apr-util.x86_64 0:1.5.2-6.el7 will be installed---> Package httpd-tools.x86_64 0:2.4.6-40.el7.centos.4 will be installed---> Package mailcap.noarch 0:2.1.41-2.el7 will be installed--> Finished Dependency Resolution(1/5): apr-util-1.5.2-6.el7.x86_64.rpm | 92 kB 00:00:01 (2/5): mailcap-2.1.41-2.el7.noarch.rpm | 31 kB 00:00:02 (3/5): apr-1.4.8-3.el7.x86_64.rpm | 103 kB 00:00:02 (4/5): httpd-tools-2.4.6-40.el7.centos.4.x86_64.rpm | 83 kB 00:00:03 (5/5): httpd-2.4.6-40.el7.centos.4.x86_64.rpm | 2.7 MB 00:00:19

图片 3
让大家显著一下软件包是或不是被下载到大家内定的目录下。

ls /root/mypackages/

极限输出:

apr-1.4.8-3.el7.x86_64.rpmapr-util-1.5.2-6.el7.x86_64.rpmhttpd-2.4.6-40.el7.centos.4.x86_64.rpmhttpd-tools-2.4.6-40.el7.centos.4.x86_64.rpmmailcap-2.1.41-2.el7.noarch.rpm

图片 4

不像 Downloadonly 插件,Yumdownload 可以下载一组有关的软件包。

yumdownloader "@Development Tools" --resolve --destdir /root/mypackages/

以小编之见,作者爱怜 Yumdownloader 更胜似 Yum 的 Downloadonly 插件。但是,两个都以非常轻松易懂並且能够做到一样的办事。

RPM 包及其具备信赖包 你无法不去花一些小时还要手动的去搜求和下载被安装的软件商量所信赖的软件包。可是,大家并非必需那样。...

办法1施用"Downloadonly"插件下载 RPM 软件包及其全体注重包

大家得以透过 yum 命令的 “Downloadonly” 插件下载 RPM 软件包及其具备注重包, 为了设置 Downloadonly 插件,以 root 身份运营以下命令:

yum install yum-plugin-downloadonly  

明天,运营以下命令去下载贰个 RPM 软件包

yum install --downloadonly <package-name>

暗许意况下,这一个命令将会下载并把软件包保存到 /var/cache/yum/ 的 rhel-{arch}-channel/packageslocation 目录,不过,你也足以下载和保存软件包到别的地方,你能够因而 –downloaddir 选项来钦定。

yum install --downloadonly --downloaddir=<directory> <package-name>

例子:

yum install --downloadonly --downloaddir=/root/mypackages/  nginx

终极输出:

图片 5图片 6

Loaded plugins: fastestmirror
base                                                                                                                                                                                                         | 3.6 kB  00:00:00     
epel/x86_64/metalink                                                                                                                                                                                         | 5.7 kB  00:00:00     
epel                                                                                                                                                                                                         | 4.7 kB  00:00:00     
extras                                                                                                                                                                                                       | 3.4 kB  00:00:00     
updates                                                                                                                                                                                                      | 3.4 kB  00:00:00     
(1/3): updates/7/x86_64/primary_db                                                                                                                                                                           | 3.6 MB  00:00:01     
(2/3): epel/x86_64/updateinfo                                                                                                                                                                                | 848 kB  00:00:02     
(3/3): epel/x86_64/primary_db                                                                                                                                                                                | 6.1 MB  00:03:08     
Loading mirror speeds from cached hostfile
 * base: mirrors.cn99.com
 * epel: mirrors.ustc.edu.cn
 * extras: mirrors.cn99.com
 * updates: mirrors.cn99.com
Resolving Dependencies
--> Running transaction check
---> Package nginx.x86_64 1:1.12.2-1.el7 will be installed
--> Processing Dependency: nginx-all-modules = 1:1.12.2-1.el7 for package: 1:nginx-1.12.2-1.el7.x86_64
--> Processing Dependency: nginx-filesystem = 1:1.12.2-1.el7 for package: 1:nginx-1.12.2-1.el7.x86_64
--> Processing Dependency: libcrypto.so.10(OPENSSL_1.0.2)(64bit) for package: 1:nginx-1.12.2-1.el7.x86_64
--> Processing Dependency: nginx-filesystem for package: 1:nginx-1.12.2-1.el7.x86_64
--> Processing Dependency: libprofiler.so.0()(64bit) for package: 1:nginx-1.12.2-1.el7.x86_64
--> Running transaction check
---> Package gperftools-libs.x86_64 0:2.4-8.el7 will be installed
--> Processing Dependency: libunwind.so.8()(64bit) for package: gperftools-libs-2.4-8.el7.x86_64
---> Package nginx-all-modules.noarch 1:1.12.2-1.el7 will be installed
--> Processing Dependency: nginx-mod-http-geoip = 1:1.12.2-1.el7 for package: 1:nginx-all-modules-1.12.2-1.el7.noarch
--> Processing Dependency: nginx-mod-http-image-filter = 1:1.12.2-1.el7 for package: 1:nginx-all-modules-1.12.2-1.el7.noarch
--> Processing Dependency: nginx-mod-http-perl = 1:1.12.2-1.el7 for package: 1:nginx-all-modules-1.12.2-1.el7.noarch
--> Processing Dependency: nginx-mod-http-xslt-filter = 1:1.12.2-1.el7 for package: 1:nginx-all-modules-1.12.2-1.el7.noarch
--> Processing Dependency: nginx-mod-mail = 1:1.12.2-1.el7 for package: 1:nginx-all-modules-1.12.2-1.el7.noarch
--> Processing Dependency: nginx-mod-stream = 1:1.12.2-1.el7 for package: 1:nginx-all-modules-1.12.2-1.el7.noarch
---> Package nginx-filesystem.noarch 1:1.12.2-1.el7 will be installed
---> Package openssl-libs.x86_64 1:1.0.1e-42.el7.9 will be updated
--> Processing Dependency: openssl-libs(x86-64) = 1:1.0.1e-42.el7.9 for package: 1:openssl-1.0.1e-42.el7.9.x86_64
---> Package openssl-libs.x86_64 1:1.0.2k-8.el7 will be an update
--> Running transaction check
---> Package libunwind.x86_64 2:1.2-2.el7 will be installed
---> Package nginx-mod-http-geoip.x86_64 1:1.12.2-1.el7 will be installed
--> Processing Dependency: GeoIP for package: 1:nginx-mod-http-geoip-1.12.2-1.el7.x86_64
--> Processing Dependency: libGeoIP.so.1()(64bit) for package: 1:nginx-mod-http-geoip-1.12.2-1.el7.x86_64
---> Package nginx-mod-http-image-filter.x86_64 1:1.12.2-1.el7 will be installed
--> Processing Dependency: gd for package: 1:nginx-mod-http-image-filter-1.12.2-1.el7.x86_64
--> Processing Dependency: libgd.so.2()(64bit) for package: 1:nginx-mod-http-image-filter-1.12.2-1.el7.x86_64
---> Package nginx-mod-http-perl.x86_64 1:1.12.2-1.el7 will be installed
---> Package nginx-mod-http-xslt-filter.x86_64 1:1.12.2-1.el7 will be installed
--> Processing Dependency: libxslt.so.1(LIBXML2_1.0.11)(64bit) for package: 1:nginx-mod-http-xslt-filter-1.12.2-1.el7.x86_64
--> Processing Dependency: libxslt.so.1(LIBXML2_1.0.18)(64bit) for package: 1:nginx-mod-http-xslt-filter-1.12.2-1.el7.x86_64
--> Processing Dependency: libexslt.so.0()(64bit) for package: 1:nginx-mod-http-xslt-filter-1.12.2-1.el7.x86_64
--> Processing Dependency: libxslt.so.1()(64bit) for package: 1:nginx-mod-http-xslt-filter-1.12.2-1.el7.x86_64
---> Package nginx-mod-mail.x86_64 1:1.12.2-1.el7 will be installed
---> Package nginx-mod-stream.x86_64 1:1.12.2-1.el7 will be installed
---> Package openssl.x86_64 1:1.0.1e-42.el7.9 will be updated
---> Package openssl.x86_64 1:1.0.2k-8.el7 will be an update
--> Running transaction check
---> Package GeoIP.x86_64 0:1.5.0-11.el7 will be installed
---> Package gd.x86_64 0:2.0.35-26.el7 will be installed
--> Processing Dependency: libpng15.so.15(PNG15_0)(64bit) for package: gd-2.0.35-26.el7.x86_64
--> Processing Dependency: libjpeg.so.62(LIBJPEG_6.2)(64bit) for package: gd-2.0.35-26.el7.x86_64
--> Processing Dependency: libpng15.so.15()(64bit) for package: gd-2.0.35-26.el7.x86_64
--> Processing Dependency: libjpeg.so.62()(64bit) for package: gd-2.0.35-26.el7.x86_64
--> Processing Dependency: libfontconfig.so.1()(64bit) for package: gd-2.0.35-26.el7.x86_64
--> Processing Dependency: libXpm.so.4()(64bit) for package: gd-2.0.35-26.el7.x86_64
--> Processing Dependency: libX11.so.6()(64bit) for package: gd-2.0.35-26.el7.x86_64
---> Package libxslt.x86_64 0:1.1.28-5.el7 will be installed
--> Running transaction check
---> Package fontconfig.x86_64 0:2.10.95-11.el7 will be installed
--> Processing Dependency: fontpackages-filesystem for package: fontconfig-2.10.95-11.el7.x86_64
--> Processing Dependency: font(:lang=en) for package: fontconfig-2.10.95-11.el7.x86_64
---> Package libX11.x86_64 0:1.6.5-1.el7 will be installed
--> Processing Dependency: libX11-common >= 1.6.5-1.el7 for package: libX11-1.6.5-1.el7.x86_64
--> Processing Dependency: libxcb.so.1()(64bit) for package: libX11-1.6.5-1.el7.x86_64
---> Package libXpm.x86_64 0:3.5.12-1.el7 will be installed
---> Package libjpeg-turbo.x86_64 0:1.2.90-5.el7 will be installed
---> Package libpng.x86_64 2:1.5.13-7.el7_2 will be installed
--> Running transaction check
---> Package fontpackages-filesystem.noarch 0:1.44-8.el7 will be installed
---> Package libX11-common.noarch 0:1.6.5-1.el7 will be installed
---> Package libxcb.x86_64 0:1.12-1.el7 will be installed
--> Processing Dependency: libXau.so.6()(64bit) for package: libxcb-1.12-1.el7.x86_64
---> Package lyx-fonts.noarch 0:2.2.3-1.el7 will be installed
--> Running transaction check
---> Package libXau.x86_64 0:1.0.8-2.1.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

====================================================================================================================================================================================================================================
 Package                                                              Arch                                            Version                                                   Repository                                     Size
====================================================================================================================================================================================================================================
Installing:
 nginx                                                                x86_64                                          1:1.12.2-1.el7                                            epel                                          529 k
Installing for dependencies:
 GeoIP                                                                x86_64                                          1.5.0-11.el7                                              base                                          1.1 M
 fontconfig                                                           x86_64                                          2.10.95-11.el7                                            base                                          229 k
 fontpackages-filesystem                                              noarch                                          1.44-8.el7                                                base                                          9.9 k
 gd                                                                   x86_64                                          2.0.35-26.el7                                             base                                          146 k
 gperftools-libs                                                      x86_64                                          2.4-8.el7                                                 base                                          272 k
 libX11                                                               x86_64                                          1.6.5-1.el7                                               base                                          606 k
 libX11-common                                                        noarch                                          1.6.5-1.el7                                               base                                          164 k
 libXau                                                               x86_64                                          1.0.8-2.1.el7                                             base                                           29 k
 libXpm                                                               x86_64                                          3.5.12-1.el7                                              base                                           55 k
 libjpeg-turbo                                                        x86_64                                          1.2.90-5.el7                                              base                                          134 k
 libpng                                                               x86_64                                          2:1.5.13-7.el7_2                                          base                                          213 k
 libunwind                                                            x86_64                                          2:1.2-2.el7                                               base                                           57 k
 libxcb                                                               x86_64                                          1.12-1.el7                                                base                                          211 k
 libxslt                                                              x86_64                                          1.1.28-5.el7                                              base                                          242 k
 lyx-fonts                                                            noarch                                          2.2.3-1.el7                                               epel                                          159 k
 nginx-all-modules                                                    noarch                                          1:1.12.2-1.el7                                            epel                                           16 k
 nginx-filesystem                                                     noarch                                          1:1.12.2-1.el7                                            epel                                           17 k
 nginx-mod-http-geoip                                                 x86_64                                          1:1.12.2-1.el7                                            epel                                           23 k
 nginx-mod-http-image-filter                                          x86_64                                          1:1.12.2-1.el7                                            epel                                           26 k
 nginx-mod-http-perl                                                  x86_64                                          1:1.12.2-1.el7                                            epel                                           35 k
 nginx-mod-http-xslt-filter                                           x86_64                                          1:1.12.2-1.el7                                            epel                                           25 k
 nginx-mod-mail                                                       x86_64                                          1:1.12.2-1.el7                                            epel                                           53 k
 nginx-mod-stream                                                     x86_64                                          1:1.12.2-1.el7                                            epel                                           76 k
Updating for dependencies:
 openssl                                                              x86_64                                          1:1.0.2k-8.el7                                            base                                          492 k
 openssl-libs                                                         x86_64                                          1:1.0.2k-8.el7                                            base                                          1.2 M

Transaction Summary
====================================================================================================================================================================================================================================
Install  1 Package  ( 23 Dependent packages)
Upgrade             (  2 Dependent packages)

Total download size: 6.0 M
Background downloading packages, then exiting:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
(1/26): fontpackages-filesystem-1.44-8.el7.noarch.rpm                                                                                                                                                        | 9.9 kB  00:00:00     
(2/26): fontconfig-2.10.95-11.el7.x86_64.rpm                                                                                                                                                                 | 229 kB  00:00:00     
(3/26): gd-2.0.35-26.el7.x86_64.rpm                                                                                                                                                                          | 146 kB  00:00:00     
(4/26): libX11-1.6.5-1.el7.x86_64.rpm                                                                                                                                                                        | 606 kB  00:00:00     
(5/26): libX11-common-1.6.5-1.el7.noarch.rpm                                                                                                                                                                 | 164 kB  00:00:00     
(6/26): libXau-1.0.8-2.1.el7.x86_64.rpm                                                                                                                                                                      |  29 kB  00:00:00     
(7/26): libXpm-3.5.12-1.el7.x86_64.rpm                                                                                                                                                                       |  55 kB  00:00:00     
(8/26): libjpeg-turbo-1.2.90-5.el7.x86_64.rpm                                                                                                                                                                | 134 kB  00:00:00     
(9/26): libpng-1.5.13-7.el7_2.x86_64.rpm                                                                                                                                                                     | 213 kB  00:00:00     
(10/26): libunwind-1.2-2.el7.x86_64.rpm                                                                                                                                                                      |  57 kB  00:00:00     
(11/26): libxcb-1.12-1.el7.x86_64.rpm                                                                                                                                                                        | 211 kB  00:00:00     
(12/26): libxslt-1.1.28-5.el7.x86_64.rpm                                                                                                                                                                     | 242 kB  00:00:00     
warning: /root/mypackages/lyx-fonts-2.2.3-1.el7.noarch.rpm.12470.tmp: Header V3 RSA/SHA256 Signature, key ID 352c64e5: NOKEY
Public key for lyx-fonts-2.2.3-1.el7.noarch.rpm.12470.tmp is not installed
(13/26): lyx-fonts-2.2.3-1.el7.noarch.rpm                                                                                                                                                                    | 159 kB  00:00:00     
(14/26): GeoIP-1.5.0-11.el7.x86_64.rpm                                                                                                                                                                       | 1.1 MB  00:00:01     
(15/26): nginx-filesystem-1.12.2-1.el7.noarch.rpm                                                                                                                                                            |  17 kB  00:00:00     
(16/26): nginx-mod-http-image-filter-1.12.2-1.el7.x86_64.rpm                                                                                                                                                 |  26 kB  00:00:00     
(17/26): nginx-all-modules-1.12.2-1.el7.noarch.rpm                                                                                                                                                           |  16 kB  00:00:00     
(18/26): nginx-mod-http-perl-1.12.2-1.el7.x86_64.rpm                                                                                                                                                         |  35 kB  00:00:00     
(19/26): nginx-mod-http-xslt-filter-1.12.2-1.el7.x86_64.rpm                                                                                                                                                  |  25 kB  00:00:00     
(20/26): nginx-mod-stream-1.12.2-1.el7.x86_64.rpm                                                                                                                                                            |  76 kB  00:00:00     
(21/26): nginx-mod-mail-1.12.2-1.el7.x86_64.rpm                                                                                                                                                              |  53 kB  00:00:00     
(22/26): nginx-1.12.2-1.el7.x86_64.rpm                                                                                                                                                                       | 529 kB  00:00:01     
(23/26): openssl-1.0.2k-8.el7.x86_64.rpm                                                                                                                                                                     | 492 kB  00:00:00     
(24/26): openssl-libs-1.0.2k-8.el7.x86_64.rpm                                                                                                                                                                | 1.2 MB  00:00:00     
(25/26): nginx-mod-http-geoip-1.12.2-1.el7.x86_64.rpm                                                                                                                                                        |  23 kB  00:00:01     
(26/26): gperftools-libs-2.4-8.el7.x86_64.rpm                                                                                                                                                                | 272 kB  00:00:13     
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                                                               438 kB/s | 6.0 MB  00:00:13     
exiting because "Download Only" specified

View Code

近年来去你钦定的目录地方下,你将会看到这里有下载好的软件包和信赖的软件。在自己这种状态下,作者早已把软件包下载到 /root/mypackages/ 目录下。
 
让我们来查看一下剧情:

[root@node76 ~]# ls mypackages/
fontconfig-2.10.95-11.el7.x86_64.rpm           libpng-1.5.13-7.el7_2.x86_64.rpm      libXpm-3.5.12-1.el7.x86_64.rpm             nginx-mod-http-geoip-1.12.2-1.el7.x86_64.rpm         openssl-1.0.2k-8.el7.x86_64.rpm
fontpackages-filesystem-1.44-8.el7.noarch.rpm  libunwind-1.2-2.el7.x86_64.rpm        libxslt-1.1.28-5.el7.x86_64.rpm            nginx-mod-http-image-filter-1.12.2-1.el7.x86_64.rpm  openssl-libs-1.0.2k-8.el7.x86_64.rpm
gd-2.0.35-26.el7.x86_64.rpm                    libX11-1.6.5-1.el7.x86_64.rpm         lyx-fonts-2.2.3-1.el7.noarch.rpm           nginx-mod-http-perl-1.12.2-1.el7.x86_64.rpm
GeoIP-1.5.0-11.el7.x86_64.rpm                  libX11-common-1.6.5-1.el7.noarch.rpm  nginx-1.12.2-1.el7.x86_64.rpm              nginx-mod-http-xslt-filter-1.12.2-1.el7.x86_64.rpm
gperftools-libs-2.4-8.el7.x86_64.rpm           libXau-1.0.8-2.1.el7.x86_64.rpm       nginx-all-modules-1.12.2-1.el7.noarch.rpm  nginx-mod-mail-1.12.2-1.el7.x86_64.rpm
libjpeg-turbo-1.2.90-5.el7.x86_64.rpm          libxcb-1.12-1.el7.x86_64.rpm          nginx-filesystem-1.12.2-1.el7.noarch.rpm   nginx-mod-stream-1.12.2-1.el7.x86_64.rpm

正如你在上头输出所看到的, nginx软件包已经被依附全数正视性下载实现了 。
 
请留心,那个插件适用于 yum install/yum update, 不过并不适用于 yum groupinstall。暗许情状下,那些插件将会下载旅馆中流行可用的软件包。可是你可以由此点名版本号来下载有个别特定的软件版本。

例子:

yum install --downloadonly --downloaddir=/root/mypackages/ httpd-2.2.6-40.el7

除此以外,你也足以如下叁遍性下载多少个包:

yum install --downloadonly --downloaddir=/root/mypackages/ httpd vsftpd

图片 7

主意 2 使用 "Yumdownloader"工具来下载 RPM 软件包及其具备正视包

“Yumdownloader” 是一款轻巧,然则却不行得力的命令行工具,它能够一遍性下载任何 RPM 软件包及其具备正视包。

以 root 身份运维如下命令安装 “Yumdownloader” 工具。

yum install yum-utils

万一设置达成,运转如下命令去下载八个软件包,比方 httpd:

yumdownloader httpd

为了依据全体重视性下载软件包,大家利用 --resolve 参数:

yumdownloader --resolve httpd

默许情形下,Yumdownloader 将会下载软件包到当前工作目录下。

为了将软件下载到三个一定的目录下,大家运用 --destdir 参数:

yumdownloader --resolve --destdir=/root/mypackages/ httpd

或者:

yumdownloader --resolve --destdir /root/mypackages/ httpd

顶点输出:

图片 8图片 9

Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: centos.excellmedia.net
 * epel: epel.mirror.angkasa.id
 * extras: centos.excellmedia.net
 * updates: centos.excellmedia.net
--> Running transaction check
---> Package httpd.x86_64 0:2.4.6-40.el7.centos.4 will be installed
--> Processing Dependency: httpd-tools = 2.4.6-40.el7.centos.4 for package: httpd-2.4.6-40.el7.centos.4.x86_64
--> Processing Dependency: /etc/mime.types for package: httpd-2.4.6-40.el7.centos.4.x86_64
--> Processing Dependency: libaprutil-1.so.0()(64bit) for package: httpd-2.4.6-40.el7.centos.4.x86_64
--> Processing Dependency: libapr-1.so.0()(64bit) for package: httpd-2.4.6-40.el7.centos.4.x86_64
--> Running transaction check
---> Package apr.x86_64 0:1.4.8-3.el7 will be installed
---> Package apr-util.x86_64 0:1.5.2-6.el7 will be installed
---> Package httpd-tools.x86_64 0:2.4.6-40.el7.centos.4 will be installed
---> Package mailcap.noarch 0:2.1.41-2.el7 will be installed
--> Finished Dependency Resolution
(1/5): apr-util-1.5.2-6.el7.x86_64.rpm | 92 kB 00:00:01 
(2/5): mailcap-2.1.41-2.el7.noarch.rpm | 31 kB 00:00:02 
(3/5): apr-1.4.8-3.el7.x86_64.rpm | 103 kB 00:00:02 
(4/5): httpd-tools-2.4.6-40.el7.centos.4.x86_64.rpm | 83 kB 00:00:03 
(5/5): httpd-2.4.6-40.el7.centos.4.x86_64.rpm | 2.7 MB 00:00:19

View Code

让大家承认一下软件包是还是不是被下载到我们钦点的目录下:

ll /root/mypackages/
apr-1.4.8-3.el7.x86_64.rpm
apr-util-1.5.2-6.el7.x86_64.rpm
httpd-2.4.6-40.el7.centos.4.x86_64.rpm
httpd-tools-2.4.6-40.el7.centos.4.x86_64.rpm
mailcap-2.1.41-2.el7.noarch.rpm

不像 Downloadonly 插件,Yumdownload 能够下载一组有关的软件包。

yumdownloader "@Development Tools" --resolve --destdir /root/mypackages/

 

前日自个儿尝试去创制多少个仅满含大家平日在 CentOS 7 下行使的软件的地面客栈。当然,大家得以采用 curl 只怕 wget 下载任何软件包,然则那么些命令并不可能下载须要的正视软件包。你不能够不去花一些时刻还要手动的去寻觅和下载被设置的软件研商所正视的软件包。不过,大家并不是必需这么。在那些简单的学科中,笔者将会引导你以三种办法下载软件包及其具备重视包。作者早就在 CentOS 7 下开展了测量检验,然则那几个同样的手续大概在别的依照 RPM 处理种类的发行版上也足以干活,比方 索罗德HEL,Fedora 和 Scientific Linux。

主意 1 利用 “Downloadonly” 插件下载 RPM 软件包及其全部重视包

小编们得以由此 yum 命令的 “Downloadonly” 插件下载 RPM 软件包及其全部正视包。

为了设置 Downloadonly 插件,以 root 身份运转以下命令。

yum install yum-plugin-downloadonly 

现行反革命,运维以下命令去下载二个 RPM 软件包。

yum install --downloadonly <package-name> 

私下认可意况下,这个命令将会下载并把软件包保存到 /var/cache/yum/ 的 rhel-{arch}-channel/packageslocation 目录,然则,你也足以下载和保留软件包到别的地点,你能够经过 –downloaddir选项来钦赐。

yum install --downloadonly --downloaddir=<directory> <package-name> 

例子:

yum install --downloadonly --downloaddir=/root/mypackages/ httpd 

顶点输出:

编辑:mg4377娱乐娱城官网 本文来源:CentOS系统自动下载RPM包及其具备信赖的包,包及

关键词: 系统 linux运维方面 应用 CentOS RPM