Re: Stop packagekitd from downloading updates

2024-01-30 Thread Michael Biebl

In case of GNOME, you might try the following

gsettings set org.gnome.software download-updates false

(gnome-software used packagekitd internally)


OpenPGP_signature.asc
Description: OpenPGP digital signature


Re: Stop packagekitd from downloading updates

2024-01-28 Thread Max Nikulin

On 29/01/2024 04:24, Greg Wooledge wrote:

On Sun, Jan 28, 2024 at 03:57:30PM -0500, Stefan Monnier wrote:

 systemctl mask packagekit


I don't think you're looking at the right thing.  "packagekit" seems
to be an interface to dbus.  By itself, it doesn't do what you think
it does.


Perhaps there are other hacks like "equivs" to formally satisfy 
dependencies.


In my point of view, dbus-daemon has no flexible ways to override 
configuration like ones available in systemd (/lib, /etc, /run). Maybe I 
did something wrong, but an attempt to hide an installed service failed. 
I tried to put a /dev/null symlink in /usr/local/share/dbus-1/services. 
So "systemctl mask" may be the only way to prevent D-Bus activated 
service start. The disadvantage is noise in logs.





Re: Stop packagekitd from downloading updates

2024-01-28 Thread Andy Smith
Hello,

On Sun, Jan 28, 2024 at 04:42:18PM -0500, Greg Wooledge wrote:
> On Sun, Jan 28, 2024 at 04:31:02PM -0500, Stefan Monnier wrote:
> > I self-inflicted this by installing [unattended-upgrades] so many years ago?
> 
> It's a dependency of some/most(?) desktop environments, I think.  I
> doubt you installed it by name and forgot.

I do not have it installed on my recently-install Debian 12 / GNOME
desktop.

I do have packagekit though, which includes this config file:

$ cat /etc/apt/apt.conf.d/20packagekit 
// THIS FILE IS USED TO INFORM PACKAGEKIT THAT THE UPDATE-INFO MIGHT HAVE 
CHANGED

// Whenever dpkg is called we might have different updates
// i.e. if an user removes a package that had an update
DPkg::Post-Invoke {
"/usr/bin/test -e 
/usr/share/dbus-1/system-services/org.freedesktop.PackageKit.service && 
/usr/bin/test -S /var/run/dbus/system_bus_socket && /usr/bin/gdbus call 
--system --dest org.freedesktop.PackageKit --object-path 
/org/freedesktop/PackageKit --timeout 4 --method 
org.freedesktop.PackageKit.StateHasChanged cache-update > /dev/null; /bin/echo 
> /dev/null";
};

// When APT's cache is updated (i.e. apt-cache update)
APT::Update::Post-Invoke-Success {
"/usr/bin/test -e 
/usr/share/dbus-1/system-services/org.freedesktop.PackageKit.service && 
/usr/bin/test -S /var/run/dbus/system_bus_socket && /usr/bin/gdbus call 
--system --dest org.freedesktop.PackageKit --object-path 
/org/freedesktop/PackageKit --timeout 4 --method 
org.freedesktop.PackageKit.StateHasChanged cache-update > /dev/null; /bin/echo 
> /dev/null";
};

So I think probably that unattended-upgrades is downloading Stefan's packages
and then poking packagekit over DBUS to make the GNOME tell Stefan about it.
Which also explains the warning when packagekit is disabled.

Thanks,
Andy

-- 
https://bitfolk.com/ -- No-nonsense VPS hosting



Re: Stop packagekitd from downloading updates

2024-01-28 Thread Stephan Seitz

Am So, Jan 28, 2024 at 16:31:02 -0500 schrieb Stefan Monnier:

the thing you don't want done.  Is "unattended-upgrades" installed by
any chance?

Hmm yep, it is!
So that's it?


Well, you can look in /var/log/unattended-upgrades/ for the log files.

„dpkg-reconfigure unattended-upgrades” will tell you if the package is 
configured to do its jobs.


Stephan

--
|If your life was a horse, you'd have to shoot it.|



