apt-get に Node.js の新しいバージョンをインストールするよう強制する

apt-get に Node.js の新しいバージョンをインストールするよう強制する

私は Debian 11 を使っていて、完全に最新です ( apt-get update && apt-get upgrade && apt-get dist-upgrade)。以前はnodejs、Debian リポジトリにバージョン 12.22 が含まれていたので、次のようにインストールしました。

$ sudo apt-get install nodejs
$ node -v
v12.22.5

しかし、私は v14.18 を使いたいので、次のようにしてノード バージョン 12 のすべての痕跡を削除しました。

$ sudo apt-get remove --purge nodejs

そして、Node.js用のPPAを追加しました。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

以下の場所に新しい PPA が追加されたことがわかります/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

しかし、インストールしようとすると、nodejsまだバージョン 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])

apt-getインストールするのバージョンを決定するために新しい PPA を使用していないようですnodejs。システム全体に v14.18 をインストールするにはどうすればよいですか?

編集

私が使用しているのは 32 ビット マシンであることに注意してください。

$ uname -m
i686

他の 64 ビット マシンで上記の手順を実行すると、正常に動作し、PPA からバージョン 14.18 がインストールされます。

追加で要求される情報:

$ 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

答え1

i386 ビルドは廃止されました。利用可能なアーキテクチャを参照

NodeSource は引き続き以下のアーキテクチャを維持し、将来的にはさらに追加する可能性があります。

amd64 (64-bit)
armhf (ARM 32-bit hard-float, ARMv7 and up: arm-linux-gnueabihf)
arm64 (ARM 64-bit, ARMv8 and up: aarch64-linux-gnu)

nodejsnode リポジトリではなく debian リポジトリからインストールする必要があります。

関連情報