Zypper Download directory

I’m trying to get zypper to download files to a specific directory.

The man page for zypper says there is a directory option but it doesn’t seem to be working.

zypper install -d —directory /download wine

So it doesn’t recognise —directory

I can do this

zypper install -d wine

But I’d really like to specify the folder. What am I doing wrong?

Hi, and welcome to the Forums!
AFAIK the -directory option is not an option for the “install” command you are trying to use.
As I read the man page for the “download” command I see:

download
Download rpms specified on the commandline to a local directory. + Per default packages are downloaded to the libzypp package cache (/var/cache/zypp/packages; for non-root users
$XDG_CACHE_HOME/zypp/packages), but this can be changed by using the global --pkg-cache-dir option

So maybe you may be able to accomplish what you want by issuing:

zypper download --pkg-cache-dir <dir of your choice> wine

unless I missed something, or maybe:


zypper install -d --pkg-cache-dir <dir of your choice> wine

The man pages only mentions “–directory” for downloading source rpms.

When I look in

man zypper

it only mentions --directory for the **source-download **command:

source-download
Download source rpms for all installed packages to a local directory.

-d, --directory dir
Download all source rpms to this directory. Default is /var/cache/zypper/source-download.

You do no source-download at all, you do an **install **command. That will of course first download the rpm, but then do the installation and remove the rpm.

Maybe you could explain what the idea is behind your question/problem. There is an old saying: How To Ask Questions The Smart Way .

Thanks for that :slight_smile: I’m more used to using yum, need to get a bit more familiar with zypper.

Ah yes, I didn’t notice that, I need to read man pages a bit more carefully.