The first question/easiest answer is: Why is your mirror misbehaving / Fix your mirror.
You can pass apt options to cloud-init via apt_configure module https://cloudinit.readthedocs.io/en/latest/topics/modules.html#apt-configure The apt flag that you're requesting (--allow-releaseinfo-change) says that it is applied via config in apt_preferences(5) configuration item: Acquire::AllowReleaseInfoChange. Cloud-init does not have configuration syntax to modify apt_preferences(5). Unfortunately it does not look like you can configure this in apt.conf.d. write_files could be used to write a file into /etc/apt/preferences.d/ with the desired configuration. https://cloudinit.readthedocs.io/en/latest/topics/modules.html#write-files So, if you can convince MAAS to send cloud-config with something like the following, then you'd be good. #cloud-config write_files: - path: /etc/apt/preferences.d/your.conf content: | Acquire::AllowReleaseInfoChange = yes In order to accomplish this, you need either: a.) support in maas for generic user-supplied cloud-config to enlistment environment where you could just use write_files. b.) specific support in maas for 'apt-preferences' configuration to the enlistment environment and also changes to cloud-init to expose 'apt-preferences' configuration. Both of these require some change in MAAS (or just answering "here is how you do 'a'" above. ** Also affects: maas Importance: Undecided Status: New ** Summary changed: - Unable to set Apt config parameter during maas-enlisting-node phase + Unable to set apt_preferences(5) parameter during maas-enlisting-node phase -- You received this bug notification because you are a member of Yahoo! Engineering Team, which is subscribed to cloud-init. https://bugs.launchpad.net/bugs/1857468 Title: Unable to set apt_preferences(5) parameter during maas-enlisting-node phase Status in cloud-init: New Status in MAAS: New Bug description: During the maas-enlisting-node phase, cloud init tries to run an 'apt- get update' and it fails because of an error as given below: 2019-12-18T06:08:39+00:00 maas-enlisting-node cloud-init[2655]: Get:4 http://<repo_name>/ubuntu bionic-security InRelease [10.1 kB] 2019-12-18T06:08:39+00:00 maas-enlisting-node cloud-init[2655]: Err:5 http://<repo_name>/ubuntu bionic-backports Release 2019-12-18T06:08:39+00:00 maas-enlisting-node cloud-init[2655]: 404 Not Found [IP: 32.68.226.74 80] 2019-12-18T06:08:40+00:00 maas-enlisting-node cloud-init[2655]: Reading package lists... 2019-12-18T06:08:40+00:00 maas-enlisting-node cloud-init[2655]: E: The repository 'http://<repo_name>/ubuntu bionic-backports Release' does not have a Release file. 2019-12-18T06:08:40+00:00 maas-enlisting-node cloud-init[2655]: E: Repository 'http://<repo_name>/ubuntu bionic InRelease' changed its 'Label' value from 'Ubuntu' to 'ubuntu bionic' 2019-12-18T06:08:40+00:00 maas-enlisting-node cloud-init[2655]: E: Repository 'http://<repo_name>/ubuntu bionic-updates InRelease' changed its 'Label' value from 'Ubuntu' to 'ubuntu bionic-updates' 2019-12-18T06:08:40+00:00 maas-enlisting-node cloud-init[2655]: E: Repository 'http://<repo_name>/ubuntu bionic-updates InRelease' changed its 'Codename' value from 'bionic' to 'bionic-updates' 2019-12-18T06:08:40+00:00 maas-enlisting-node cloud-init[2655]: E: Repository 'http://<repo_name>/ubuntu bionic-security InRelease' changed its 'Label' value from 'Ubuntu' to 'ubuntu bionic-security' 2019-12-18T06:08:40+00:00 maas-enlisting-node cloud-init[2655]: E: Repository 'http://<repo_name>/ubuntu bionic-security InRelease' changed its 'Codename' value from 'bionic' to 'bionic-security' apt has an option to to ignore this error by providing a parameter -"--allow-releaseinfo-change", however I am unable to set this parameter in maas. Is there a place in the code or in the cloud init phase where we can set this option to avoid the above error? If not then would it make sense to add such functionality? To manage notifications about this bug go to: https://bugs.launchpad.net/cloud-init/+bug/1857468/+subscriptions -- Mailing list: https://launchpad.net/~yahoo-eng-team Post to : yahoo-eng-team@lists.launchpad.net Unsubscribe : https://launchpad.net/~yahoo-eng-team More help : https://help.launchpad.net/ListHelp