To keep Leap proper up-to-date, indeed YaST > Online update or
zypper patch
is enough.
But if youhave more repos (like Packman, which most of us have), you have to update there with e.g. with YaST > Software Management, then from the View menu > Repositories; select Packman (example) in the list at right use Right-Click" and choose “Update if a newer version is available”. This checks the packages, Continue. Equivalent:
zypper up --repo Packman
Many do this in one step:
zypper up
which will do the step explained for Packman for all enabled repos and will include the zypper patch action.
You can enable/configure it in /etc/sysconfig/packagekit-background to have updates installed automatically.
Another option for this would be YaST->Online Update Configuration, which sets up a cron job running zypper.
If for some reason Package Kit hasn’t been installed then, you’ll either have to execute “zypper refresh” manually or, in a daily cron job.
Wrong.
zypper will refresh the repos automatically if necessary.
And even if you do have PackageKit installed, it will not periodically refresh the repos. (unless you are running some frontend/applet that does it, or you explicitly enable that cron job)
PS: you probably can install/run pk-update-icon if you want an update applet in Cinnamon.
(that’s the one XFCE uses, but it should work on any desktop that has a system tray I think)
wolfi@amiga:~/Desktop> LANG=C zypper info pk-update-icon
Loading repository data...
Reading installed packages...
Information for package pk-update-icon:
---------------------------------------
Repository : openSUSE-42.3-0
Name : pk-update-icon
Version : 2-6.2
Arch : x86_64
Vendor : openSUSE
Installed Size : 56.2 KiB
Installed : No
Status : not installed
Source package : pk-update-icon-2-6.2.src
Summary : Software Update Notifier based on PackageKit
Description :
pk-update-icon displays notifications and an icon in the tray area of the
panel
when package updates are available.
In other words, “zypper ref” only makes any sense if your repos have been refreshed less than 10 minutes ago.
But even then, it should normally not be needed, unless you encounter problems (packages not found) because the repos actually changed meanwhile.
Sure, it doesn’t harm, but it takes some time and can cause (unnecessary) network traffic…
As @Fraser_Bell (and I above) said, many simply use
zypper up
It will include zypper ref, except when it was already done (either by itself or by inclusion) in another zypper/YaST action a short time (I think 10 minutes) ago. That will save time and you would only force a new zypper ref in such a short time span if you think new software is published within that time span.
But we are now jumping into all sorts of personal preferences, where it is up to you to do what you like most.
E.g. many would like to change your suggestion into
zypper ref && zypper up
because then the second command will only run when the first finished successful.
Personal, while doing a lot with the CLI, I am a YaST fan for many things, including using YaST > Software > Online Update (the equivalent of zypper patch), because I then see short descriptions about what the security and recommended updates are for. I can then still deselect some (which I btw almost never do).
I have only one extra repo: Packman. And for that I use YaST > Software > Software Management > View > Repositories. Then select Packman and do the “Update if a newer version is available”. Again by, after that selection, clicking on Installation Summary, I can see what will be done. Gives me a feeling of being the boss.
Going back to Wolfi323’s explanation and, taking the KDE Plasma 5 case with the “plasma5-pk-updates” package installed – the KDE Software Manager (PackageKit) plasmoid:AFAICS from the package source and, from personal experience with a Laptop with WLAN, the plasmoid checks for:
isNetworkOnline
isNetworkMobile
isOnBattery
Also, I seem to remember that, the KDE plasmoid was recently modified to only check once per day (once every 86 400 seconds) for updates.
The thought is, is there a “doing things twice” conflict here between the KDE plasmoid and “zypp”?
“zypp” is checking all repositories which have “autorefresh” enabled for updates once every “repo.refresh.delay” minutes.
The KDE Software Manager plasmoid is checking for updates once a day.
[HR][/HR]I’ll be checking the Laptop’s behaviour over the next few weeks with the (zypp) “autorefresh” of all the repositories disabled.
Given that the KDE Software Manager (PackageKit) plasmoid is indicating “Last update 22 hours ago” and no updates pending, this “zypper search” output seems to be indicating that, ZYpp has found some changes in the repositories flagged with ‘autorefresh’:
> LANG=C zypper search fdhgd
Repository 'openSUSE BuildService - PHP:Applications' is out-of-date. You can run 'zypper refresh' as root to update it.
Repository 'Aktualisierungs-Repository (DEBUG)' is out-of-date. You can run 'zypper refresh' as root to update it.
Repository 'Hauptaktualisierungs-Repository' is out-of-date. You can run 'zypper refresh' as root to update it.
Repository 'openSUSE Virtualization' is out-of-date. You can run 'zypper refresh' as root to update it.
Repository 'Packman Repository' is out-of-date. You can run 'zypper refresh' as root to update it.
Loading repository data...
Reading installed packages...
No matching items found.
>
My interpretation of the comment text in /etc/zypp/zypp.conf related to “repo.refresh.delay” and the “Refresh” section of the “zypper” (8) man page is:
If, there were no zypper commands issued within the last “repo.refresh.delay” minutes then, the indexes of repositories will be checked for any changes made since the last “zypper refresh”.
If, any zypper commands are issued within “repo.refresh.delay” minutes of the last zypper command which checked the repositories for changes then, the repositories will ** NOT
** be checked again. - This behaviour also applies to “zypper update” and “zypper patch” despite the intrinsic behaviour that these two commands execute a “zypper refresh” before attempting to apply either the pending patches and/or updates.
In other words, if you apply “no” to “zypper update” and then, wait at least 10 minutes before re-executing “zypper update”, another implicit “zypper refresh” will be performed.
That has nothing to do with when the repos have been refreshed the last time.
It just means what it says, that the update applet checked for updates 22 hours ago (which of course did refresh the repos as well).
this “zypper search” output seems to be indicating that, ZYpp has found some changes in the repositories flagged with ‘autorefresh’:
Yes, and as you are running it as user, so it cannot refresh the repos.
This needs root privileges.
PackageKit can do it (if it’s not disallowed via polkit rules), as it does run as root. (but it is only started if the applet checks for updates)
Question: is this interpretation correct?
More or less, yes.
Except that it doesn’t matter whether you ran zypper commands in the last “repo.refresh.delay” minutes or not, only when the repos actually have been refreshed the last time (you could also have run YaST->Software Management e.g.).