1

I have SUSE Linux Enterprise Server 12 SP5 and RPM which should be installed offline. How to download all dependencies of RPM to transfer them to offline machine with same OS?

I've tried downloading a desired .rpm, then install it on the SUSE 12 machine (not connected to Internet), it then asks for another package... And the cycle repeats, it seems to be endless and reached my desperation level.

Note that I'm not too familiar with RPM-based distros (well, I was, back 22 years ago), more with DEB-based distros.

(same question as https://stackoverflow.com/questions/68208874/how-to-download-all-dependencies-of-rpm-to-offline-instalation , hopefully this will be a better place to ask)

Addendum: I'm now trying to launch a docker image with a Suse, and then to install the desired packages from within that container (I hope to be able to catch the downloaded rpm's and copy them onto the offline machine). Note that I'm running on a Devuan (Debian-based, without systemd) distro.

Pierre
  • 111

1 Answers1

0

Not a SUSE expert either, but I needed to do exactly that and the way I found to do it based partly on the answer to the question on stackoverflow mentioned in the question here:

First start a blank SUSE docker with your SUSE version (SLE15 for me) on a system connected to the internet, with a volume mount to be able to save the downloaded package outside afterwards. Then inside this docker, install the package with the --download-only flag to zypper, which will save the rpm and it's dependencies in the zypper cache folder. Then go to the zypper cache and create an archive of the repository folder where the package was downloaded from (SLE_BCI for me, not sure if the name depends on SUSE version/setup).

docker run --rm -v ~/SUSEMount:/linked -it registry.suse.com/suse/sle15:latest bash
zypper install --download-only <package>
cd /var/cache/zypp/packages/
tar czvf /linked/local-repo.tar.gz SLE_BCI

Copy the tar file to the offline machine, where you untar it in a place of your choice. Then add the folder as a repo to zypper and finally install the package using zypper as normally:

cd ~
tar xzvf local-repo.tar.gz
zypper ar SLE_BCI Local_File_Repo
zypper install <package>