Thank you for the detailed clarification and the solution to solve this. I changed my script to use your solution and it works fine now. I attached the test script if someone is interested in it.Again be warned the script runs "apt update", "apt install" and modifies/removes apt related system files (root is needed).
My intention is to copy the (not so) local repository to a USB stick and bring it this way to the devices (pgp keys and configurations are already pre deployed on the machines).
Best regards yogg
Attachment:
apt_bugtest_solved.tgz
Description: application/compressed-tar