Download RPMs for all dependencies for package using yum

前端 未结 2 957
隐瞒了意图╮
隐瞒了意图╮ 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

    0 讨论(0)
  • 2021-01-13 12:45

    There's this bash script, which the maintainer of rpm has kindly shared with me, and I put on github. Hope you find it useful!

    You can also read the original SO question, where the issue was discussed.

    The script works on Fedora 23+ as it uses dnf's download plugin. It's probably very easy to make it work on Fedora 22-, as yum surely has got a similar plugin.

    Additionaly, it's valuable since repotrack does not work on fedora 23 (at least it doesn't work for me).

    0 讨论(0)
提交回复
热议问题