Download RPM for all package dependencies using yum

I am trying to create a local yum repository on my system containing various packages, mainly the base CentOS repositories. The server hosting the yum repository will not necessarily have the same basic packages installed by default as the servers that will use the yum repository. For this reason, I need to ensure that my repositories contain the packages I want and each of their dependencies.

I create my repositories using the yumdownloader tool provided in the yum-utils package to try to load the RPM file for the package using yum from standard CentOS mirrors. Usefully, it provides a command line parameter, --resolve, which also loads dependencies. However, since it is built on yum itself, yumdownloader will only load dependencies for packages that are not already present on the system.

For example, I want to download package A, which depends on packages B, C and D. If package D is already installed on the system, it yumdownloader --resolve Awill download only A, B and C, but not D.

Is there a way to download RPM for all package dependencies from yum repository?

+4
source share
2 answers

bash script, rpm , github. , !

SO, .

script Fedora 23+, dnf download. , Fedora 22, yum .

, , repotrack Fedora 23 ( , ).

0

, , script, repotrace wget. , yumdownloader ( ) .

, , URL- "repotrack -u flag", , , rpm .

#!/bin/bash

while read i; do
    repotrack -u $i >> dep_rpm_urls_02.txt
done < list_of_packages_01.txt


awk '!seen[$0]++' dep_rpm_urls_02.txt > dep_rpm_urls_clean_03.txt

while read j; do
    wget $j
    echo dowloaded $j
done < dep_rpm_urls_clean_03.txt

happy rpming

0

All Articles