-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
On Thu, Mar 19, 2026 at 10:45:48AM -0000, qubist wrote:
> Hi,
>
> I created the following APT hook in /etc/apt/apt.conf.d/98-myhook:
>
> APT::Update::Post-Invoke-Success {"/opt/myscript 2>/dev/null || true";};
First of all, if you want to run something after installing an update,
this is _not_ the place - it's called just after `apt-get update`, which
is only fetching metadata, but not installing anything yet.
> myscript does only:
>
> logger "hello"
>
>
> Then I ran:
>
> user@dom0:~ > qubes-vm-update --force-update --targets D13
>
> while watching the output of journalctl -f of the D13 template.
>
> Result: The "hello" shows 5 times.
>
> Then I ran 'apt-get update' directly in the D13 template.
>
> Result: The "hello" shows only 1 time (as expected).
>
>
> Why is there such discrepancy?
> Is that a bug?
There are multiple apt-get update calls intentionally. At the very
least, to refresh accurately report if all updates got installed (this
is especially relevant if some update included changes to the repository
list). I'm not sure if 5 is really needed, but given apt-get use cache
and doesn't re-fetch it nothing changed, it isn't also really a problem.
- --
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
-----BEGIN PGP SIGNATURE-----
iQEzBAEBCAAdFiEEhrpukzGPukRmQqkK24/THMrX1ywFAmm8EMAACgkQ24/THMrX
1yyHgAf7Bxj2PgoQnBRCpceBCKDEap5GiWCcm6YNKveApqdnYBltELKN9C/n7MYQ
w4sPRi2mgHRZb0m+EEyJ5/MzouFMXDnS5LayAyfP0BivyAKKdSVy0n5SaByNz+t6
Zsa7QHwr3FHMfhYY8pPgBij6GdS3FMGPfKgB1pNVQfPMP1vCtGdH0NWzn7nqK4WW
UHqsTJ18tkUFEPek6mktREYKf8QFTTs/C1CAYG7ETnPnpdVfynM5IFgx8d3D3yB5
ZxjjOllxCJ3qk/c6g8NyIXmf6zhvp5oTx1JPJpuXwPR41N7OnEpa3oCAfoaramue
fY8Ycg6D+13vzGYqQCXvObiymCW6mQ==
=Tdwi
-----END PGP SIGNATURE-----