fb3a4ec4e48b3019046cac184045eca25a4618c6
[buildscripts] / nodejs
1 #!/bin/bash
2
3 #https://github.com/nodesource/distributions/blob/master/README.md
4 KEYRING=/usr/share/keyrings/nodesource.gpg
5 curl -fsSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | gpg --dearmor | sudo dd of=$KEYRING status=none
6
7
8 # Replace with the branch of Node.js or io.js you want to install: node_6.x, node_8.x, etc...
9 VERSION=node_16.x
10 # Replace with the keyring above, if different
11 KEYRING=/usr/share/keyrings/nodesource.gpg
12 # The below command will set this correctly, but if lsb_release isn't available, you can set it manually:
13 # - For Debian distributions: jessie, sid, etc...
14 # - For Ubuntu distributions: xenial, bionic, etc...
15 # - For Debian or Ubuntu derived distributions your best option is to use the codename corresponding to the upstream release your distribution is based off. This is an advanced scenario and unsupported if your distribution is not listed as supported per earlier in this README.
16 DISTRO=focal
17 echo "deb [signed-by=$KEYRING] https://deb.nodesource.com/$VERSION $DISTRO main" | sudo tee /etc/apt/sources.list.d/nodesource.list
18 echo "deb-src [signed-by=$KEYRING] https://deb.nodesource.com/$VERSION $DISTRO main" | sudo tee -a /etc/apt/sources.list.d/nodesource.list