1

I am trying to install node.js latest version from node.js source official github repo. but after all running all commands yet, at apt-get install nodejs. system installs nodejs 10 version. I have already tried to this stack overflow. but even after running & installing software-common-properties. nothing changes.

The error showing up when i run curl -fsSL https://deb.nodesource.com/setup_17.x | sudo -E bash - is:

## Installing the NodeSource Node.js 17.x repo...


## Populating apt-get cache...

+ apt-get update
Ign:1 http://download.webmin.com/download/repository sarge InRelease
Hit:2 http://download.webmin.com/download/repository sarge Release  
Hit:3 http://archive.ubuntu.com/ubuntu focal InRelease              
Hit:4 http://security.ubuntu.com/ubuntu focal-security InRelease    
Ign:5 http://ppa.launchpad.net/certbot/certbot/ubuntu focal InRelease
Hit:6 http://archive.ubuntu.com/ubuntu focal-updates InRelease
Hit:8 http://archive.ubuntu.com/ubuntu focal-backports InRelease
Hit:9 http://ppa.launchpad.net/ondrej/php/ubuntu focal InRelease
Err:10 http://ppa.launchpad.net/certbot/certbot/ubuntu focal Release
  404  Not Found [IP: 91.189.95.85 80]
Reading package lists... Done
E: The repository 'http://ppa.launchpad.net/certbot/certbot/ubuntu focal Release' does not have a Release file.
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

kindly help. thank you.

rajeshtva
  • 410
  • 6
  • 18

1 Answers1

0

when i was running curl -fsSL https://deb.nodesource.com/setup_17.x | sudo -E bash - in terminal. then the command was not succedding for some reasons and failing (details below). due to that the nodejs version in the apt repo cache was not updating. so when i was installing nodejs by running apt-get install nodejs, it was always installing version 10.

so make sure that this command curl -fsSL https://deb.nodesource.com/setup_17.x | sudo -E bash - should run till end without any issue. in the last if sudo apt-get install -y nodejs line appears then your apt repo cache is updated. otherwise the command is failing.

The reason for failure in my case:
  • i had certbot installed which had added a source in the /etc/apt/sources.list.d/ directory. the problem was not with certbot install itself but with its apt source url. when apt-get update command was being run, then certbot source was being looked for which was not found on specified url. so it was causing 404 and hence failure. so i went to /etc/apt/sources.list.d/certbot-ubuntu-certbot-focal.list and commented all lines(only one line was active there). then again run the curl command. It worked this time.

so my advice is:

  • make sure curl command works properly. for this i suggest to look for specific place where it is failing. I mean actually debug the script that is loaded from curl command. there are a lot of bash commands mentioned which is seting up everything.
rajeshtva
  • 410
  • 6
  • 18