canonical / canonical/cloud-init
apt sources changes ignored while installing the packages
- Dominant language
- Python
- Stars
- 3.8k
- Forks
- 1.1k
- Avg merge
- 2d 23h
- Merged PRs (30d)
- 18
Description
# Bug report
I'm trying to install docker (almost as per official instructions)
But after adding the docker repo, `package_update` seems to ignore the changes to repos config and installing packages like `docker-ce-cli` results in:
> [ 147.431858] cloud-init[1634]: E: Package 'docker-ce' has no installation candidate
[ 147.432992] cloud-init[1634]: E: Package 'docker-ce-cli' has no installation candidate
[ 147.434112] cloud-init[1634]: E: Unable to locate package containerd.io
[ 147.435036] cloud-init[1634]: E: Couldn't find any package by glob 'containerd.io'
[ 147.435991] cloud-init[1634]: E: Couldn't find any package by regex 'containerd.io'
[ 147.437051] cloud-init[1634]: E: Unable to locate package docker-buildx-plugin
[ 147.437987] cloud-init[1634]: E: Unable to locate package docker-compose-plugin
Logging in to the machine and installing the packages works fine (the repo is added correctly)
I found almost the same issue on [severfault](https://serverfault.com/questions/1149524/cloud-init-isnt-adding-apt-sources-before-apt-update-is-executed) that has never been resolved. Is this a bug? Is there any known workaround?
## Steps to reproduce the problem
1. Set up the cloud-config so it will add the docker repo to sources list and install packages after
2. Pass it to Ubuntu image
3. Check the logs
## Environment details
- Cloud-init version: 23.3.1-0ubuntu2
- Operating System Distribution: Ubuntu 24.04.1 LTS
- Cloud provider, platform or installer type: Yandex Cloud
## cloud-init logs
[cloud-init.tar.gz](https://github.com/user-attachments/files/17017562/cloud-init.tar.gz)
Contributor guide
Assessment
This issue has not been assessed yet.