Some .deb
packages, as Google SW, for example, install PGP keys and add their own software repository during installation.
Question: How can I prevent .deb packages from installing PGP keys and update the sources list?
Unfortunately there is no generic way to prevent packages from installing keys or adding repositories.
If the packages ship the corresponding files in their target locations, you can exclude them by adding
path-exclude=/etc/apt/sources.list.d/*
path-exclude=/etc/apt/trusted.gpg.d/*
but the second line above will also disable key updates from distribution packages.
This won’t work at all with packages such as Google’s, since they install their keys and repositories from the packages’ maintainer scripts. In Google’s case, the packages even install a cronjob to take care of things (although as far as I can tell, it will avoid restoring a repository if the administrator deletes it).
firejail
with a different profile when additional restrictions are needed? Isn't it possible to create different profiles e.g. for Synaptic, which is used for installations from the official repositories, and e.g. fordpkg
, which is used for third-party packages? – Trudy May 10 '21 at 06:54dpkg
behind the scenes... – Stephen Kitt May 10 '21 at 07:02/etc/apt
, their installation will fail at the configuration stage; if you don’t do anything to complete the installation at that point, the next time a packaging operation needs to configure anything, the configuration of the failed Google packages will run again, under the profile that’s active at that point. – Stephen Kitt May 10 '21 at 07:11/etc/apt
that will get deleted afterwards. – Trudy May 10 '21 at 07:19