gnome-software / packagekitd 100% CPU usage at startup
Software versions:
- Ubuntu 18.04.1 LTS (updated from 16.04, and older versions)
- packagekit 1.1.9-1ubuntu2.18.04.3 amd64
- gnome-software 3.28.1-0ubuntu4.18.04.4 amd64
On my system, at startup the packagekitd
process stay at 100% CPU usage on one core for around one minute.
Using pkmon
, I can see there is around 60 requests done during this time :
get-updates, resolve, search-file, resolve, search-file ... (x55)
Each search-file
request is taking around one second and maxing out one CPU core.
Setting packagekitd
to verbose I can see this type of requests :
...
packagekitd[3913]: 19:46:45#011PackageKit#011SearchFiles method called: 4, /usr/share/applications/unity-lens-photos.desktop
packagekitd[3913]: 19:46:46#011PackageKit#011SearchFiles method called: 4, /usr/share/applications/designer-qt5.desktop
packagekitd[3913]: 19:46:47#011PackageKit#011SearchFiles method called: 4, /usr/share/applications/thunderbird.desktop
...
So it seems it is searching packages for some of the file in /usr/share/applications/
When settings gnome-software
to verbose I get the following logs for thunderbird
:
20:51:24:0178 As adding existing file: /usr/share/applications/thunderbird.desktop
20:51:27:0009 Gs autogenerating unique-id for thunderbird.desktop
20:51:27:0009 As run 0x55b956f3dc50~appstream::refine-app{system/*/*/desktop/thunderbird.desktop/*}
20:51:27:0009 As run 0x55b956f3dc50~appstream::refine-addons{system/*/*/desktop/thunderbird.desktop/*}
20:51:27:0071 Gs nothing adopted system/*/*/desktop/thunderbird.desktop/*
20:51:27:0091 As run 0x55b956f3dc50~appstream::refine-from-id{system/*/*/desktop/thunderbird.desktop/*}
20:51:27:0091 Gs searching appstream for system/*/*/desktop/thunderbird.desktop/*
20:51:27:0091 As run 0x55b956f3dc50~appstream::refine-app{system/*/*/desktop/thunderbird.desktop/*}
20:51:27:0091 As run 0x55b956f3dc50~appstream::refine-addons{system/*/*/desktop/thunderbird.desktop/*}
20:52:26:0904 Gs emitting waiting(thunderbird.desktop)
20:52:26:0914 Gs emitting setup(thunderbird.desktop)
20:52:27:0648 Gs emitting querying(thunderbird.desktop)
20:52:27:0653 GsPluginPackageKit Failed to find one package for thunderbird.desktop, /usr/share/applications/thunderbird.desktop, [0]
20:52:29:0286 Gs app invalid as state unknown system/*/*/desktop/thunderbird.desktop/*
thunderbird
is installed from official Ubuntu repository.
So I think there is 2 sub-optimal things here:
-
packagekitd
search-file
is slow (may be caused by its backend?) -
gnome-software
may be doing too much work. Any idea why some packages get this kind of treatment?