[improvement] no easy way to add packages required by apt before apt stage
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cloud-init |
Expired
|
Undecided
|
Unassigned |
Bug Description
I am running cloud-init on a libvirt/virsh with this image: https:/
This is not really a bug, because I believe it is rather a packaging problem of many distros. So please close this asap if you do not feel responsible ;)
This is why I also posted this problem on the debian-cloud mailing list, but maybe this can be fixed also in cloud-init.
If apt-transport-https or dirmngr are not installed (they are no dependencies of cloud-init).
apt:
sources:
docker:
source: 'deb [arch=amd64] https:/
keyserver: keyserver.
keyid: 0EBFCD88
you will run into problems like:
[ 14.011339] cloud-init[469]: E: The method driver /usr/lib/
[ 14.013524] cloud-init[469]: Cloud-init v. 0.7.9 running 'modules:config' at Wed, 23 Jan 2019 16:28:06 +0000. Up 10.01 seconds.
[ 14.016921] cloud-init[469]: 2019-01-23 16:28:10,921 - util.py[WARNING]: Running module apt-configure (<module 'cloudinit.
and
[ 14.460293] cloud-init[448]: Command: ['gpg', '--keyserver', 'keyserver.
[ 14.463206] cloud-init[448]: Stderr: gpg: failed to start the dirmngr '/usr/bin/dirmngr': No such file or directory
Unfortunatedly I could not find a way to call anything to add those packages before apt is run so that I had to patch the images.
One solution would be to allow multistage apt install in one way or the other (I know it adds complexity), so that one could install the relevant packages before the package list is modified and updated. Actually checking if a line contains https or a keyid and installing the appropriate dependencies could also work.
Probably it would be much easier to fix the package dependency on cloud-init itself for the relevant distros. The downside of this is that it adds a bunch of packages as further dependencies, so I guess distros are not really willing to do that...
Thanks in advance,
Till
PS: I can live with having written some scripts patching the images after download...
i ran in to the exact same problem. i see it the same way and believe we have to add dirmngr as package dependency for cloud-init.
i found the following mailing list for debian cloud images that discusses this issue: https:/ /bugs.debian. org/cgi- bin/bugreport. cgi?bug= 910654
the link references a merge request with more details on it: https:/ /salsa. debian. org/cloud- team/debian- cloud-images/ merge_requests/ 22
basically they will/have added gnupg has a hard dependency on dirmngr for debian buster. so most likely they will fix it in the image itself.
for older images like debian stretch and as a fallback logic i think we should adjust cloud-init to always install dirmngr before running apt configuration module.
@Scott Moser: Any idea how to achieve this?