Change how often packagekit runs - currently every 10 minutes.

From journalctl - I see packagekit running every 10 minutes.
When I attempt a zypper up or zypper dup (tumbleweed), I get

Ask PackageKit to quit? [yes/no] (no): no
System management is locked by the application with pid 17101 (/usr/lib/packagekitd).
Close this application before trying again.

which is annoying.
How can I get packagekit to only run once an hour instead of 6 times an hour.
I know it has to be started with packagekitd but no man page for packagekitd

VM1:/etc/systemd # man packagekitd
No manual entry for packagekitd
VM1:/etc/systemd # man packagekit
No manual entry for packagekit
VM1:/etc/systemd # 

Anyone know where - I see this as excessive bandwidth and rather wasteful as few if any of us look to see if an update is ready that often.

Remove PackageKit?

Hi
That’s what I do :wink: and plymouth…

I see no real connection between the two, except they they both are annoyances lol!

I want to keep them to see when an update occurs. I have Intel and ARM machines which do not always update at the same time.

I guess I could add a cron a job to chmod them to 000 for 45 minutes and another to change them back for 15 minutes. That would give me 45 minutes to update without the thing stepping on my updates.

When you think you can not live without it, the look for a systemd timer job that does this. That is a modern equivalent of cron, but I assume that it isn’t started from one of the standard system crontab directories anymore.

As you will have understood now, I don not have it installed and thus can not do the search. Maybe YaST > Software > Software Management, search for packagekit, select at right and use the Files tab below to see if there is something for systemd.

But why not simply update once a week at system maintenance time. Personaly I feel no need to have such an irritating applet in my GUI environment (when I use the system as “normal” user), let alone that I will pester my other users which such an alert they can not do anything about.

systemd knows best:

**erlangen:~ #** systemctl list-unit-files package* 
UNIT FILE                         STATE   VENDOR PRESET
packagekit-background.service     static  -            
packagekit-offline-update.service static  -            
packagekit.service                static  -            
packagekit-background.timer       **enabled ****disabled     **

4 unit files listed. 
**erlangen:~ #**

Disable the timer by running “systemctl disable --now packagekit-background.timer”. Report back.

Hi larryr,

From journalctl - I see packagekit running every 10 minutes.

FWIW, I don’t see it every 10 minutes. I have searched a little and found the systemd description file (not sure if that’s the correct term):

/usr/lib/systemd/system/packagekit-background.timer

[Unit]
Description=Systemd timer to update the system daily with PackageKit

[Timer]
OnCalendar=daily
AccuracySec=12h
Persistent=true
Unit=packagekit-background.service

[Install]
WantedBy=timers.target


I’m not totally sure if that’s the file that is really in action. I have traced it by some other file in /etc/systemd/system/ that is just a link to somewhere in /usr/lib/systemd/system/. However, if you like to keep the function of packagekit as a reminder you may check that file or search for the relevant copy in your system. I just have the setting “OnCalendar=daily” which seems to be working. If you find any setting that indicates a 10 min interval then change it.

If unsure what is going on show the pertaining journal lines:

**erlangen:~ #** journalctl -b -o short-monotonic -g packagekit 
    3.375639] erlangen systemd[1]: Started Systemd timer to update the system daily with PackageKit. 
 3474.726573] erlangen systemd[1]: Started Script to update the system with PackageKit. 
 3475.745342] erlangen dbus-daemon[751]: [system] Activating via systemd: service name='org.freedesktop.PackageKit' unit='packagekit.service' requested by ':1.224' (uid=0 pid=13427 comm="pkcon --background --noninteractive --plain get-up") 
 3475.746848] erlangen systemd[1]: Starting PackageKit Daemon... 
 3475.772847] erlangen dbus-daemon[751]: [system] Successfully activated service 'org.freedesktop.PackageKit' 
 3475.772968] erlangen systemd[1]: Started PackageKit Daemon. 
 3480.743828] erlangen systemd[1]: packagekit-background.service: Deactivated successfully. 
 3501.037408] erlangen systemd[1]: packagekit.service: Deactivated successfully. 
 3501.038473] erlangen systemd[1]: packagekit.service: Consumed 4.734s CPU time. 
**erlangen:~ #**

I have found this which has useful stuff on timers:
https://wiki.archlinux.org/title/Systemd/Timers#:~:text=Timers%20are%20systemd%20unit%20files,%23As%20a%20cron%20replacement).

However:

