I need to download .rpm files for particular packages by specifying the package name and version. Such as "libX11-188.8.131.522". 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-184.108.40.2062 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-220.127.116.112", 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?