Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] support remove.packages #43

Closed
sukanka opened this issue Jul 7, 2022 · 2 comments
Closed

[Feature Request] support remove.packages #43

sukanka opened this issue Jul 7, 2022 · 2 comments

Comments

@sukanka
Copy link

sukanka commented Jul 7, 2022

Is there any plan to implement remove.packages()?
I just installed r-bspm from BioArchLinux, and tried to install an R package.
It's great that it calls pacman to install the package, but when I run remove.packages(), it does not call pacman to remove the packges.

r$> remove.packages("ggplot2")
Removing package from/home/sukanka/.local/lib/R/4.2’
(aslibis unspecified)
Error in find.package(pkgs, lib) : there is no package calledggplot2

I think it could be better if remove.packages also calls pacman first.

@Enchufa2
Copy link
Member

Enchufa2 commented Jul 7, 2022

We don't do that by choice, and this is a thoughtful decision based on several reasons. These are the main ones:

  1. One of our use cases is multitenancy, i.e., several users sharing the system library in a Linux server. In this scenario, we want easy installation, but not-so-easy uninstallation. Because we don't want one user to remove packages that another user may need.
  2. If we did this, imagine that you have an obsolete version of a package installed in your user library. At some point, this package could stop working with other up-to-date packages in the system library. You do have a copy of the proper version of the package in the system library (because your package manager is always watching over this). But your user library always takes precedence, so the installation doesn't work (this is not hypotetical, we know this has happened because we received bug reports for that). The solution is simple: uninstall the obsolete package version from your user library. But this integration would require you to call remove.packages two times ---one for the (good) system package, another for the user package---, and then install.packages to install the (good) system package back. And note that, in this process, you could lose a bunch of packages dependent on the first one that needs to be reinstalled. So... a real mess.

Therefore, it is possible to remove packages from the system, but it requires, by design, a thoughtful call to the proper function, which is bspm::remove_sys().

@sukanka
Copy link
Author

sukanka commented Jul 7, 2022

Oh, I get it! Thanks for your clear explanations!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants