Automatic updates not working

I have been trying to get my system (openSUSE Leap 42.1) to update silently with no luck. I find the automatic updates applet in KDE to be annoying, so I have disabled it from the system tray settings. I also have the “Automatic Online Update” in YaST enabled and set to update daily and configured to skip interactive patches and agree with licenses.

However, the automatic updates is not working. A couple of weeks after turning off the applet, I turned it back on just to make sure that the system has been updating as expected, however, I was surprised to find numerous updates waiting to be installed. I also reviewed the package installation history in “/var/log/zypp/history”, and found that no package updates happened in that period of time.

I have tried turning the automatic updates off and then back on, and repeating the experiment for another week, but I got the same results. No updates happen, and the KDE updates applet shows a lot of updates that need to be installed.

What could be the problem? And how can I diagnose it or verify that it got fixed?

It might be worthy to note that I am using my system as a desktop, and I tend to turn on the PC as soon as I wake up, and turn it off when I go to sleep. So, it gets a decent amount of powered on time, but it is shutdown daily.

it depends on the repo’s you have, it’s probobly a dependency issue that requires your attention, the default is if something is not sure don’t do it unless the user agrees, it happens to me now and then when using the plasma applet
so run

zypper up

Pretty sure the online update configures the desktop widget / apper. So removing it is counter productive. Setting in SystemSettings - Apper Software Management

There are just some things that require a users attention

It does not seem like I am having a problem with dependencies. I ran “zypper up” and there is nothing problematic. It seems to me like the update command is simply not running.

Updating using the Plasma Applet seems to work well.

Could someone confirm or deny this? And if this is true, what is the best way to get silent updates? I really find the desktop applet quite annoying, with sound and pop-ups distracting the user, and it happens quite frequently. The openSUSE team seems to release updates multiple times per day (which is awesome, except for the annoying pop-ups).

I set mine for once a week rather then everyday though it does run at each login. Try the setting where I pointed you to Configure Desktop -Appr Software press the wrench to get to appr settings. Some updates require a reboot ie kernel and some other X related packages. Also some require manual accepting of license.

This is wrong.
YaST’s Online Update Configuration does not configure any desktop applets, it wouldn’t even be able to as it runs as root…

Actually it should set up a cron job that runs “zypper up” regularly.

I have no idea whether it works in 42.1 (the last time I used it was years ago).
One thing could be that daily cron jobs are configured to run at a time when your computer is off.
Have a look at /etc/sysconfig/cron and try to set DAILY_TIME to a time when your computer is usually running, maybe that helps.

The openSUSE team seems to release updates multiple times per day (which is awesome, except for the annoying pop-ups).

Actually this is a bug in the applet in 42.1, it actually checks for updates every hour regardless of the settings (mainly because PackageKit is configured in openSUSE to shut itself down after 15 seconds to not block YaST/zypper).

Will be fixed in 42.2, maybe an update for 42.1 will be released as well.

There is no Apper in Leap, and that config module doesn’t exist either.

Right click on the icon in the system tray and select “Software Updater Settings” instead.

I didn’t have the apper application, although I did have the plasma5-pk-updates. Anyhow, I have installed apper and configured it. Is this an updater that is independent from what I had?

Yes, this is what I expected. A cron job. Anyhow, I looked inside /etc/sysconfig/cron (which I didn’t modify), and found this:

## Type:         string
## Default:      ""
#
# At which time cron.daily should start. Default is 15 minutes after booting
# the system. Example setting would be "14:00".
# Due to the fact that cron script runs only every 15 minutes,
# it will only run on xx:00, xx:15, xx:30, xx:45, not at the accurate time
# you set.
DAILY_TIME=""

Which means that the update should run 15 minutes after booting the system. Or am I mistaken?

I also found a script named: “/etc/cron.daily/opensuse.org-online_update”, which I assume is the one that runs the cron job.

Yes and no.

Those are independent “applications” (plasma5-pk-updates is no applications, just a Plasma applet).
But both are only frontends to PackageKit.

Oh, and as Apper is a KDE4 application, it’s update applet will not work in Plasma5.
It does include a background service as well though, which should notify you of updates via a popup notification in the system tray.
I’m not sure at the moment whether this works in Plasma5, as it is a kded(4) module.

Yes, should, or maybe did years ago.
I’m not sure that this still works that way nowadays (I don’t know, but I do notice that the daily cron jobs run at the same time every day here on 13.2 even though that setting is empty, so 15 minutes after boot is definitely not true, except maybe the first time after a fresh installation).

Anyway, just try to set it explicitly, this should definitly work.
You can always revert your change again… :wink:

I also found a script named: “/etc/cron.daily/opensuse.org-online_update”, which I assume is the one that runs the cron job.

Yes.

Alright, thank you wolfi323 for the information.

I have set the daily time to “19:00” which is a time the PC is almost always powered on, and I will check if the updates work.

Thanks again, and I will report my findings within a couple of days.

Just one thing that just struck my mind, please check that cron.service is enabled:

systemctl status cron

If cron is not running, it won’t be starting the cron jobs either, of course… :wink:

Alright, I am still facing the same problem, however, I have discovered a little more about the nature of the problem.

1- The cron job is working as expected.
2- The update command is the problem as it seems that the update command updates makes very few actual updates.

Look at this log file in /var/log/zypp/history:

2016-11-08 19:01:01|command|root@zaidpc|‘/usr/bin/zypper’ ‘–non-interactive’ ‘–quiet’ ‘patch’ ‘–skip-interactive’ ‘–auto-agree-with-licenses’ ‘–recommends’|
2016-11-08 19:01:01|install|bind-libs|9.9.9P1-42.1|x86_64||repo-update|4cbff927c96be44e2fe91d59c2fb08c0a784ad88e8935ee8a8163c4a1f08dfe5|
2016-11-08 19:01:01|install|bind-utils|9.9.9P1-42.1|x86_64||repo-update|89b65c4ac980c604353ee2a7a9d65faf89ab12d36ed4151ff2a47cdc939132ae|

From the log file above, it looks like the update command did run at the expected time of 19:00, which means that the cron job is working as expected. However, only two packages were installed: “bind-libs” and “bind-utils”.

So, to double check this theory, I ran the following command:

sudo zypper --non-interactive --quiet patch --skip-interactive --auto-agree-with-licenses --recommends

And immediately after the command completed (btw, it didn’t find any updates), I checked the available updates through the plasma update tool, and it found 25 pending updates.

Could someone explain why this behavior is happening? And how to make the update job update everything?

Well, “zypper patch” only installs official updates (“patches”) from the Update repo (like YaST->Online Update), while “zypper up” and the update applet check for updated packages in all configured repos.

Unfortunately I see no option in YaST->Online Update Configuration to switch to using “zypper up” here in 13.2 (I’m pretty sure it was possible years ago), but you could of course just change the cronjob file accordingly.

Another option would be to use the PackageKit cronjob which can be configured in /etc/sysconfig/packagekit-background (there’s no GUI for that other then YaST->/etc/sysconfig Editor).
This uses PackageKit for its job, and should behave similar as the other PackageKit frontends (e.g. apper and plasma5-pk-updates).

Thank you wolfi323, you have been extremely helpful and knowledgeable.

I have modified the /etc/cron.daily/opensuse.org-online_update file, by modifying it as instructed:

zcmd=“${zyppercmd} --non-interactive --quiet patch”

Changed to:

zcmd=“${zyppercmd} --non-interactive --quiet update”

I have also tested and verified that modifying the configuration in YaST does not overwrite the file.

So this seems like a resolved issue. I will follow up if I find any difficulties or issues.

The actual configuration is stored in /etc/sysconfig/automatic_online_update, which is read by the cron job.

And YaST only creates /etc/cron.(daily|weekly|monthly)/opensuse.org-online_update if it doesn’t exist already.

Thank you for the precise information. This helped me better understand how YaST works.