distributions: Signatures couldn't be verified - public key - Ubuntu 20.04 Focal
I did see other mentions of this issue, but they seemed to be related to users running an unsupported distro. However, Ubuntu Focal is listed as supported.
curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
## Installing the NodeSource Node.js 14.x repo...
## Populating apt-get cache...
+ apt-get update
Hit:1 http://us.archive.ubuntu.com/ubuntu focal InRelease
- - -
Hit:4 http://us.archive.ubuntu.com/ubuntu focal-updates InRelease
- - -
Hit:6 http://us.archive.ubuntu.com/ubuntu focal-backports InRelease
Hit:7 http://us.archive.ubuntu.com/ubuntu focal-security InRelease
Reading package lists... Done
## Confirming "focal" is supported...
+ curl -sLf -o /dev/null 'https://deb.nodesource.com/node_14.x/dists/focal/Release'
## Adding the NodeSource signing key to your keyring...
+ curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | gpg --dearmor | tee /usr/share/keyrings/nodesource.gpg >/dev/null
gpg: WARNING: unsafe ownership on homedir '/home/matthew/.local/share/gnupg'
## Creating apt sources list file for the NodeSource Node.js 14.x repo...
+ echo 'deb [signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_14.x focal main' > /etc/apt/sources.list.d/nodesource.list
+ echo 'deb-src [signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_14.x focal main' >> /etc/apt/sources.list.d/nodesource.list
## Running `apt-get update` for you...
+ apt-get update
Get:1 https://deb.nodesource.com/node_14.x focal InRelease [4,583 B]
Hit:2 http://us.archive.ubuntu.com/ubuntu focal InRelease
- - -
Err:1 https://deb.nodesource.com/node_14.x focal InRelease
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 1655A0AB68576280
- - -
Hit:5 http://us.archive.ubuntu.com/ubuntu focal-updates InRelease
- - -
Hit:7 http://us.archive.ubuntu.com/ubuntu focal-backports InRelease
Hit:8 http://us.archive.ubuntu.com/ubuntu focal-security InRelease
Reading package lists... Done
W: GPG error: https://deb.nodesource.com/node_14.x focal InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 1655A0AB68576280
E: The repository 'https://deb.nodesource.com/node_14.x focal 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 executing command, exiting
Wish Canonical would provide something newer than version 10.x.x…
I had a version that was at least as high as 12 yesterday, and after reinstalling everything I’m not sure how I managed that in the past, I don’t recall using nodesource previously, but npm
and n
were unable to update me to version 14, hoping I have better luck here.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 1
- Comments: 23 (2 by maintainers)
Links to this issue
Commits related to this issue
- Fix key verification for nodejs installation For some reason installing nodejs on Ubuntu 14.04 will result in error: ``` WARNING: The following packages cannot be authenticated! nodejs ``` See also... — committed to ONLYOFFICE/build_tools by ShockwaveNN 3 years ago
- Fix key verification for nodejs installation (#280) For some reason installing nodejs on Ubuntu 14.04 will result in error: ``` WARNING: The following packages cannot be authenticated! nodejs ... — committed to ONLYOFFICE/build_tools by ShockwaveNN 3 years ago
I “fixed” it by running the following command before the setup:
I got this from the manual installation guide.
So in my dockerfile I have it like this now:
I encountered this issue due to using a non-default umask (
umask 0027
) as required by the CIS benchmark standard. This caused/usr/share/keyrings/nodesource.gpg
to be written with640
permissions instead of644
, so only root could read it. So it should be reproducible by runningumask 0027
beforecurl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
. After runningchmod a+r /usr/share/keyrings/nodesource.gpg
apt-get update completed successfully.Just faced the same issue on Ubuntu 20.04.
Solved it by doing the following which is mainly based on the comments above:
I also had the error with Ubuntu bionic.
Checked the permissions of
/usr/share/keyrings/nodesource.gpg
and it was600
. Changing it to644
fixed the issue.I had the same issue on Ubuntu-20.04. Tried to install nodejs 12.x Due to strange root settings on my corporate laptop, the permissions for files
were wrong (600). Calling
has solved the problem. Feeling pretty angry that somebody’s crooked hands can make our lives really difficult.
Same here,
This problem need to be fix, as it is not the
apt-key
’s problem.The real fix has been provided by @kosala-almeda:
So please add a line
chmod 644 /usr/share/keyrings/nodesource.gpg
into the setup script.Thanks
@ShockwaveNN We cannot maintain
apt-key
as it is scheduled for removal:https://salsa.debian.org/apt-team/apt/-/commit/ee284d5917d09649b68ff1632d44e892f290c52f https://salsa.debian.org/apt-team/apt/-/commit/ee284d5917d09649b68ff1632d44e892f290c52f#d1b035cd43f3c2f65d2be57ba185053090491a35_47_48
Maintaining deprecated tools so that our scripts work on distributions that are already EOL like
Debian Jessie
andUbuntu 14.04
is not a good practice, that is way we are moving with the procedure recommended by Debian:https://wiki.debian.org/DebianRepository/UseThirdParty
We are sorry that it does not work on those distributions but it is a must.
You can follow the manual instructions that still work on the aforementioned distributions.
Same problem with ubuntu 14.04 (I’ve know it’s EOLed, just as info):
result:
And same Dockerfile is fine with 16.04