If you want to install programs in a template from the graphical package manager Software, we need to follow a few steps to circumvent a bug in that program. Tested on Debian 12 and Fedora 38.
- run a terminal in your template
/rw/config/rc.localto add the snippet below at the end of the file
ip route add default via 127.0.0.1
- stop the template
Now, if you start Software in the template, it will be able to download and install packages
This seems to be a “bug” of GNOME Software, it won’t trigger the package installation if it can’t find a default route. The hack here is to create a fake route that goes nowhere on the loopback interface.
Packages are downloaded through the proxy exactly like when using the command line. The template is not connected to the internet, nothing changed except we added a false route that can’t go anywhere.