17

I have installed nodejs from nodesource.com:

curl -sL https://deb.nodesource.com/setup_0.12 | sudo bash -

sudo apt-get install nodejs

It installed nodejs 0.12.4, but how can i remove it now including all footprints from that repo?

I can see a file under /etc/apt/sources.list.d/nodesource.list

Maythux
  • 84,289

3 Answers3

25

First you can purge nodejs and its related files

sudo apt-get purge nodejs

then you can delete the its repositoy

sudo rm -r  /etc/apt/sources.list.d/nodesource.list
Maythux
  • 84,289
6

As addition, you may want to remove nodesource key.

First you can see:

sudo apt-key list

And it will output something look like this

pub   4096R/68576280 2014-06-13
uid                  NodeSource <gpg@nodesource.com>
sub   4096R/AA01DA2C 2014-06-13

Then you can delete with:

sudo apt-key del 68576280
bentinata
  • 161
1
sudo apt-get purge nodejs

But this won't delete the /usr/lib/node_modules directory as its not empty.

So for a complete clean up, run:

sudo rm -r /usr/lib/node_modules/
sudo rm /etc/apt/sources.list.d/nodesource.list
Gayan Weerakutti
  • 3,770
  • 26
  • 38