63

After some heavy tinkering, I must have screwed up my R installation and some package permissions. Rather than try to fix it, I just want to wipe and reinstall everything. So I did:

sudo apt-get remove r-base-core
sudo apt-get remove r-base
sudo apt-get autoremove

Which did uninstall R, except when I reinstalled R, my old packages were still available (and some of them were causing troubles).

How can I do a complete reinstall, including removing all packages, except for the included base library?

1 Answer 1

69

In R, you can use the .libPaths() instruction (or R -e '.libPaths()' in terminal) to know where your packages are installed. Delete those folders and reinstall.

2
  • 3
    This worked perfectly! I remove two directories with my installed packages, and apt-get remove took care of the main files. Jun 12, 2014 at 10:18
  • Since this is a highly upvoted question, I am asking a closely related follow up question: What If we delete any folder recursively from a specific .libPath() with an intention to remove one or more packages from a specific .libPath()? Will it be a clean uninstallation of a package? Case in hand same package installed twice. Apr 24 at 3:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.