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?

Misconstruction
  • 1,839
  • 4
  • 17
  • 23

1 Answers1

68

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.

KiriSakow
  • 957
  • 1
  • 12
  • 22
Vincent Guyader
  • 2,927
  • 1
  • 26
  • 43
  • 3
    This worked perfectly! I remove two directories with my installed packages, and apt-get remove took care of the main files. – Misconstruction Jun 12 '14 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. – Lazarus Thurston Apr 24 '23 at 03:54