To install v6.x update the packages
curl -sL <https://deb.nodesource.com/setup_6.x> | sudo -E bash -
Using the apt package manager
sudo apt-get install -y nodejs