apt-getを強制的にnodejsの親バージョンをインストールする

apt-getを強制的にnodejsの親バージョンをインストールする

私は完全に最新バージョンの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

次に、nodejsを使用して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が使用されていないようです。nodejsv14.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)

nodejsノードストアではなくdebianストアからインストールする必要があります。

おすすめ記事