Re: Stop packagekitd from downloading updates

2024-01-28 Thread Greg Wooledge
On Sun, Jan 28, 2024 at 04:31:02PM -0500, Stefan Monnier wrote:
> > There is probably some other package that's *using* packagekit to do
> > the thing you don't want done.  Is "unattended-upgrades" installed by
> > any chance?
> 
> Hmm yep, it is!
> So that's it?
> I self-inflicted this by installing this package so many years ago?

It's a dependency of some/most(?) desktop environments, I think.  I
doubt you installed it by name and forgot.



Re: Stop packagekitd from downloading updates

2024-01-28 Thread Stefan Monnier
> I don't think you're looking at the right thing.  "packagekit" seems
> to be an interface to dbus.  By itself, it doesn't do what you think
> it does.

Aha!

> There is probably some other package that's *using* packagekit to do
> the thing you don't want done.  Is "unattended-upgrades" installed by
> any chance?

Hmm yep, it is!
So that's it?
I self-inflicted this by installing this package so many years ago?
Thanks,


Stefan



Re: Stop packagekitd from downloading updates

2024-01-28 Thread Greg Wooledge
On Sun, Jan 28, 2024 at 03:57:30PM -0500, Stefan Monnier wrote:
> >> How can I stop those downloads?
> >> 
> >> Currently, I did
> >> 
> >> systemctl mask packagekit

I don't think you're looking at the right thing.  "packagekit" seems
to be an interface to dbus.  By itself, it doesn't do what you think
it does.

There is probably some other package that's *using* packagekit to do
the thing you don't want done.  Is "unattended-upgrades" installed by
any chance?



Re: Stop packagekitd from downloading updates

2024-01-28 Thread Stefan Monnier
>> How can I stop those downloads?
>> 
>> Currently, I did
>> 
>> systemctl mask packagekit
>
> Well, you might just get rid of the package.
>
> apt purge packagekit
>
> should do it.

Of course, but that also gets rid of packages I do want to keep (such as
the `gnome` metapackage).

> To prevent it from starting on the next boot:
>
> systemctl disable packagekit
>
> You may have to unmask it first.

This doesn't work:

# systemctl disable packagekit
The unit files have no installation config (WantedBy=, RequiredBy=, 
UpheldBy=,
Also=, or Alias= settings in the [Install] section, and DefaultInstance= for
template units). This means they are not meant to be enabled or disabled 
using systemctl.
 
Possible reasons for having these kinds of units are:
• A unit may be statically enabled by being symlinked from another unit's
  .wants/, .requires/, or .upholds/ directory.
• A unit's purpose may be to act as a helper for some other unit which has
  a requirement dependency on it.
• A unit may be started when needed via activation (socket, path, timer,
  D-Bus, udev, scripted systemctl call, ...).
• In case of template units, the unit is meant to be enabled with some
  instance name specified.
# 

which is why I masked it instead.  In any case, I'd rather find a way to
say precisely what I mean (i.e. "don't download updates in the
background") than to have to chase down the daemon of the day used to
perform those automatic downloads (I remember going through the same
charade a few years back, before `packagekit` existed).
Especially since I don't know what else `packagekit` might be doing
(some of it might be things I do appreciate).  Also, maybe the downloads
are not initiated by `packagekit` but by some other system (which just
happens to delegate the task to `packagekit`), and that other system may
end up deciding to do the same downloads some other way if `packagekit`
isn't available.


Stefan



Re: Stop packagekitd from downloading updates

2024-01-28 Thread Charles Curley
On Sun, 28 Jan 2024 14:10:46 -0500
Stefan Monnier  wrote:

> How can I stop those downloads?
> 
> Currently, I did
> 
> systemctl mask packagekit

Well, you might just get rid of the package.

apt purge packagekit

should do it.

Less drastic, to simply shut down the current daemon,

systemctl stop packagekit

To prevent it from starting on the next boot:

systemctl disable packagekit

You may have to unmask it first.

-- 
Does anybody read signatures any more?

https://charlescurley.com
https://charlescurley.com/blog/