Download RPMs for all dependencies for package using yum

前端 未结 2 989
隐瞒了意图╮
隐瞒了意图╮ 2021-01-13 11:54

I\'m attempting to create a local yum repo on my system containing various packages from, chiefly, the CentOS base repos. The server which is hosting the yum repo will not

2条回答
  •  半阙折子戏
    2021-01-13 12:28

    After a lot of frustration looking around for a solution I have written a simple script that uses repotrace and wget. I've found that yumdownloader (even with the resolve flag) does not resolve all dependencies.

    if you have a long list of packages you are bound to run into duplicates, downloading just the urls first with the "repotrack -u flag" and then getting unique records resolves having to download the same rpm multiple times.

    #!/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

提交回复
热议问题