1

I'm new to Linux and I'm trying to install node, npm, yarn and then vuejs/vitejs.... I was able to install node, npm and yarn successfully, but when I try installing with npm it says I have an older version of node.

Since I installed those packages, any time I try installing, removing or upgrading any new package I keep getting the error below.

Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 7 not upgraded.
4 not fully installed or removed.
Need to get 1,136 kB of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 http://ci.archive.ubuntu.com/ubuntu bionic-updates/main amd64 dpkg amd64 1.19.0.5ubuntu2.3 [1,136 kB]
Fetched 1,136 kB in 2s (535 kB/s) 
(Reading database ... 338279 files and directories currently installed.)
Preparing to unpack .../dpkg_1.19.0.5ubuntu2.3_amd64.deb ...
Unpacking dpkg (1.19.0.5ubuntu2.3) over (1.19.0.5ubuntu2.3) ...
Setting up dpkg (1.19.0.5ubuntu2.3) ...
Setting up python3-xapian (1.4.5-1ubuntu3) ...
/var/lib/dpkg/info/python3-xapian.postinst: 6: /var/lib/dpkg/info/python3-xapian.postinst: py3compile: not found
dpkg: error processing package python3-xapian (--configure):
 installed python3-xapian package post-installation script subprocess returned error exit status 127
Setting up python3-problem-report (2.20.9-0ubuntu7.24) ...
/var/lib/dpkg/info/python3-problem-report.postinst: 6: /var/lib/dpkg/info/python3-problem-report.postinst: py3compile: not found
dpkg: error processing package python3-problem-report (--configure):
 installed python3-problem-report package post-installation script subprocess returned error exit status 127
Setting up python3-configobj (5.0.6-2) ...
/var/lib/dpkg/info/python3-configobj.postinst: 6: /var/lib/dpkg/info/python3-configobj.postinst: py3compile: not found
dpkg: error processing package python3-configobj (--configure):
 installed python3-configobj package post-installation script subprocess returned error exit status 127
Setting up python3-dateutil (2.6.1-1) ...
/var/lib/dpkg/info/python3-dateutil.postinst: 6: /var/lib/dpkg/info/python3-dateutil.postinst: py3compile: not found
dpkg: error processing package python3-dateutil (--configure):
 installed python3-dateutil package post-installation script subprocess returned error exit status 127
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Processing triggers for libc-bin (2.27-3ubuntu1.4) ...
Errors were encountered while processing:
 python3-xapian
 python3-problem-report
 python3-configobj
 python3-dateutil

I installed python3.9 and symlink it to python3. Everything still worked well until I tried installing yarn specifically.

I also tried using npm again and I'm getting the same error.

Python3 is also giving this error:

bash: python3: command not found

1 Answer 1

2

Don't link Python3 to a different version of Python.

python3 MUST link to the system-provided version of Python in order for your system to work properly. For example, apt depends upon that specific version; you broke apt when you changed the link.

To use a different version of Python, keep it in a container or venv. You can link whatever you like inside the container/venv.

Revert your change. You changed the link once; simply change it back.

1
  • Thanks a lot.... It now works normal Commented May 26, 2021 at 18:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .