To uninstall node js from ubuntu following steps can be done.

  1. $ apt-get remove nodejs # It will remove the package
  2. $ apt-get purge nodejs # It will remove configurations
  3. $ apt-get autoremove # It will remove unused file

ashu@dev:~/work/sb/frontend$ sudo apt-get remove nodejs
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following packages were automatically installed and are no longer required:
daemon libc-ares2 libfwupdplugin1 libnode64 nodejs-doc
Use ‘sudo apt autoremove’ to remove them.
The following packages will be REMOVED:
nodejs
0 upgraded, 0 newly installed, 1 to remove and 1 not upgraded.
After this operation, 158 kB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database … 206667 files and directories currently installed.)
Removing nodejs (10.19.0~dfsg-3ubuntu1) …
Processing triggers for man-db (2.9.1-1) …
ashu@dev:~/work/sb/frontend$ sudo apt-get purge nodejs
Reading package lists… Done
Building dependency tree
Reading state information… Done
Package ‘nodejs’ is not installed, so not removed
The following packages were automatically installed and are no longer required:
daemon libc-ares2 libfwupdplugin1 libnode64 nodejs-doc
Use ‘sudo apt autoremove’ to remove them.
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
ashu@dev:~/work/sb/frontend$ sudo apt-get autoremove
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following packages will be REMOVED:
daemon libc-ares2 libfwupdplugin1 libnode64 nodejs-doc
0 upgraded, 0 newly installed, 5 to remove and 1 not upgraded.
After this operation, 31.3 MB disk space will be freed.
Do you want to continue? [Y/n]

Leave a Reply

Your email address will not be published. Required fields are marked *