r-lib / pak

A fresh approach to package installation
https://pak.r-lib.org
643 stars 56 forks source link

Automated install / Reinstall entire library #519

Open royfrancis opened 1 year ago

royfrancis commented 1 year ago

I am wondering if there is a convenient way to reinstall an entire package library from a system to another system. I know that renv is used for this, but I want to avoid using that. I can see that pak::pkg_list() gives a data.frame of installed packages along with remote refs. Can this data.frame be passed to pak::pkg_install() or something and reinstall the same packages, versions and from same sources?

gaborcsardi commented 1 year ago

It is not so simple because it might be impossible to tell where packages were installed from, they might not be available at the place they were installed from, etc.

If you use pkg_list() and you don't install packages from too many or too obscure sources, then you might be able to put something together.

royfrancis commented 1 year ago

I agree that it might not be possible to install everything perfectly. It would still be nice to install what it can and print a list of uninstallable packages (#520). In fact, even before installation, it would be awesome if pkg_list() can be used to "check" what can and cannot be installed and give an overview.