Cumulus:/etc # systemctl list-timers --allNEXT                        LEFT                LAST                        PASSED     UNIT                         ACTIVATES                     
Thu 2022-03-03 10:00:00 GMT 47min left          Thu 2022-03-03 09:00:01 GMT 12min ago  snapper-timeline.timer       snapper-timeline.service      
Thu 2022-03-03 13:46:19 GMT 4h 33min left       Wed 2022-03-02 13:46:19 GMT 19h ago    snapper-cleanup.timer        snapper-cleanup.service       
Thu 2022-03-03 13:50:53 GMT 4h 38min left       Wed 2022-03-02 13:50:53 GMT 19h ago    systemd-tmpfiles-clean.timer systemd-tmpfiles-clean.service
Fri 2022-03-04 00:00:00 GMT 14h left            Thu 2022-03-03 00:00:01 GMT 9h ago     logrotate.timer              logrotate.service             
Fri 2022-03-04 00:00:00 GMT 14h left            Thu 2022-03-03 00:00:01 GMT 9h ago     mandb.timer                  mandb.service                 
Fri 2022-03-04 01:00:39 GMT 15h left            Thu 2022-03-03 00:32:19 GMT 8h ago     backup-sysconfig.timer       backup-sysconfig.service      
Fri 2022-03-04 01:12:16 GMT 15h left            Thu 2022-03-03 00:19:48 GMT 8h ago     check-battery.timer          check-battery.service         
Fri 2022-03-04 01:15:43 GMT 16h left            Thu 2022-03-03 01:40:01 GMT 7h ago     backup-rpmdb.timer           backup-rpmdb.service          
Mon 2022-03-07 00:00:00 GMT 3 days left         Tue 2022-03-01 00:00:01 GMT 2 days ago btrfs-balance.timer          btrfs-balance.service         
Mon 2022-03-07 00:00:00 GMT 3 days left         Tue 2022-03-01 00:00:01 GMT 2 days ago btrfs-trim.timer             btrfs-trim.service            
Mon 2022-03-07 01:02:00 GMT 3 days left         Mon 2022-02-28 00:58:50 GMT 3 days ago fstrim.timer                 fstrim.service                
Fri 2022-04-01 00:00:00 BST 4 weeks 0 days left Tue 2022-03-01 00:00:01 GMT 2 days ago btrfs-scrub.timer            btrfs-scrub.service           


12 timers listed.

Similarly:

Cumulus:/etc # systemctl status packagekit-background.timer ● packagekit-background.timer - Systemd timer to update the system daily with PackageKit
     Loaded: loaded (/usr/lib/systemd/system/packagekit-background.timer; disabled; vendor preset: disabled)
     Active: inactive (dead)
    Trigger: n/a
   Triggers: ● packagekit-background.service
Cumulus:/etc # 

So there appears to be no PackageKit timer active. However PackageKit is active on my system and I do get notifications about once or twice a day. Love to know how?

The amount of misinformation about PackageKit is amazing.

Packagekit is server that is started on request of client. One such client is pkcon which could be started by cron/timer/systemd service. But most clients are desktop environment programs that run as part of user session. KDE update applet, GNOME Software application, pk-update-icon/package-update-indicator used e.g. by default in Xfce environment on openSUSE and likely more. Each of those applications has own configuration how often it will poll packagekit for updates.

Here is a partial from journalctl -b

