Score:1

Can't install anything because of python3-minimal and language-gnome-selector

vn flag

I'm trying to install python3 (and python2) in my env but I keep on getting the following issue:

sudo apt-get install python3
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
python3 is already the newest version (3.10.6-1~22.04).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up python3-minimal (3.10.6-1~22.04) ...
/var/lib/dpkg/info/python3-minimal.postinst: 5: py3compile: not found
dpkg: error processing package python3-minimal (--configure):
 installed python3-minimal package post-installation script subprocess returned error exit status 127
Setting up language-selector-gnome (0.219) ...
/var/lib/dpkg/info/language-selector-gnome.postinst: 6: py3compile: not found
dpkg: error processing package language-selector-gnome (--configure):
 installed language-selector-gnome package post-installation script subprocess returned error exit status 127
Errors were encountered while processing:
 python3-minimal
 language-selector-gnome
E: Sub-process /usr/bin/dpkg returned an error code (1)

I tried to fix the issue in different ways but I keep getting the same issue each time. Thanks for any help.

edit: I ran the command

sudo apt remove python3

tried to remove python3 and I get the following erroes:

The following NEW packages will be installed:
  libqt5gui5-gles libqt5quick5-gles
0 upgraded, 2 newly installed, 217 to remove and 0 not upgraded.
3 not fully installed or removed.
Need to get 0 B/5,427 kB of archives.
After this operation, 276 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 261970 files and directories currently installed.)
    Removing language-selector-gnome (0.219) ...
    /var/lib/dpkg/info/language-selector-gnome.prerm: 6: py3clean: not found
    dpkg: error processing package language-selector-gnome (--remove):
     installed language-selector-gnome package pre-removal script subprocess returne
    d error exit status 127
    /var/lib/dpkg/info/language-selector-gnome.postinst: 6: py3compile: not found
    dpkg: error while cleaning up:
     installed language-selector-gnome package post-installation script subprocess r
    eturned error exit status 127
    Removing python3-commandnotfound (22.04.0) ...
    /var/lib/dpkg/info/python3-commandnotfound.prerm: 6: py3clean: not found
    dpkg: error processing package python3-commandnotfound (--remove):
     installed python3-commandnotfound package pre-removal script subprocess returne
    d error exit status 127
    dpkg: too many errors, stopping
    Errors were encountered while processing:
     language-selector-gnome
     python3-commandnotfound
    Processing was halted because there were too many errors.
    E: Sub-process /usr/bin/dpkg returned an error code (1)

edit 2: tried to install python3.10-minimal by:

sudo apt-get install python3.10-minimal

and got the following errors:

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
python3.10-minimal is already the newest version (3.10.6-1~22.04.2).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
3 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up python3-commandnotfound (22.04.0) ...
/var/lib/dpkg/info/python3-commandnotfound.postinst: 6: py3compile: not found
dpkg: error processing package python3-commandnotfound (--configure):
 installed python3-commandnotfound package post-installation script subprocess returned error exit status 127
Setting up python3-minimal (3.10.6-1~22.04) ...
/var/lib/dpkg/info/python3-minimal.postinst: 5: py3compile: not found
dpkg: error processing package python3-minimal (--configure):
 installed python3-minimal package post-installation script subprocess returned error exit status 127
Setting up language-selector-gnome (0.219) ...
/var/lib/dpkg/info/language-selector-gnome.postinst: 6: py3compile: not found
dpkg: error processing package language-selector-gnome (--configure):
 installed language-selector-gnome package post-installation script subprocess returned error exit status 127
Errors were encountered while processing:
 python3-commandnotfound
 python3-minimal
 language-selector-gnome
E: Sub-process /usr/bin/dpkg returned an error code (1)
diek avatar
bn flag
Keep in mind that Python 3 is part of Linux, and required by the OS. You cannot just uninstall Python 3 as you would other programs. When working in Linux there are a few options for using different versions of Python, https://www.freecodecamp.org/news/manage-multiple-python-versions-and-virtual-environments-venv-pyenv-pyvenv-a29fb00c296f/
Score:10
cn flag

When you read the original error messages line-by-line, you will discover these lines. All other errors --one way or another-- grow from this original error:

Setting up python3-minimal (3.10.6-1~22.04) ...
/var/lib/dpkg/info/python3-minimal.postinst: 5: py3compile: not found

The key bit here is py3compile: not found. The py3compile module is provided in 22.04 by the python3.10-minimal package.

  • The python3.xx-minimal package name changes with different releases of Ubuntu. Find the package for YOUR release of Ubuntu by looking at the dependencies of python3-minimal

There are two steps to fixing the problem.

  1. Install (or re-install) your python3.xx-minimal package
    sudo apt install python3.10-minimal
    or sudo apt install --reinstall python3.10-minimal

  2. Change the apt-marking of the newly-installed package from auto to manual.
    sudo apt-mark auto python3.10-minimal

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.