charmcraft pack fails for apt-utils is not available
Metadata
Current evaluation
Closed as an environment conflict: Docker altered iptables and blocked LXD networking, preventing apt-utils installation.
Resolution: closed not a bug
Reason: The reporter confirmed that uninstalling Docker restored packing. Maintainer facundobatista explained that Docker's iptables changes blocked LXD internet access and suggested setting the host FORWARD policy to ACCEPT.
Evaluated by: mr-cal-bot
No scores available.
Issue body
```shell
> $ charmcraft pack
LXD is required, but not installed. Do you wish to install LXD and configure it with the defaults? [y/N]: y
[sudo] password for tux:
lxd 4.17 from Canonical✓ installed
Packing charm 'alertmanager-k8s_ubuntu-20.04-amd64.charm'...
charmcraft internal error! BaseConfigurationError: Failed to install apt-utils.
* Command that failed: 'lxc --project charmcraft exec local:charmcraft-alertmanager-k8s-57280626-0-0-amd64 -- env PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin CHARMCRAFT_MANAGED_MODE=1 apt-get install -y apt-utils'
* Command exit code: 100
* Command output: b'Reading package lists...\nBuilding dependency tree...\nReading state information...\nPackage apt-utils is not available, but is referred to by another package.\nThis may mean that the package is missing, has been obsoleted, or\nis only available from another source\nHowever the following packages replace it:\n apt\n\n'
* Command standard error output: b"E: Package 'apt-utils' has no installation candidate\n" (full execution logs in /home/tux/snap/charmcraft/common/charmcraft-log-7icx5pow)
```
[charmcraft.log](https://github.com/canonical/charmcraft/files/7063997/charmcraft.log)
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed not a bug | Closed as an environment conflict: Docker altered iptables and blocked LXD networking, preventing apt-utils installation. | |
| stealth/space-bunny-alpha | — | closed not a bug | Closed as an environment conflict: Docker’s iptables rules blocked LXD package installation. The author fixed packing by uninstalling Docker; a maintainer suggested allowing FORWARD traffic. | |
| stealth/space-bunny-alpha | — | closed not a bug | Closed as an environment conflict: uninstalling Docker fixed apt-utils installation. Docker's iptables changes had blocked LXD networking; no Charmcraft code change was made. | |
| stealth/space-bunny-alpha | — | closed not a bug | Resolved as a host networking conflict: Docker disrupted iptables, preventing LXD from reaching apt repositories. The author fixed it by uninstalling Docker; no code change was made. | |
| stealth/space-bunny-alpha | — | closed not a bug | Closed as an environment conflict: Docker disrupted host iptables, blocking LXD network access. The reporter resolved packing by uninstalling Docker; no code change was needed. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Closed as an environment conflict. Docker interfered with iptables, blocking apt-utils in LXD. The author resolved it by uninstalling Docker, and a maintainer confirmed the networking issue with a workaround. No code changes were made. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed as a user environment conflict. Docker altered iptables rules, blocking LXC container internet access and preventing apt-utils installation. Resolved via workaround: uninstall Docker or run sudo iptables -P FORWARD ACCEPT. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed as resolved via user workaround. Docker installation interfered with LXC networking and iptables, preventing apt-utils installation. Uninstalling Docker or executing sudo iptables -P FORWARD ACCEPT resolved the issue. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Closed as an environment configuration issue. Docker interfered with iptables, blocking LXC container internet access. Resolved by uninstalling Docker or adjusting iptables rules. No code changes required. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #1594 Running `charmcraft pack` fails and returns `Instance setup failed. Check LXD logs for more details` | charmcraft | closed | Closed as an environment conflict, not a Charmcraft defect: Docker had changed networking in a way that interfered with LXD, and the reporter confirmed that uninstalling Docker and restarting fixed it. | |
| #43 Packing the "hello world" example fails: 'apt-utils' has no installation candidate | rockcraft | closed | Closed as an environment conflict, not a Rockcraft defect. Docker’s iptables rules blocked LXD networking and apt access; removing Docker or allowing forwarding resolved it. | |
| #815 charmcraft pack fails - connection timed out could not connect | charmcraft | closed | User-reported charmcraft pack failure was a local host/network problem (archive.ubuntu.com/security.ubuntu.com unreachable during apt cache update in the LXD build container). Author rebooted their machine and packing worked again, then self-closed the issue. | |
| #511 `charmcraft pack` fails running `apt update` | charmcraft | closed | Closed with no Charmcraft code change: maintainers determined the `apt update` failure came from a broken host/LXD (fan bridge) networking setup, not a Charmcraft bug; guidance posted to Charmhub Discourse and the LXD forum. | |
| #647 `charmcraft build` sometimes fails on `apt install` inside the lxd container | charmcraft | closed | Closed as a duplicate of #567; its dpkg-lock fix merged via PR #745 (commit b1adccd5), adding provider warmup to avoid competing APT updates. |