Mar 04 06:29:41 VM1 dbus-daemon[889]: [system] Activating via systemd: service name='org.freedesktop.PackageKit' unit='packagekit.service' requested by ':1.130' (uid=1000 pid=1805 comm="/usr/lib/softupd_applet ")
Mar 04 06:29:41 VM1 systemd[1]: Starting PackageKit Daemon...
Mar 04 06:29:41 VM1 PackageKit[18293]: daemon start
Mar 04 06:29:41 VM1 dbus-daemon[889]: [system] Successfully activated service 'org.freedesktop.PackageKit'
Mar 04 06:29:41 VM1 systemd[1]: Started PackageKit Daemon.
Mar 04 06:29:55 VM1 PackageKit[18293]: get-updates transaction /1_acaaecaa from uid 1000 finished with success after 13822ms
Mar 04 06:30:11 VM1 PackageKit[18293]: daemon quit
Mar 04 06:39:41 VM1 dbus-daemon[889]: [system] Activating via systemd: service name='org.freedesktop.PackageKit' unit='packagekit.service' requested by ':1.130' (uid=1000 pid=1805 comm="/usr/lib/softupd_applet ")
Mar 04 06:39:41 VM1 systemd[1]: Starting PackageKit Daemon...
Mar 04 06:39:41 VM1 PackageKit[19125]: daemon start
Mar 04 06:39:41 VM1 dbus-daemon[889]: [system] Successfully activated service 'org.freedesktop.PackageKit'
Mar 04 06:39:41 VM1 systemd[1]: Started PackageKit Daemon.
Mar 04 06:39:55 VM1 PackageKit[19125]: get-updates transaction /1_ccedcacc from uid 1000 finished with success after 13683ms
Mar 04 06:40:11 VM1 PackageKit[19125]: daemon quit
Mar 04 06:49:41 VM1 dbus-daemon[889]: [system] Activating via systemd: service name='org.freedesktop.PackageKit' unit='packagekit.service' requested by ':1.130' (uid=1000 pid=1805 comm="/usr/lib/softupd_applet ")
Mar 04 06:49:41 VM1 systemd[1]: Starting PackageKit Daemon...
Mar 04 06:49:41 VM1 PackageKit[19957]: daemon start
Mar 04 06:49:41 VM1 dbus-daemon[889]: [system] Successfully activated service 'org.freedesktop.PackageKit'
Mar 04 06:49:41 VM1 systemd[1]: Started PackageKit Daemon.
Mar 04 06:49:55 VM1 PackageKit[19957]: get-updates transaction /1_bbcdaeac from uid 1000 finished with success after 13813ms
Mar 04 06:50:11 VM1 PackageKit[19957]: daemon quit
Mar 04 06:59:41 VM1 dbus-daemon[889]: [system] Activating via systemd: service name='org.freedesktop.PackageKit' unit='packagekit.service' requested by ':1.130' (uid=1000 pid=1805 comm="/usr/lib/softupd_applet ")
Mar 04 06:59:41 VM1 systemd[1]: Starting PackageKit Daemon...
Mar 04 06:59:41 VM1 PackageKit[20743]: daemon start
Mar 04 06:59:41 VM1 dbus-daemon[889]: [system] Successfully activated service 'org.freedesktop.PackageKit'
Mar 04 06:59:41 VM1 systemd[1]: Started PackageKit Daemon.
Mar 04 06:59:54 VM1 PackageKit[20743]: get-updates transaction /1_cedbdace from uid 1000 finished with success after 13648ms
Mar 04 07:00:11 VM1 PackageKit[20743]: daemon quit
Mar 04 07:09:41 VM1 dbus-daemon[889]: [system] Activating via systemd: service name='org.freedesktop.PackageKit' unit='packagekit.service' requested by ':1.130' (uid=1000 pid=1805 comm="/usr/lib/softupd_applet ")
Mar 04 07:09:41 VM1 systemd[1]: Starting PackageKit Daemon...
Mar 04 07:09:41 VM1 PackageKit[21570]: daemon start
Mar 04 07:09:41 VM1 dbus-daemon[889]: [system] Successfully activated service 'org.freedesktop.PackageKit'
Mar 04 07:09:41 VM1 systemd[1]: Started PackageKit Daemon.
Mar 04 07:09:55 VM1 PackageKit[21570]: get-updates transaction /1_eadcecbc from uid 1000 finished with success after 14577ms
Mar 04 07:10:16 VM1 PackageKit[21570]: daemon quit
Mar 04 07:19:41 VM1 dbus-daemon[889]: [system] Activating via systemd: service name='org.freedesktop.PackageKit' unit='packagekit.service' requested by ':1.130' (uid=1000 pid=1805 comm="/usr/lib/softupd_applet ")
Mar 04 07:19:41 VM1 systemd[1]: Starting PackageKit Daemon...
Mar 04 07:19:41 VM1 PackageKit[23635]: daemon start
Mar 04 07:19:41 VM1 dbus-daemon[889]: [system] Successfully activated service 'org.freedesktop.PackageKit'
Mar 04 07:19:41 VM1 systemd[1]: Started PackageKit Daemon.
Mar 04 07:19:58 VM1 PackageKit[23635]: get-updates transaction /1_cecadedd from uid 1000 finished with success after 17456ms
Mar 04 07:20:16 VM1 PackageKit[23635]: daemon quit
Mar 04 07:29:41 VM1 dbus-daemon[889]: [system] Activating via systemd: service name='org.freedesktop.PackageKit' unit='packagekit.service' requested by ':1.130' (uid=1000 pid=1805 comm="/usr/lib/softupd_applet ")
Mar 04 07:29:41 VM1 systemd[1]: Starting PackageKit Daemon...
Mar 04 07:29:41 VM1 PackageKit[25149]: daemon start
Mar 04 07:29:41 VM1 dbus-daemon[889]: [system] Successfully activated service 'org.freedesktop.PackageKit'
Mar 04 07:29:41 VM1 systemd[1]: Started PackageKit Daemon.
Mar 04 07:30:05 VM1 PackageKit[25149]: get-updates transaction /1_cdabccba from uid 1000 finished with success after 23606ms
Mar 04 07:30:21 VM1 PackageKit[25149]: daemon quit
Mar 04 07:39:41 VM1 dbus-daemon[889]: [system] Activating via systemd: service name='org.freedesktop.PackageKit' unit='packagekit.service' requested by ':1.130' (uid=1000 pid=1805 comm="/usr/lib/softupd_applet ")
Mar 04 07:39:41 VM1 systemd[1]: Starting PackageKit Daemon...
Mar 04 07:39:41 VM1 PackageKit[26149]: daemon start
Mar 04 07:39:41 VM1 dbus-daemon[889]: [system] Successfully activated service 'org.freedesktop.PackageKit'
Mar 04 07:39:41 VM1 systemd[1]: Started PackageKit Daemon.
Mar 04 07:39:57 VM1 PackageKit[26149]: get-updates transaction /1_ceebeadd from uid 1000 finished with success after 16081ms
Mar 04 07:40:16 VM1 PackageKit[26149]: daemon quit
Mar 04 07:49:41 VM1 dbus-daemon[889]: [system] Activating via systemd: service name='org.freedesktop.PackageKit' unit='packagekit.service' requested by ':1.130' (uid=1000 pid=1805 comm="/usr/lib/softupd_applet ")
Mar 04 07:49:41 VM1 systemd[1]: Starting PackageKit Daemon...
Mar 04 07:49:41 VM1 PackageKit[27356]: daemon start
Mar 04 07:49:41 VM1 dbus-daemon[889]: [system] Successfully activated service 'org.freedesktop.PackageKit'
Mar 04 07:49:41 VM1 systemd[1]: Started PackageKit Daemon.
Mar 04 07:49:57 VM1 PackageKit[27356]: get-updates transaction /1_ababaddd from uid 1000 finished with success after 15780ms
Mar 04 07:50:16 VM1 PackageKit[27356]: daemon quit

