46

I usually run the Software Updater when I switch on my desktop each morning. Very often I sit and wait while it displays this message:

waiting for packagekitd to exit

And looks like this:

enter image description here

I've done some websearching on this, and in spite of a couple mentions on Unix.SE, I haven't succeeded in finding out what "packagekitd" is, why I "wait" for it so often (can be a matter of minutes, not seconds), and whether I can avoid this somehow. My goal is to prevent packagekitd from hijacking my updating process.

Help appreciated! I'm running plain Ubuntu 18.04 LTS.

Dɑvïd
  • 1,936
  • 4
  • 24
  • 53

1 Answers1

58

PackageKit is a system made to use the distribution's software installation and update tools easier. You can read more about it here: https://www.freedesktop.org/software/PackageKit/pk-intro.html

You can stop packagekitd with the command:

systemctl stop packagekit

If, for some reason, you wish to disable it, you can use:

systemctl disable packagekit

Update for Ubuntu 22+ — the name of the service has changed to packagekit.service (thanks to rob74 for mentioning this).

Dɑvïd
  • 1,936
  • 4
  • 24
  • 53
DocWeird
  • 870
  • 4
    Or if you really want to get rid of it, "sudo apt-get -s purge packagekit". Check for dependencies, but in my case, they were non-consequential. My final go used "sudo apt-get purge packagekit appstream apt-config-icons" to remove the extra cruft. – dave58 Jun 20 '20 at 21:31
  • solution I am looking for is to simply delay the launch of packagekit until a few minutes after a reboot not almost immediately ... either as a parameter or by inserting a wrapper to replace its launch which just sleeps for 10 minutes before launching packagekit – Scott Stensland Feb 01 '22 at 15:40
  • @scott-stensland- You could put that stop command in crontab (@reboot) and then another "@reboot sleep 600 && systemctl start package" after that. – DocWeird Feb 02 '22 at 22:15
  • there is no such systemctl service on my system, but I could kill it with sudo fuser -vik -TERM /var/lib/dpkg/lock /var/lib/dpkg/lock-frontend /var/lib/apt/lists/lock – rubo77 Nov 27 '22 at 22:19
  • 3
    Didn't work for me, until I noticed that on my system (Ubuntu 22.04) it's called "packagekit.service". Not sure if this is because of the newer Ubuntu version, but anyway, systemctl stop packagekit.service did the job... – rob74 Feb 07 '23 at 07:37
  • 1
    Yes, the service name has had an ".service" added to it in later versions of Ubuntu, which was not the case back when the answer was written in 2018. I'll amend the answer to reflect this. – DocWeird Feb 08 '23 at 09:04
  • 1
    @dave58 what do you think about these dependencies? "packagekit packagekit-tools software-properties-common ubuntu-server". The last one seems quite important so I just stopped the service. – Valerio Bozz Jul 20 '23 at 07:05
  • @valerio-bozz : Yes, 'ubuntu-server' is a meta-package for your server/system. Removing it would probably result in dire consequences... Ditto for 'properties-common' – dave58 Jul 22 '23 at 15:48
  • 2
    @valerio-bozz : [Continued - stupid StackExchange 'limits'... ] I have found that by adding an explicit '+' to the package name, you can 'force' a package install for these critical 'dependencies. Try a sudo apt-get --simulate purge packagekit software-properties-common+ ubuntu-server+ and see what it results in. Note the '+' after software-properties-common and ubuntu-server. This will cause them to (be flagged as installs even though the apt-get command is 'purge' or 'remove' ' Once you are happy with the results, remove the '--simulate' ( or '-s' ) from the apt-get command. – dave58 Jul 22 '23 at 16:05