Unable to install python3.8-minimal via apt

Bug #1921526 reported by Skyler Hardy
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cloud-images
New
Undecided
Unassigned

Bug Description

Using the latest Ubuntu docker image, apt-get fails to install python:

root@2344d13f1b73:/# apt-get install -y python3.8-minimal
Reading package lists... Done
Building dependency tree
Reading state information... Done
python3.8-minimal is already the newest version (3.8.5-1~20.04.2).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up python3.8-minimal (3.8.5-1~20.04.2) ...
Traceback (most recent call last):
  File "/usr/lib/python3.8/py_compile.py", line 218, in <module>
    sys.exit(main())
  File "/usr/lib/python3.8/py_compile.py", line 209, in main
    compile(filename, doraise=True)
  File "/usr/lib/python3.8/py_compile.py", line 172, in compile
    importlib._bootstrap_external._write_atomic(cfile, bytecode, mode)
  File "<frozen importlib._bootstrap_external>", line 126, in _write_atomic
PermissionError: [Errno 13] Permission denied: '/usr/lib/python3.8/__pycache__/__future__.cpython-38.pyc.140103645134608'
dpkg: error processing package python3.8-minimal (--configure):
 installed python3.8-minimal package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 python3.8-minimal
E: Sub-process /usr/bin/dpkg returned an error code (1)
root@2344d13f1b73:/#

Revision history for this message
Éric St-Jean (esj) wrote :

i just tried this on fresh bionic and focal containers, and can install python3.8-minimal just fine

which container are you using exactly?
is it untouched or this is your container image after building on top of ubuntu?

Revision history for this message
Skyler Hardy (sdhardy) wrote :

This is the untouched container image from docker. I ran docker pull ubuntu:focal:

sky@lp1:~$ sudo docker pull ubuntu:focal
[sudo] password for sky:
focal: Pulling from library/ubuntu
Digest: sha256:a15789d24a386e7487a407274b80095c329f89b1f830e8ac6a9323aa61803964
Status: Downloaded newer image for ubuntu:focal
docker.io/library/ubuntu:focal

sky@lp1:~$ sudo docker image inspect ubuntu:focal
[
    {
        "Id": "sha256:8e428cff54c8a8d9759e0b0e13d9224ffe7617abb53a73e01550e32c15827e17",
        "RepoTags": [
            "ubuntu:20.04",
            "ubuntu:focal",
            "ubuntu:latest"
        ],
        "RepoDigests": [
            "ubuntu@sha256:a15789d24a386e7487a407274b80095c329f89b1f830e8ac6a9323aa61803964"
        ],
<trim>

I'll attach a full log for reference. I ran the following to generate the log:

sudo docker run -it ubuntu:focal /bin/bash -c "apt-get update && apt-get install -y python3"

I just tried this using a debian image and I'm having the same issue, so it may be a problem with my docker version or my host system.

Revision history for this message
Skyler Hardy (sdhardy) wrote :

I installed from the docker repo rather than the ubuntu repo and it works without a problem now.

Thank you for your time.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.