charmcraft pack fails for apt-utils is not available
Metadata
Current evaluation
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.
Suggested action: —
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 |
|---|---|---|---|---|
| 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. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Resolved via environment workaround. Docker interfered with LXC container networking, causing apt-get failures. Uninstalling Docker or adjusting iptables rules fixed the issue. No code changes were made. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #511 `charmcraft pack` fails running `apt update` | charmcraft | closed | Closed as out of scope. The failure stemmed from an LXD container networking bug, not charmcraft. No code changes were implemented; users were directed to external LXD and Discourse discussions for troubleshooting. | |
| #1594 Running `charmcraft pack` fails and returns `Instance setup failed. Check LXD logs for more details` | charmcraft | closed | Closed after the author confirmed uninstalling Docker resolved the conflict. Docker network settings interfered with LXD, causing charmcraft pack instance setup failures. Restarting the system after removal fixed the environment. | |
| #560 Charmcraft pack is giving error frequently | charmcraft | closed | Charmcraft pack failed due to an apt-get network error installing snapd in an LXD container. Maintainers linked it to a known networking issue. The reporter confirmed a workaround failed. Closed without a code fix, likely abandoned. | |
| #502 charmcraft internal error! BaseConfigurationError: Failed to install apt-utils | charmcraft | closed | Resolved by adding missing build dependencies to charmcraft.yaml. The author confirmed that specifying parts.build-packages, such as git, fixed the LXC container setup failures for apt-utils and git during charmcraft pack. | |
| #676 charmcraft build fails with LXD version | charmcraft | closed | Closed as working as intended. Maintainer clarified LXD 4.0+ is required for default builds and provided the --destructive-mode flag as an alternative to bypass the dependency. | |
| #497 charmcraft Pack is not Working | charmcraft | closed | Resolved via user environment fix. The permission error stemmed from running charmcraft as root with root-owned files. Switching to a regular user, adding them to the lxd group, and correcting ownership allowed pack to succeed. No code changes required. |