zoukankan      html  css  js  c++  java
  • Download RPM packages from a YUM repo without installing

    This how-to will explain how to download rpm packages from a yum repository without installing them. This will work on Redhat Enterprise Linux 5.x, Fedora and CentOS 5.x. 

    You need to install yum plugin called yum-downloadonly. This plugin adds a --downloadonly flag to yum so that yum can download the packages without installing/updating them. Following options supported by this plugin:

    • --downloadonly : don't update, just download a rpm file to default yum cache directory/var/cache/yum/.
    • --downloaddir=/path/to/dir : specifies an alternate directory to store packages such as /tmp

    Install the yum-downloadonly plugin:

    Type the following command to install plugin, enter:

            # yum install yum-downloadonly

    Now for downloading rpm packages from an already configured yum repository use the following command:

          # yum update httpd -y --downloadonly
    By default package will by downloaded and stored in /var/cache/yum/ directory. But, you can specifies an alternate directory to store packages such as /opt, enter:

          # yum update httpd -y --downloadonly --downloaddir=/opt


    Method 2: yum-utils.noarch Package

    Downloading rpm packages from a yum repository can be accomplished by the below described method also!!!

    yum-utils is a collection of utilities and examples for the yum package manager. It includes utilities by different authors that make yum easier and more powerful to use. These tools include: debuginfo-install, package-cleanup, repoclosure, repodiff, repo-graph, repomanage, repoquery, repo-rss, reposync, repotrack, verifytree, yum-builddep, yum-complete-transaction, yumdownloader, yum-debug-dump and yum-groups-manager.

         # yum -y install yum-utils.noarch

    Now use the yumdownloader command which is a program for downloading RPMs from Yum repositories. Type the following command to download httpd rpm file:

         # yumdownloader httpd

    Sample output:

    Loaded plugins: rhnplugin
    httpd-2.2.3-31.el5_4.2.x86_64.rpm       1.2 MB 00:00

  • 相关阅读:
    高效程序猿的45个习惯:敏捷开发修炼之道之主题建议翻译1-10
    VS2010旗舰版安装图解
    ibatis 使用 in 查询的几种XML写法
    人脸识别算法初次了解
    键盘过滤驱动
    python property属性
    癞子麻将胡牌算法实现
    恩布900手机客服,安卓版本号Entboost Android 1.0 正式公布
    C语言递归实现二叉树的先序、中序、后序遍历
    CSS:CSS 属性 选择器
  • 原文地址:https://www.cnblogs.com/oskb/p/3772135.html
Copyright © 2011-2022 走看看