Score:0

because i can't install python3.10-minimal in ubuntu 22.04 lts

lc flag

I have a container with ubuntu 22.04 lts and when I need to install a package or program that requires pyhton3.x-minimal it throws a permissions denied error, I am also root. It is something strange but I have not been able to solve it.

This is program installa

root@c0f46f619a6c:/var/www/html#apt-get install systemd

And the installation throws the following message

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  dmsetup gir1.2-glib-2.0 libcryptsetup12 libdevmapper1.02.1 libgirepository-1.0-1 libip4tc2 libjson-c5 libkmod2 libmpdec3 libpython3-stdlib libpython3.10-minimal libpython3.10-stdlib
  networkd-dispatcher python3 python3-dbus python3-gi python3-minimal python3.10 python3.10-minimal systemd-timesyncd
Suggested packages:
  iw | wireless-tools python3-doc python3-tk python3-venv python-dbus-doc python3.10-venv python3.10-doc binutils binfmt-support systemd-container libfido2-1 libtss2-esys-3.0.2-0
  libtss2-mu0 libtss2-rc0 policykit-1
The following NEW packages will be installed:
  dmsetup gir1.2-glib-2.0 libcryptsetup12 libdevmapper1.02.1 libgirepository-1.0-1 libip4tc2 libjson-c5 libkmod2 libmpdec3 libpython3-stdlib libpython3.10-minimal libpython3.10-stdlib
  networkd-dispatcher python3 python3-dbus python3-gi python3-minimal python3.10 python3.10-minimal systemd systemd-timesyncd
0 upgraded, 21 newly installed, 0 to remove and 0 not upgraded.
Need to get 11.2 MB of archives.
After this operation, 41.4 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 libpython3.10-minimal amd64 3.10.6-1~22.04.2ubuntu1 [810 kB]
Get:2 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 python3.10-minimal amd64 3.10.6-1~22.04.2ubuntu1 [2263 kB]
Get:3 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 python3-minimal amd64 3.10.6-1~22.04 [24.3 kB]
Get:4 http://archive.ubuntu.com/ubuntu jammy/main amd64 libmpdec3 amd64 2.5.1-2build2 [86.8 kB]
Get:5 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 libpython3.10-stdlib amd64 3.10.6-1~22.04.2ubuntu1 [1831 kB]
          
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package libpython3.10-minimal:amd64.
(Reading database ... 19257 files and directories currently installed.)
Preparing to unpack .../libpython3.10-minimal_3.10.6-1~22.04.2ubuntu1_amd64.deb ...
Unpacking libpython3.10-minimal:amd64 (3.10.6-1~22.04.2ubuntu1) ...
Selecting previously unselected package python3.10-minimal.
Preparing to unpack .../python3.10-minimal_3.10.6-1~22.04.2ubuntu1_amd64.deb ...
Unpacking python3.10-minimal (3.10.6-1~22.04.2ubuntu1) ...
Setting up libpython3.10-minimal:amd64 (3.10.6-1~22.04.2ubuntu1) ...
Setting up python3.10-minimal (3.10.6-1~22.04.2ubuntu1) ...
[Errno 13] Permission denied: '/usr/lib/python3.10/__pycache__/__future__.cpython-310.pyc.140322885704192'dpkg: error processing package python3.10-minimal (--configure):
 installed python3.10-minimal package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 python3.10-minimal
E: Sub-process /usr/bin/dpkg returned an error code (1)

I tried changing some execute and write permissions but the problem persists

cc flag
Python3.10-minimal should be a normal part of your installation. Is the __future... file rw-r-r owned by root?
Brayan Gonzalez avatar
lc flag
this is what the ls command throws me -rw-r--r-- 1 root root 0 /usr/lib/python3.10/__pycache__/__future__.cpython-310.pyc.140322885704192
cc flag
None of the pyc files in my __pycache__ directory have a large number at the end, and the 0 length on your --fut... file is wrong, mine is 4131. Maybe since it's in cache, just delete it, but no idea what that might do -- reinstall?
Score:1
ma flag

I was having the same issue and the solution was to change the way I was running docker in my computer as apparently there is a bug in how docker got installed in Ubuntu 22.04 using snap that generates this issue.

More info in this thread: https://forums.docker.com/t/bug-on-apt-install-permission-denied/100196

Exact steps I followed to fix it are this ones: https://forums.docker.com/t/bug-on-apt-install-permission-denied/100196/9

Score:0
mx flag

In my case, the following sequence of actions helped:

  1. sudo systemctl daemon-reload
  2. sudo systemctl restart docker
  3. sudo systemctl restart docker.socket docker.service
  4. docker rm -f <container id> // remove all containers which can cause your problem
  5. Retry docker container building
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.