I'm currently working in a command line only environment.

I would like to perform daily updates automatically using zypper, however I can't find a good way to do it. By good I mean clean and simple.

Is it safe to execute sudo zypper update daily using cron? I was told that this isn't always a good way to do it.

Are there other ways I could make package updates through zypper completely automatic?


In case anyone comes by here still looking for a "more integrated" solution several years later, you can currently do this in a terminal:

sudo zypper install yast2-online-update-configuration
sudo yast2 online_update_configuration

Then you enable automatic online update, and select the frequency (daily, weekly, or monthly). You can also optionally decide whether or not to automatically accept licenses (99% of people just hit "yes" anyway), whether or not to auto-install extra recommended packages as a result of upgrades, and whether or not the smaller delta RPMs are ok.

What that actually does is link a script (/usr/lib/YaST2/bin/online_update) into the relevant /etc/cron.{daily,weekly,monthly} directory and then edit a config file the script reads. But it's a bit easier than making your own cron job. And the script makes it easier to support some convenient options, like limiting updates to specific categories, etc.

Also, in case delta RPMs are a new thing to the reader:

Delta RPM packages contain the difference between an old and a new version of an RPM package. Applying a delta RPM onto an old RPM results in a completely new RPM. It is not necessary to have a copy of the old RPM because a delta RPM can also work with an installed RPM. The delta RPM packages are even smaller in size than patch RPMs, which is an advantage when transferring update packages over the Internet. The drawback is that update operations with delta RPMs involved consume considerably more CPU cycles than plain or patch RPMs.


(I solved this a while ago, just forgot to post an answer)

I ended up creating a cron job which runs everyday at 3am (my computer stays on 24/7) and invokes an update script.

The script contains only a couple lines and basically refreshes the repositories (zypper ref) and then installs all available updates (zypper up). It has worked for me for the past few months.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.