Packing programs + dependencies into .rpm files from repos

I’m still kinda new to Linux and just learned how installing software from repositories with Yast works. However there’s one thing I would like to know as well: How can I download a repository and its dependencies that aren’t on the distro’s installation disc to an .rpm package?

For instance, lets say I want to have a pack with the program X for openSuse 11 from X’s repository. Program X however requires the dependency packets Y and Z. Y is located on my openSuse DVD while Z needs to be downloaded. In this case I would like to know how I could make a .rpm packet containing X and only dependency Z (even if this program is already installed on my system with all its dependencies).

This isn’t to distribute it or anything, I’m just one of the users who don’t feel safe unless they have all important programs and everything they need available offline as well, although I love the idea of being able to install stuff so easily from repos and all. It would help me very much if I could know how doing such a thing would be possible.

I heard zypper can do it, but I am not familiar with its console commands so I’d like to know what settings and commands must be used to download a package and its dependencies not on the install media in a single .rpm (or if that isn’t possible each as .rpms). Thanks.

Probably what you really want is to keep a copy of all the RPMs that you have downloaded. See the zypper configuration options for how to enable this.

I think I saved a note on how to do that somewhere. Problem is I already installed some repos but didn’t save the packages, and I’d like to download them now just to save them offline as well. Any way that could be done (re-downloading already installed software + non-media dependencies without reinstalling the programs)?

Can’t think of one off the top of my head, never did that, but I’m sure there is some way to use zypper to work out which RPMs satisfy the dependencies. Once you have the package names the download is straightforward.

Problem I’m worried about is making the difference between dependencies which have to be downloaded and dependencies located on the installation DVD of that distro. Then what command can be used to simply download a repo to a .rpm instead of installing it, I’m still not familiar with these.

It doesn’t matter. You only have to keep the latest version of a package (from an official repo, and the DVD counts as a repo). At the time the DVD is released, it’s a snapshot of the official repo. As updates get released various packages on the DVD fall out of date.

Capturing packages may give you a feeling that you have everything local but unless it can be done simply and automatically by enabling caching in zypper, I feel that it’s not worth the hassle. If my disks died and I couldn’t rescue anything of the system files I would just reinstall from the DVD and let it update from the online repo. Naturally I have my personal files backed up.

Of course there are situations where it’s warranted to seriously cache, like when bandwidth is limited, you are on an island with narrowband connections to the world, or you have a lot of installs to keep up to date and you don’t want to do multiple fetches. Perhaps a local mirror might be worth setting up, in such situations.

I keep backup DVDs around the house and have many partitions so crashing wouldn’t be a problem for me I think. And yeah dependencies get updated as well I guess. I would still like to know how deps can be downloaded with software packages just to be sure though, even if it’s all deps of the latest version for that distro. Like does zypper have a ‘zypper -download -dependencies-too rep-url-here’ command or something similar?

I don’t know to be honest, I haven’t looked.