distributions icon indicating copy to clipboard operation
distributions copied to clipboard

[ERROR] Node.js 18 on Debian 12 Installation fail

Open jared-unify opened this issue 3 years ago • 7 comments

Hit:1 http://security.debian.org/debian-security bookworm-security InRelease Hit:2 http://deb.debian.org/debian bookworm InRelease Get:3 https://deb.nodesource.com/node_18.x nodistro InRelease [12.1 kB] Hit:4 http://deb.debian.org/debian bookworm-updates InRelease Err:3 https://deb.nodesource.com/node_18.x nodistro InRelease The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 2F59B5F99B1BE0B4 Reading package lists... Done W: GPG error: https://deb.nodesource.com/node_18.x nodistro InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 2F59B5F99B1BE0B4 E: The repository 'https://deb.nodesource.com/node_18.x nodistro InRelease' is not signed. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details.

This was caused by gpg not being installed. Can you add gpg to line 87 of README.md?

jared-unify avatar Oct 16 '23 01:10 jared-unify

When you see the error that the key 2F59B5F99B1BE0B4 is missing, then you might need to import the new key from this location:

https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key

previously it was at:

https://deb.nodesource.com/gpgkey/nodesource.gpg.key

eis-ioki avatar Nov 01 '23 12:11 eis-ioki

All it needed was apt install gpg Could be added to the README.md pretty easily

jared-unify avatar Nov 02 '23 01:11 jared-unify

I am still facing the same issue the latest script is having this key URL

 80 
 81     # Run 'curl' and 'gpg'
 82     if ! curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /usr/share/keyrings/nodesource.gpg; then
 83         handleError "$?" "Failed to download and import the NodeSource signing key"

But sill i am facing this error

root@test-test:~# ./nsolid_setup_deb.sh 20

-------------------------------------------
Info: Configuring repository for N|solid 20
-------------------------------------------


-------------------------------
Info: Installing pre-requisites
-------------------------------

Hit:1 http://repomirror.rtp.openeng.netapp.com/docker/linux/ubuntu focal InRelease
Get:2 https://deb.nodesource.com/node_20.x nodistro InRelease [12.1 kB]                  
Err:2 https://deb.nodesource.com/node_20.x nodistro InRelease                            
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 2F59B5F99B1BE0B4
Reading package lists... Done
W: GPG error: https://deb.nodesource.com/node_20.x nodistro InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 2F59B5F99B1BE0B4
E: The repository 'https://deb.nodesource.com/node_20.x nodistro InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

----------------------------------------------------
Error: Failed to run 'apt-get update' (Exit Code: 0)
----------------------------------------------------

gnusiva avatar Nov 13 '23 05:11 gnusiva

I am getting this error for sudo apt-get update as well

root@test-test:~# apt-get update
Get:1 https://deb.nodesource.com/node_20.x nodistro InRelease [12.1 kB]
Err:1 https://deb.nodesource.com/node_20.x nodistro InRelease                                                               
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 2F59B5F99B1BE0B4
Reading package lists... Done 
W: GPG error: https://deb.nodesource.com/node_20.x nodistro InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 2F59B5F99B1BE0B4
E: The repository 'https://deb.nodesource.com/node_20.x nodistro InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

gnusiva avatar Nov 13 '23 05:11 gnusiva

You can check their IDs like this:

# want: 2F59B5F99B1BE0B4

curl -fsSL --compressed \
  "https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key" \
| gpg --dry-run --show-keys -
# is: 6F71F525282841EEDAF851B4 2F59B5F99B1BE0B4

My /usr/share/keyrings/nodesource.gpg had this entry:

# gpg --show-keys /usr/share/keyrings/nodesource.gpg

pub   rsa4096 2014-06-13 [SC]
      9FD3B784BC1C6FC31A8A0A1C1655A0AB68576280
uid                      NodeSource <[email protected]>
sub   rsa4096 2014-06-13 [E]

… and this is how I added the new key:

curl -fsSL --compressed \
  "https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key" \
| apt-key --keyring "/usr/share/keyrings/nodesource.gpg" add

No vendor key shall be able to sign any unrelated repository. That’s why I don’t store them in /etc/apt/trusted.gpg.d/ which has global validity and would invite such confusion.


# /etc/apt/sources.list.d/nodesource.list
deb [arch=amd64 signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_21.x nodistro main
# deb-src [arch=amd64 signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_21.x nodistro main

mark-kubacki avatar Nov 21 '23 09:11 mark-kubacki

Thanks for your contribution, this issue is resolved by https://github.com/nodesource/distributions/pull/1739

JesusPaz avatar Jan 02 '24 22:01 JesusPaz

I had the same problem and google led me here. The fix was chmod a+r /usr/share/keyrings/nodesource.gpg - in my system it was generated 0640 and apt ignores such files.

coolo avatar Feb 11 '24 17:02 coolo