Now I know for sure why each distro I ran eats my bandwidth extremely a lot without my permission, that’s because of PackageKit’s packagekitd daemon doing automatic updates in stealth. Not only that, but also Snappy’s snapd daemon eats my bandwidth without my permission too. Those two packagekitd and snapd are serious problems for limitedly-bandwidth users! These happened on neon, my favorite KDE distro, and also Ubuntu, Kubuntu, even openSUSE, and even Fedora. Tonight I do some searching and I finally understand packagekitd action is a part of GNOME Software or KDE Discover automatic update.
Extremely A Lot
Yes, for packagekitd & snapd case I lost 100MB of data in 2MB/s speed without my concern just by running a single neon live session for 15 minutes. This is very bad for me because my bandwidth is extremely limited.
Without My Concern
This is very bad way to treat the user, packagekitd can download huge data without permission. It should be the user who decide to download or not to, has the warning “heya, I will download 200MB of data for you” on screen, and have the clearly-seen-on-screen way to disable it. But no, I found nothing of that on all distros I ran. If I could find on screen those controls, I would be happy.
For snapd case, also nothing different. It’s also a warning for me.
For some experiments before I did always delete /usr/lib/packagekit/packagekitd by rm whenever I ran a live session or permanently installed a distro. But now by knowing this, I will always delete it on every first second I run any live session.
This one was often forgotten by me, but starting from now I need to delete /usr/lib/snapd/snapd as well whenever I run live session.
Thanks to Nethogs
apt processes the culprits (they’re packagekitd underlyings):
snapd the culprit:
Thanks to Plasma Network Monitor
Before installing nethogs, I always setup a blank panel and add a Network Monitor Usage widget on it. Tonight, I make it huge so I can notice clearly whenever any huge downloading happens.
How is packagekitd?
See the process tree below. Now it’s clear that both apt/methods/http and apt/methods/store are packagekitd’s underlyings.
How is snapd?
See the downloaded files of it at /var/cache/snapd/snaps/:
They’re growing extremely quick while snapd process is staying at my memory. See picture below. Knowing this, I need to make sure I deleted both the binary file and also the process. The rm and kill commands are the tools.
Important Files & Directories
It’s very important to know related files and directory to packagekitd and snapd bandwidth problem.
- /var/cache/PackageKit/downloads/ (huge files stored here)
- /var/cache/apt/pkgcache.bin (?)
- /var/cache/apt/srcpkgcache.bin (?)
- Important command: dpkg -L packagekit
- /var/lib/snapd/snaps/ (huge files stored here)
- Important command: dpkg -L snapd
- journalctl -a | grep -i packagekit
- journalctl -a | grep -i snapd
- my comment: ow yeah, tonight I learn one thing about systemd thanks to DigitalOcean
I Am Not Alone
Yes, many people affected by packagekitd behavior, even Fedora users. See their reports here:
- https://bugs.freedesktop.org/show_bug.cgi?id=80053 “[…]Later, I looked through Baobab and found out that /var/cache/PackageKit/metadata/updates/packages/ is eating 700 MB with 261 RPM packages[…]” by Jean-François Fortin Tam
- https://bugzilla.redhat.com/show_bug.cgi?id=1306992 “[…]PackageKit accumulate over 18GBytes of RPM packages in /var/cache/PackageKit/metadata[…]” by Yann Droneaud
- https://lists.fedoraproject.org/pipermail/users/2016-March/469464.html “[…]On my Fedora 23 systems, /var/cache/PackageKit/metadata/updates/packages is full of .rpm files. For example, 2.7G on my desktop[…]”
- https://bugs.launchpad.net/ubuntu/+source/packagekit/+bug/1249343 “[…]Also, /var/cache/apt/pkgcache.bin seems to be memmapped quite some many times[…]” by Antti Haapala
- https://bugs.launchpad.net/appcenter/+bug/1587975 “[…]srp 02 23:25:31 theOne PackageKit: refresh-cache transaction /26863_bebbecaa from uid 1000 finished with need-untrusted after 4315ms[…]” by David Heidelberg
Those links show us that their conditions are worse, meaning PackageKit downloads even greater size of files than mine.
PackageKit is an Underlying of GNOME Software
I know this fact from https://unix.stackexchange.com/questions/280015/what-does-the-process-usr-libexec-packagekitd-do. Thank you, mattdm.
So, if it’s connected to GNOME Software, hence GNOME, why does it exist on KDE distros? The answer is because it’s also an underlying of KDE Discover! I learn that both Software and Discover make use of PackageKit as an essential part of ir works.
I learn this fact by first running apt-cache rdepends packagekit. See the result:
And second, running the vice-versa command apt-cache depends plasma-discover. Correct, they’re both connected.
So, wherever there is Discover, there is PackageKit, and my bandwidth could be eaten again.
The purpose of this post is merely to warn myself about this extremely waste of bandwidth problem in neon and another distros. Now I won’t forget anymore to delete packagekitd and snapd whenever I run any live session. Please give me corrections and further references if you saw any error on this post, I’d love to learn more. And you cannot follow my decisions to delete them except at your own risk. Beware!
This article is licensed under CC BY-SA 3.0.