Yes you can. I do this all the time!
I need to do this at home because I am on usage based billing (UBB) that only allows so much bandwidth before I start getting charged.
You can copy the rpm files to a USB and then copy those onto the target machine.
But you need to configure zypper to do this first!
Example:
Say I have a fresh new machine that I just installed openSUSE on that doesn’t have any updates (because during the initial install I told it not to automatically update). Now I need to go get updates.
But before I do my first update/patch I need to tell zypper to cache the packages that it is going to download.
I’m more familiar with the command line so I’ll explain how this happens there.
Open up a terminal.
Type
zypper lr
That should output a list of your repositories and some status info.
You should enable caching on the repos that have the Enabled flag set to “yes” - you can see this near the right of the output of the above command.
Instead of typing in the full repo name, you can use the repo number on the far left or the alias for this.
The base repos that should have caching turned on are: openSUSE-12.2-Oss, openSUSE-12.2-Non-Oss, openSUSE-12.2-Update, openSUSE-12.2-Update-Non-Oss
Those four repos in my zypper lr
list are numbers 11, 12, 15, and 16. They will definitely be different for yours so change as needed!
Also include any other repos you want cached besides just the base openSUSE ones (basically any repos with *yes *under Enabled)
So I could then issue the zypper command, as root:
su -
zypper mr -k 11 12 15 16
The -k flag tells zypper to modify repos (mr) and store the files on disk when they are downloaded instead of temporarily.
You can see more info from issuing:
zypper help mr
So now when I run
zypper patch
or
zypper up
all the files it downloads are saved in the /var/cache/zypp/packages folder.
So this step has to happen on the machine that is connected to the internet - or what I call the “hot machine” because it’s the only one with internet access or allowed to download packages for openSUSE.
I like to take that **packages **folder and place it into a tar file so that the user permissions are kept and not lost when copying directly to a USB that might not be formatted in ext4 or whatever.
So to tar them, as the root user if you aren’t already:
su -
tar cvpf /mnt/pathtousb/packages.tar /var/cache/zypp/packages
The above is done as the root user because the files in the packages folder are owned by the user and group root.
Now on the cold machine (one that can’t download openSUSE updates/patches) extract the tar file to the /var/cache/zypp folder and tell it to extract only files that don’t already exist there:
su -
tar xkvf packages.tar /var/cache/zypp/
Then once those are copied, you can run *zypper patch *or zypper up and it won’t re-download any files it doesn’t have to.
This works well on machines with identical setups (ie, same software) and architecture (ie, 64bit to 64bit).
Later on you may want to do this again so just plug that usb with the packages.tar file into the hot machine and run a zypper patch or zypper up again to let it download and install the latest packages.
But the tar command has a slight difference, you can simply update the tar file:
su -
tar upvf /mnt/pathtousb/packages.tar /var/cache/zypp/packages
And that *should *grab only the new rpms.
Now it’s safe, on even the hot machine to remove those old files if you find they are starting to eat up disk space with a zypper clean. Type zypper help clean for more options there.
That’s about it, I know it’s a long write up, but it’s a short procedure once you get use to it.
One thing I also do at home is share that packages folder directly over the LAN via Samba or NFS then let the other machines mount it to their systems or configure the zypper configuration directly to change the default packages path to the network path. This way no tar’ing or copying from and to the usb is needed at all.