From last post - journalctl says pid 1805 started the request - here is what 1805 is

VM1:~ # dpgrp 1805
UID        PID  PPID  C STIME TTY          TIME CMD
root         1     0  0 Feb19 ?        00:15:26 /usr/lib/systemd/systemd --system --deserialize 87
llrainey  1533     1  0 Feb19 ?        00:01:02 /usr/lib/systemd/systemd --user
llrainey  1805  1533  0 Feb19 ?        00:01:17 /usr/lib/softupd_applet
VM1:~ # 

Hi
That’s a MATE DE feature provided by mate-applet-softupd.

@larryr,

Re-read what @avidjaar said. It is the desktop applet that starts the action. Thus configure the applet (on whatever DE you run).

No such app any more.

VM1:~ # whereis mate-applet-softupd
mate-applet-softupd:
VM1:~ # cnf mate-applet-softupd
 mate-applet-softupd: command not found                                    
VM1:~ # 

I have devised a work around - I will do a cron job to chmod 000 /usr/lib/packagekitd for 40 minutes each hour and chmod it back to 755 for 20 minutes each hour. It is so sad to have to redneck engineer a fix.

Hi
It’s not a user executable, hence being down in the lib directory, it’s triggered by a service. Run dconf-editor (or gsettings) to check the settings for the org.freedesktop.PackageKit schema , likely can disable there…

My fix works for 15.3 as follows

PC118:~ # crontab -l
48 * * * * /bin/bash -c "/usr/bin/chmod 755 /usr/lib/packagekitd 1>/tmp/packagekit.log 2>&1"
0 * * * * /bin/bash -c "/usr/bin/chmod 000 /usr/lib/packagekitd 1>/tmp/packagekit.log 2>&1"
PC118:~ # 

for Tumbleweed with this cron entries

PC120:~ # crontab -l
48 * * * * /bin/bash -c "/usr/bin/chmod 755 /usr/libexec/packagekitd 1>/tmp/packagekit.log 2>&1"
0 * * * * /bin/bash -c "/usr/bin/chmod 000 /usr/libexec/packagekitd 1>/tmp/packagekit.log 2>&1"
PC120:~ # 

This has worked all afternoon - one attempt each hour.

Not so fast:

**i3-4130:~ #** zypper if mate-applet-softupd 
Loading repository data... 
Reading installed packages... 


Information for package mate-applet-softupd: 
-------------------------------------------- 
Repository     : Haupt-Repository (OSS) 
Name           : mate-applet-softupd 
Version        : 0.4.8-1.5 
Arch           : x86_64 
Vendor         : openSUSE 
Installed Size : 54.3 KiB 
Installed      : Yes (automatically) 
Status         : up-to-date 
Source package : mate-applet-softupd-0.4.8-1.5.src 
Upstream URL   : http://zavedil.com/mate-software-updates-applet 
Summary        : MATE panel applet for software update notifications 
Description    :  
    This is a MATE panel applet to notify when software updates are 
    available. 

    The notification is displayed in two ways: 
      1) by changing the icon of the applet. 
      2) by sending a notification to the notification-daemon. 

    The information is obtained from PackageKit. 

**i3-4130:~ #**

Remove package mate-applet-softupd, disable the redneck engineering fix and see what happens.