bash - Completely removing Node.js: automatic vs manual -


recently used following list of files associated node removing on linux mint 18.1:

sudo rm -rf /usr/local/lib/node* /usr/local/include/node* ~/.local/node* ~/.lib/node* ~/.include/node* /usr/local/bin/node* 

on other hand there solution uses apt-get:

sudo apt-get purge --auto-remove nodejs 

is there difference in them in context of full , total removing nodejs local machine? 1 more correct/safe/complete?

thanks in advance!

it's safer , more reliable use apt-get purge that. otherwise have know of package files located. includes not limited to: configuration files, man pages, libraries, etc. in addition, package structure may change during time (like new files added or directories changed). apt-get utility execute set of post-removal scripts in /var/lib/dpkg/info. if keep removing files manually, system cluttered , may end in inconsistent state.

here visual example (for ubuntu):

root@ubuntu-xenial:~# rm -rf /usr/lib/node* /usr/include/node* /usr/bin/node* root@ubuntu-xenial:~# updatedb root@ubuntu-xenial:~# locate nodejs | head -n 3 /etc/profile.d/nodejs.sh /usr/share/nodejs /usr/share/doc/nodejs # there still more 200 files left related nodejs package. root@ubuntu-xenial:~# locate nodejs | wc -l 212 

Comments

Popular posts from this blog

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

python Tkinter Capturing keyboard events save as one single string -

sql server - Why does Linq-to-SQL add unnecessary COUNT()? -