Use DNF to download a specific version of a package

Hi,

I want to use DNF to download a previous version of a package. Let’s say I’m looking for the previous version of the kmod-sky2 package in the ELRepo repository.

$ dnf --showduplicates list kmod-sky2
...
kmod-sky2.x86_64   1.30-5.el8_4.elrepo    elrepo
kmod-sky2.x86_64   1.30-6.el8_6.elrepo    elrepo
kmod-sky2.x86_64   1.30-7.el8_7.elrepo    elrepo
kmod-sky2.x86_64   1.30-8.el8_7.elrepo    elrepo

If I want to download the latest RPM of kmod-sky2, I can use the following command (as normal user):

$ dnf download kmod-sky2
...
kmod-sky2-1.30-8.el8_7.elrepo.x86_64.rpm     83 kB/s |  53 kB     00:00    
$ ls
kmod-sky2-1.30-8.el8_7.elrepo.x86_64.rpm

Now here’s my question. How can I tell DNF to download the previous version (e. g. 1.30-7) of this package? I can’t seem to find the syntax for this, and the problem with man dnf is not the lack of information, quite the opposite.

Cheers,

Niki

You simply put the full nevra.

# dnf download kernel-4.18.0-425.3.1.el8.x86_64
Last metadata expiration check: 0:07:32 ago on Sat 04 Feb 2023 02:33:37 AM MST.
kernel-4.18.0-425.3.1.el8.x86_64.rpm                                                                                            4.3 MB/s | 8.8 MB     00:02
2 Likes

Thank you very much !