7

I have a local repo that has some rpms in it. The repo xmls etc are up to date.

When I find an rpm I don't have, I want to be able to download it, not install it obviously, and put that rpm into the repo dir.

I see I can use zypper install --download-only <packagename> but this seems to only work when I haven't got the package installed on my box, else it says 'already' installed. It also doesn't allow me to state the version/edition/rev of the package I want.

This is no good to me.

How can I get a rpm from my active repositories and store it to a specified location? I don't mind installing a new tool if zypper aint the way to go.

3 Answers 3

5

Search the repositories and see the details (all versions and architectures, repositories) - example for python-base:

zypper search --details  python-base

Download the specified version of the RPM package without installing. Package can be already installed and it won't be changed.

zypper -v install -f --download-only 'python-base=2.6.0'

Find the downloaded RPM file:

find /var/cache/zypp/packages/ -name 'python-base*'
0
2

zypper install -f should do a reinstall.

Try that "-f" in your command.

1
  • What about the req to install a specific rev of package?
    – Fearghal
    Commented Jan 24, 2015 at 23:24
1

Control where to download the rpm package and not download other recommended packages:

zypper --pkg-cache-dir /tmp install --force --download-only --no-recommends 'qemu=4.2.1-lp152.9.6.1'

You must log in to answer this question.

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