R - How to remove all installed packages?

Asked

Viewed 300 times

2

I ran a script in R a while ago and ended up installing all the packages related to statistics.

With this, every time I go to make an update, it ends up taking longer than necessary.

Since I do not use half of these packages, I would like to know if there is a way to remove all installed packages (except the ones from the system) at once.

Not that it matters, but I use Linux Mint 19.3.

  • 1

    This question can be answered as it stands. And it is not the most trivial of problems, it is potentially dangerous to automate the removal of an undetermined amount of packages.

  • Responding: update.packages(checkBuilt = T, ask = F) , or, remove.packages( installed.packages( priority = "NA" )[,1] ), or by deleting the path folder /home/yourusername/R/x86_64-redhat-linux-gnu-library

  • 1

    This shape does not seem to be the best. 1) The update.packages It’s gonna take a long time, too. 3) Not always this is the directory where the packages are, in my installation of R on this computer, for example, are in two caminho/para/site-library different.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.