Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I need help writing a zypper command that will download, but not install, every package currently installed in the system and save those RPMs to a local directory.
There must be a way to do it. I can't figure it out.
Going forward it is easy to configure zypper to keep downloaded packages. Downloaded packages are temporarily cached in /var/cache/zypp/packages, before being installed. If you want to keep them it is necessary to edit each .repo on /etc/zypp/repos.d and set
I need help writing a zypper command that will download, but not install, every package currently installed in the system and save those RPMs to a local directory.
Going back to your original request, you should be able to capture the rpm list in a text file and write a small script to download all the packages from that list.
I'm beginning to think that zypper can't do what I want. Think of it this way: Say I want a private repository on my local drive that consists ONLY of EVERY RPM installed on that machine. I don't want to install anything. I just want to download and save all those RPMs, perhaps over a thousand of them. I want a zypper command that, upon completion, produces a local directory that contains all those RPMs from a variety of repos. (the repo of origin for installed packages is known to zypper)
Another way to think of it:
I want to query for the package names of every installed package, then download them all to a local directory, from whatever repo they came from, and without ever installing or reinstalling anything.
Zypper can query the system and produce a list of all installed packages. But I can't get zypper to use that query output to determine what to download with "zypper in --download-only". I can provide qualifiers like xyz* and it will download and save matching RPMs. Instead of xyz*, there seems to be no way to tell zypper "all packages currently installed". There is no option for that and I can't figure out any alternative method.
Going forward it is easy to configure zypper to keep downloaded packages. Downloaded packages are temporarily cached in /var/cache/zypp/packages, before being installed. If you want to keep them it is necessary to edit each .repo on /etc/zypp/repos.d and set
Code:
keeppackages=1
But I think this will only capture updates and new packages after the original install.
What I'm looking to do was possible in Gnome long before zypper.
Zypper can query the system and produce a list of all installed packages. But I can't get zypper to use that query output to determine what to download with "zypper in --download-only". I can provide qualifiers like xyz* and it will download and save matching RPMs. Instead of xyz*, there seems to be no way to tell zypper "all packages currently installed". There is no option for that and I can't figure out any alternative method.
It can be done in a couple of steps which is acceptable (or you can roll it up into a simple script).
I think --dry-run is only "dry" with respect to actual installation. It seems to mean nothing to --download-only. The files come in.
I haven't used the --dry-run option in a long time. I guess if the -download-only option is invoked the -dry-run option is irrelevant anyway.
Code:
-D, --dry-run
Test the installation, do not actually install any package. This option will add the --test
option to the rpm commands run by the install command.
Download-and-install mode options:
-d, --download-only
Only download the packages for later installation.
--download-in-advance
First download all packages, then start installing.
--download-in-heaps
(Not yet implemented, currently the same as --download-in-advance). Download a minimal set
of packages that can be installed without leaving the system in broken state, and install
them. Then download and install another heap until all are installed. This helps to keep the
system in consistent state without the need to download all package in advance, which com-
bines the advantages of --download-in-advance and --download-as-needed. This is the default
mode.
--download-as-needed
Download one package, install it immediately, and continue with the rest until all are
installed.
--download <mode>
Use the specified download-and-install mode. Available modes are: only, in-advance, in-
heaps, as-needed. See corresponding --download-<mode> options for their description.
I guess this is solved now? If so, mark it as such.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.