The install/update script install-update-nodered-deb only manages the legacy one-line APT source format for NodeSource (/etc/apt/sources.list.d/nodesource.list). It never checks for, nor removes, the newer deb822-style source file that NodeSource's own setup script now uses:
/etc/apt/sources.list.d/nodesource.sources
Relevant lines:
|
# block debian nodejs install |
|
echo "Package: nodejs" | $SUDO tee /etc/apt/preferences.d/nodejs.pref >>/dev/null |
|
echo "Pin: release a=stable" | $SUDO tee -a /etc/apt/preferences.d/nodejs.pref >>/dev/null |
|
echo "Pin-Priority: -1" | $SUDO tee -a /etc/apt/preferences.d/nodejs.pref >>/dev/null |
|
|
|
# use the official script to install for other debian platforms |
|
$SUDO rm -rf /etc/apt/sources.list.d/nodesource.list 2>&1 | $SUDO tee -a /var/log/nodered-install.log >>/dev/null |
|
$SUDO apt install -y ca-certificates curl gnupg 2>&1 | $SUDO tee -a /var/log/nodered-install.log >>/dev/null |
|
$SUDO mkdir -p /etc/apt/keyrings 2>&1 | $SUDO tee -a /var/log/nodered-install.log >>/dev/null |
|
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | $SUDOE gpg --batch --yes --dearmor -o /etc/apt/keyrings/nodesource.gpg 2>&1 | $SUDO tee -a /var/log/nodered-install.log >>/dev/null |
|
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_VERSION.x nodistro main" | $SUDOE tee -a /etc/apt/sources.list.d/nodesource.list >>/dev/null |
|
$SUDO apt-get update 2>&1 | $SUDO tee -a /var/log/nodered-install.log >>/dev/null |
|
$SUDO apt install -y --reinstall nodejs 2>&1 | $SUDO tee -a /var/log/nodered-install.log >>/dev/null |
If a system already has NodeSource configured via the deb822 format (e.g. set up previously by NodeSource's official setup_XX.x script or after a manual apt modernize-sources, which now generates nodesource.sources instead of nodesource.list), this old file is left completely untouched. The script then creates an additional nodesource.list pointing at the requested major version.
The result is two NodeSource repo definitions active at the same time, pointing at different Node.js major versions.
The install/update script
install-update-nodered-debonly manages the legacy one-line APT source format for NodeSource (/etc/apt/sources.list.d/nodesource.list). It never checks for, nor removes, the newer deb822-style source file that NodeSource's own setup script now uses:Relevant lines:
linux-installers/deb/install-update-nodered
Lines 424 to 436 in 473431d
If a system already has NodeSource configured via the deb822 format (e.g. set up previously by NodeSource's official setup_XX.x script or after a manual
apt modernize-sources, which now generates nodesource.sources instead of nodesource.list), this old file is left completely untouched. The script then creates an additional nodesource.list pointing at the requested major version.The result is two NodeSource repo definitions active at the same time, pointing at different Node.js major versions.