0

I need to download .rpm files for particular packages by specifying the package name and version. Such as "libX11-1.5.99.902". I've been looking online to find a way to query & download .rpms which match that but haven't found anything so far. Ideally, if multiple files match (like multiple architectures) it will download each variant. But that isn't a requirement.

I've tried using yumdownloader but that only takes a name, no version information. This article showing how to use the rpm Python module looked promising until I realized that it only gives you back currently installed packages, not any list of downloadable packages. So lastly I tried using the dnf Python API. There's even a script example for it(!). But its results appear to not be what I need. For example I need a .rpm for libX11-1.5.99.902 their script example returned back different architecture variants for libX11-1.6.7, which is coincidentally what I already have installed so I'm not 100% sure if that is querying from online or not.

I've tried terminal based methods but things like yum --showduplicates search all libX11 does not show past versions. And in my case, I'm looking to download a past minor version of libX11.

Just to reiterate, I need to take a string like "libX11-1.5.99", "libX11-1.5.99.902", or similar and query + download that as list of RPMs on-disk (RPMs for all architectures / variants available for that version, ideally).

How can I do this?

1 Answer 1

0

Actually yumdownloader does the job exactly as you want it:

[root@299571442fbc /]# yumdownloader libX11-1.6.7 
Loaded plugins: fastestmirror, ovl, versionlock
Loading mirror speeds from cached hostfile
 * base: mirror.reconn.ru
 * centos-sclo-rh: mirror.reconn.ru
 * centos-sclo-sclo: mirror.reconn.ru
 * extras: mirror.sale-dedic.com
 * updates: mirror.sale-dedic.com
(1/2): libX11-1.6.7-4.el7_9.i686.rpm                                                                                                   | 611 kB  00:00:00     
(2/2): libX11-1.6.7-4.el7_9.x86_64.rpm                                                                                                 | 607 kB  00:00:00     

Indeed, this will download the latest available. Why you can't get libX11-1.5.99 version is because it is not present in any repository.

2
  • So the reason why it isn't available is just a "repository missing" issue, not a "incompatible version" issue? How do I populate yumdownloader with past versions? Commented Feb 23, 2022 at 15:15
  • No. The reason is “your desired package version is not present in any repository”. If there’s no such package you can’t install it. Unless you find such a repository where it’s present. Commented Feb 23, 2022 at 15:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .