Быстрый способ загрузки пакета rpm. Этот метод будет только скачивать пакет rpm, но не устанавливая его в систему.
В основном существуют два метода для загрузки пакета rpm без установки | с установкой.
шаги:
# rpm -qa|grep -i yum-plugin-downloadonly
Если дает пустой вывод, то это означает, что он не установлен, тогда установите его с помощью следующей команды.
[root@destroyer ~]# yum install yum-plugin-downloadonly Loaded plugins: product-id, security, subscription-manager Updating certificate-based repositories. server | 1.9 kB 00:00 ... Setting up Install Process Resolving Dependencies --> Running transaction check ---> Package yum-plugin-downloadonly.noarch 0:1.1.30-10.el6 will be installed --> Finished Dependency Resolution Dependencies Resolved ================================================================================ Package Arch Version Repository Size ================================================================================ Installing: yum-plugin-downloadonly noarch 1.1.30-10.el6 server 19 k Transaction Summary ================================================================================ Install 1 Package(s) Total download size: 19 k Installed size: 21 k Is this ok [y/N]: y Downloading Packages: Running rpm_check_debug Running Transaction Test Transaction Test Succeeded Running Transaction Installing : yum-plugin-downloadonly-1.1.30-10.el6.noarch 1/1 Installed products updated. Installed: yum-plugin-downloadonly.noarch 0:1.1.30-10.el6 Complete!
Примечание для RHEL 5. Используйте следующую команду:
# yum install yum-downloadonly
# yum install --downloadonly --downloaddir=<directory_location> <package name>
Допустим, вы хотите загрузить rpm пакет “vi editor” без установки, то введите команду ниже:
# yum install --downloadonly --downloaddir=/tmp/mann vi Loaded plugins: amazon-id, rhui-lb, search-disabled-repos Resolving Dependencies --> Running transaction check ---> Package vim-minimal.x86_64 2:7.4.160-1.el7 will be updated ---> Package vim-minimal.x86_64 2:7.4.160-1.el7_3.1 will be an update --> Finished Dependency Resolution Dependencies Resolved ======================================================================================================================================================================== Package Arch Version Repository Size ======================================================================================================================================================================== Updating: vim-minimal x86_64 2:7.4.160-1.el7_3.1 rhui-REGION-rhel-server-releases 436 k Transaction Summary ======================================================================================================================================================================== Upgrade 1 Package Total download size: 436 k Background downloading packages, then exiting: Delta RPMs disabled because /usr/bin/applydeltarpm not installed. vim-minimal-7.4.160-1.el7_3.1.x86_64.rpm | 436 kB 00:00:00 exiting because "Download Only" specified
Теперь, если перейти к месту /tmp/mann, вы найдете загруженный rpm пакет для “vi editor”, как показано ниже:
#cd /tmp/mann # ll total 444 -rw-r--r--. 1 root root 446692 Dec 21 04:44 vim-minimal-7.4.160-1.el7_3.1.x86_64.rpm # pwd /tmp/mann
Шаги:
[root@destroyer mann]# rpm -qa|grep yum-utils yum-utils-1.1.30-10.el6.noarch [root@destroyer mann]#
Если команда дает пустой вывод, это означает, что вы должны установить пакет yum-utils, используя команду ниже:
[root@destroyer mann]# yum install yum-utils Loaded plugins: downloadonly, product-id, security, subscription-manager Updating certificate-based repositories. Setting up Install Process Resolving Dependencies --> Running transaction check ---> Package yum-utils.noarch 0:1.1.30-10.el6 will be installed --> Finished Dependency Resolution Dependencies Resolved ======================================================================================================================================================================== Package Arch Version Repository Size ======================================================================================================================================================================== Installing: yum-utils noarch 1.1.30-10.el6 server 94 k Transaction Summary ======================================================================================================================================================================== Install 1 Package(s) Total download size: 94 k Installed size: 286 k Is this ok [y/N]: y Downloading Packages: Running rpm_check_debug Running Transaction Test Transaction Test Succeeded Running Transaction Installing : yum-utils-1.1.30-10.el6.noarch 1/1 Installed products updated. Installed: yum-utils.noarch 0:1.1.30-10.el6 Complete! [root@destroyer]#
yumdownloader <package name>
Допустим, вы хотите загрузить rpm пакет для известного редактора VI, тогда:
[root@destroyer]# pwd /root [root@destroyer]# yumdownloader vi Loaded plugins: amazon-id, rhui-lb vim-minimal-7.4.160-1.el7_3.1.x86_64.rpm | 436 kB 00:00:00 [root@destroyer]# ll total 452 -rw-------. 1 root root 7548 Mar 1 2016 anaconda-ks.cfg -rw-r--r--. 1 root root 446692 Dec 21 04:44 vim-minimal-7.4.160-1.el7_3.1.x86_64.rpm [root@destroyer]#
Эта команда загрузит rpm пакет в текущий каталог, чтобы указать каталог, в который нужно загрузить rpm пакет, вы должны использовать опцию «-destdir», как показано ниже:
[root@destroyer]# yumdownloader --destdir=/tmp/mann vi Loaded plugins: amazon-id, rhui-lb vim-minimal-7.4.160-1.el7_3.1.x86_64.rpm | 436 kB 00:00:00 [root@destroyer]# cd /tmp/mann/ [root@destroyer mann]# ll total 444 -rw-r--r--. 1 root root 446692 Dec 21 04:44 vim-minimal-7.4.160-1.el7_3.1.x86_64.rpm [root@destroyer mann]#