How to do an offline install updates using zypper

I’ve gotten some suggestions to use man zypper, and I’ve looked, but there’s a lot to look at. I haven’t tried it yet, but can I do an offline install of as many updates as possible using zypper? I see that, to do a distribution update, I have to use “zypper dup”, but many times, I just need to update offline. Could someone please tell me how he does it without always telling me to look it up in the manual?

Not 100% sure what you mean. But you can use the --download-only flag which only downloads the to be upgraded packages into /var/cache/zypp/packages. After the download you can disconnect/cut your interent connection and zypper dup will install all packages from the cache…

sudo zypper dup --download-only

sudo zypper dup

But as your description is to vague i’m not sure if this is what you want…

They’re asking if it’s possible to do “offline updates” from the CLI using zypper. i.e. The update isn’t applied to the running system, you download the packages, you reboot, and the update is done on reboot.

I have no idea if it’s possible to do, but I’m pretty sure that’s what they’re asking about.

@hui @sfalken Thanks for your responses. Yes, I’m not connected to the web all the time. I just want to download the packages, update when I’m not online. Running openSUSE on an external HDD, it’s slow, and the system is encrypted, so when they are over 3000 packages to update, it takes a while. I don’t want to sit there for hours. I find I can’t even use zypper anymore because of some error I’m getting, so I’ll see if I can use YaST to update the system instead. I was thinking even of making a drive image of my external HDD, then writing that image to my SSD after backing that up too, to speed up the updates, then write it back to HDD.

  • You can not use YaST for updating Tumbleweed, only zypper dup .
  • Even when you could, YaST > Software would do exact the same as zypper (both are user interfaces to libzypp )

I don’t want to sit there for hours.

The following works completely unattended:

  1. Downloading new packages:
karl@3400g:~> journalctl -u run-u94.service -g 'Started|Consumed'
Jun 14 16:07:40 3400g systemd[1]: Started /usr/bin/zypper --non-interactive dist-upgrade --dry-run --download-only.
Jun 14 16:26:32 3400g systemd[1]: run-u94.service: Consumed 2min 79ms CPU time.

2.Installing cached packages:

karl@3400g:~> journalctl -u run-u106.service -g 'Started|Consumed|packages'
Jun 14 16:53:14 3400g systemd[1]: Started /usr/bin/zypper --non-interactive dist-upgrade.
Jun 14 16:53:15 3400g zypper[10225]: Reading installed packages...
Jun 14 16:53:19 3400g zypper[10225]: The following 1428 packages are going to be upgraded:
Jun 14 16:53:19 3400g zypper[10225]: The following 31 NEW packages are going to be installed:
Jun 14 16:53:19 3400g zypper[10225]: The following 26 packages are going to be REMOVED:
Jun 14 16:53:19 3400g zypper[10225]: 1428 packages to upgrade, 31 new, 26 to remove.
Jun 14 17:03:55 3400g systemd[1]: run-u106.service: Consumed 7min 7.150s CPU time.

More at man systemd-run.

@hcvv @karlmistelberger
Thanks for your responses. I will try that. Right now, though, I can’t even get zypper to work. It says that it can’t find “”. When I looked on the forums, there is some code that I could enter on the command line, but it’s outdated.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.