Snap: Snapcraft currently relies on `libapt` during configure
Metadata
Current evaluation
No evaluation has been recorded for this issue yet.
Issue body
### Bug Description
Snapcraft currently relies on `libapt` being available from the base snap, which it has been by accident, we corrected this recently (on core22 and core24 that are in beta/candidate) and then it was reported that Snapcraft now fails to install due to its configure hook importing `apt` which unfortunately relies on `libapt` being available. Furthermore this library has just been taking up space in the base.
We think this is unfortunate due to the fact that snaps are supposed to work in a snap-only system, where `apt` might not even be part of the equation. Right now it may not be a huge problem, but as we move towards a more snap-focused future, this seems very odd, and we would like for Snapcraft to be able to install on a system where `apt` is not available in the base snap.
### To Reproduce
```
$ sudo snap install core22 --candidate
$ sudo snap install snapcraft --classic
```
### Environment
Ubuntu systems that use snap
### snapcraft.yaml
```yaml
N/A
```
### Relevant log output
```shell
$ sudo snap install --classic snapcraft
error: cannot perform the following tasks:
- Run configure hook of "snapcraft" snap if present (run hook "configure":
-----
Traceback (most recent call last):
File "/snap/snapcraft/12961/snap/hooks/configure", line 7, in <module>
from snapcraft.snap_config import SnapConfig
File "/snap/snapcraft/current/lib/python3.10/site-packages/snapcraft/__init__.py", line 23, in <module>
import snapcraft.sources # noqa: F401
File "/snap/snapcraft/current/lib/python3.10/site-packages/snapcraft/sources.py", line 22, in <module>
from snapcraft_legacy.sources import get
File "/snap/snapcraft/current/lib/python3.10/site-packages/snapcraft_legacy/__init__.py", line 340, in <module>
from snapcraft_legacy.internal import repo # noqa
File "/snap/snapcraft/current/lib/python3.10/site-packages/snapcraft_legacy/internal/repo/__init__.py", line 27, in <module>
from ._deb import Ubuntu # noqa
File "/snap/snapcraft/current/lib/python3.10/site-packages/snapcraft_legacy/internal/repo/_deb.py", line 39, in <module>
from .apt_cache import AptCache
File "/snap/snapcraft/current/lib/python3.10/site-packages/snapcraft_legacy/internal/repo/apt_cache.py", line 25, in <module>
import apt
File "/snap/snapcraft/current/lib/python3.10/site-packages/apt/__init__.py", line 23, in <module>
import apt_pkg
ImportError: /snap/core22/current/lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.38' not found (required by /lib/x86_64-linux-gnu/libapt-pkg.so.6.0)
-----)
```
```
### Additional context
Original bug report in core-base: https://github.com/canonical/core-base/issues/283
Evaluation history
No evaluation history available.