How to Add Node JS PPA for Ubuntu-Based OSes

October 19, 2017 | By the+gnu+linux+evangelist.

GNU/Linux Ubuntu Adding Node JS Repository

Hi! The Guide shows you Step-by-step How to Add the Node JS Repository for Ubuntu-Based GNU/Linux Systems.

And with this Node JS Repo Setup you’ll be able to Install both : 16.x LTS, 18.x LTS, and 20.x LTS.
Finally, this Node JS Ubuntu Repository is valid also for:

  • Linux Mint
  • Zorin OS
  • Lubuntu
  • Elementary OS
  • Kde Neon
  • Pop_OS!
  • Xubuntu
  • Linux Lite
  • Bodhi
  • Puppy
  • Kubuntu
  • LXLE
  • Trisquel
  • Voyager
  • feren OS
  • Peppermint
  • Linux Ultimate Edition

(You may only need to find the Corresponding Ubuntu Parent Release)

How to Add Node JS Repository Ubuntu - Featured
  1. 1. Terminal Getting-Started Guide

    How to QuickStart with Command Line on Ubuntu GNU/Linux

    Console Ubuntu Linux QuickStart Guide

    First Update the Apt Repo Sources with:

    sudo apt update

    Authenticate with the User Admin Pass.
    If Got “User is Not in Sudoers file” then see: How to Enable sudo.

  2. 2. Installing Dependencies

    Then to Install Required Software
    Run:

    sudo apt install -y ca-certificates curl gnupg

    Authenticate with the User Admin Pass.
    If Got “User is Not in Sudoers file” then see: How to Enable sudo.

  3. 2. Adding GPG Key

    Now to Add Node.js Signing Key
    First, make the Target Directory with:

    sudo mkdir -p /etc/apt/keyrings

    And then to Setup it:

    curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
  4. 3. Setting Up NodeJS Repository

    Then Add Node JS Apt Repository
    Especially relevant: Node.js 18+ is supported only on Ubuntu 20.04+ based Systems.
    Now for Node 20 Set the Env. Var. as:

    NODE_MAJOR=20

    And then run:

    echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list

    For Nodejs 16, and 18, change the NODE_MAJOR correspondly.
    Last, to Update the Apt Sources:

    sudo apt update
  5. 4. Installing NodeJS

    Now to Install NodeJS for MYDISTRO
    Simply play:

    sudo apt install nodejs
  6. 5. Getting Started Node Js

    How to Get Started with NodeJs on Ubuntu GNU/Linux

    Node Js Ubuntu QuickStart

QuickChic Theme • Powered by WordPress