I am on Debian 11, fully up to date (apt-get update && apt-get upgrade && apt-get dist-upgrade). I previously installed nodejs version 12.22, since that is what is in the Debian repo, like so:
$ sudo apt-get install nodejs
$ node -v
v12.22.5
However I want to use v14.18. I removed all traces of node version 12, like so:
$ sudo apt-get remove --purge nodejs
And then added the PPA for nodejs using https://github.com/nodesource/distributions:
$ curl -fsSL https://deb.nodesource.com/setup_lts.x -o nodesource_setup_14_lts.sh
$ sudo bash nodesource_setup_14_lts.sh
I can see that it has added the new PPA under /etc/apt/sources.list.d/:
$ cat /etc/apt/sources.list.d/nodesource.list
deb [signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_14.x bullseye main
deb-src [signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_14.x bullseye main
$ sudo apt-get update
Hit:1 http://httpredir.debian.org/debian bullseye InRelease
Hit:2 http://httpredir.debian.org/debian-security bullseye-security InRelease
Hit:3 http://httpredir.debian.org/debian bullseye-updates InRelease
Hit:4 https://deb.nodesource.com/node_14.x bullseye InRelease
Reading package lists... Done
But now when I go to install nodejs it still uses version 12 :(
$ sudo apt-get install nodejs --dry-run
The following NEW packages will be installed:
nodejs
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Inst nodejs (12.22.5~dfsg-2~11u1 Debian:11.1/stable, Debian-Security:11/stable-security [i386])
Conf nodejs (12.22.5~dfsg-2~11u1 Debian:11.1/stable, Debian-Security:11/stable-security [i386])
It seems that apt-get is not using the new PPA to decide the version of nodejs to install. How can I install v14.18 systemwide?
Edit
Note that I am using a 32-bit machine:
$ uname -m
i686
When I do the above procedure on my other 64 bit machine it works fine and it installs version 14.18 from the PPA.
Extra requested information:
$ apt-cache policy nodejs
nodejs:
Installed: (none)
Candidate: 12.22.5~dfsg-2~11u1
Version table:
12.22.5~dfsg-2~11u1 500
500 http://httpredir.debian.org/debian bullseye/main i386 Packages
500 http://httpredir.debian.org/debian-security bullseye-security/main i386 Packages
apt-cache policy nodejsplease.