Admins please advise if quoting exactly with due credit to the author and author's name is not ok from copyright point of view. If need be will redact or improve the write up as needed. Thanks in advance.
This post is slightly different, it applies to for those who DO NOT want any automated APT process running like my self. The below solution will DISABLE packakekit and also disable the associated error.
My original tinkering was try
sudo systemctl stop packagekit.service
then run,
sudo systemctl disable packagekit.service
this will fail, as the service is 'static' type. Those of systemd SME can chime in.
so went ahead and did run,
sudo systemctl mask packagekit.service
the masking executes successfully. But when you run apt update it will put out a DBus error.
So tinkered with and tried renaming the file /etc/apt/apt.conf.d/20packagekit to say something like /etc/apt/apt.conf.d/20packagekit_Original.conf
Comment out all code lines in the _Original.conf file.
However, the solution provided by Mr. George Shuklin on https://medium.com post: How to disable packagekit more proper in my opinion. As it bakes in with future updates and reverting much easy.
So presenting the solution intrspersed with the post author's quotes and my 'one' additional step of backing up the original apt.conf.d file.
sudo cp -v /etc/apt/apt.conf.d/20packagekit{,_Original_.conf}
and comenting out all the code lines in the newly created 20packagekit_Original_.conf file with prefixing //
[BEGIN STEPS]
- Step 1. Make a backup of the file
Create a backup copy of the original distribution provided apt.conf.d file, will come in handy if we want to reverse our steps to restore to distribution default
sudo cp -v /etc/apt/apt.conf.d/20packagekit{,_Original_.conf}
open the just created Original.conf file
sudo nano /etc/apt/apt.conf.d/20packagekit_Original_.conf
Prefix each code line with //. So this file is your backup should things don't work for you and want to walk back your steps. This is my innovation to the author's post.
The backedup Original.conf file should have code lines like below commented prefixed //:
//DPkg::Post-Invoke {
- Step 2. Disable the service.
Stop systemd packagetkit.service
sudo systemctl stop packagekit.service
Mask the systemd packagekit.service
sudo systemctl mask packagekit.service
OR together in one line
sudo systemctl stop packagekit.service && sudo systemctl mask packagekit.service
In my tinkering I performed upto the above but without the author suggested next step in addition, which in my opinion is the most important. Not having performed the Step 3 had left me with the DBus error. This DBus erro is put out everytime I executed apt update or apt-get update.
So strongly suggest performing the following dpkg-divert step Step 3 per post's author Mr. George Shuklin
- Step 3. Disable apt integration
Run the following dpkg-divert command as root
sudo dpkg-divert --divert /etc/PackageKit/20packagekit.distrib --rename /etc/apt/apt.conf.d/20packagekit
the above dpkg-divert will fix / remove the said DBus error upon execution of apt update or apt-get update:
Error: GDBus.Error:org.freedesktop.systemd1.UnitMasked: Unit packagekit.service is masked.
[END STEPS]
On closing, to quote the author George Shuklin's very justified lament:
"That’s all. It's sad that I need to fight the distro authors…"
There's little direction out there onpackagekitdisabling so posting this here and wiki as I hope this will help others with similar predicament as mine, also for folks who would like to perform APT related stuff manually and non-automated on an as needed basis.
Mine is a Debian Testing/Unstable"Sid" mix - "TUM" type of setup with Debian.sourcesfile setup to tracktestingin a rolling way.