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

Function to upgrade world #639

Open
latot opened this issue Jun 4, 2024 · 4 comments
Open

Function to upgrade world #639

latot opened this issue Jun 4, 2024 · 4 comments

Comments

@latot
Copy link

latot commented Jun 4, 2024

Hi, pak is working very well rn, I think would be great to have a function to upgrade all libraries, the actual pak::pkg_install also only supports one package at a time, rn the only workaround I found is iterate over all the packages and run pak to install/upgrade them.

Thx!

@gaborcsardi
Copy link
Member

the actual pak::pkg_install also only supports one package at a time

I don't think that's true:

pak::pkg_install(c("filelock", "nanoparquet"), lib = tempfile())

works fine.

We'll have a lib_upgrade() function to upgrade all packages, eventually: #168

@latot
Copy link
Author

latot commented Jun 5, 2024

Weird! here an example of a vector that does not works.

pak::pkg_install(pak::lib_status()$package)
Error: 
! error in pak subprocess
Caused by error in `asNamespace("pak")$lib_status_internal(...)`:
! unused arguments (pkg = c("ape", "askpass", "backports", "base64enc", "BH", "bit", "bit64", "blob", "boot", "brew", "brio", "bslib", "bugs", "cachem", "callr", "cellranger"..............................

Type .Last.error to see the more details.

Also the tempfile() case return File or folder does not exists.

@gaborcsardi
Copy link
Member

That's a lazy evaluation mishap, use

pkgs <- pak::lib_status()$package
pak::pkg_install(pkgs)

But of course this will fail as soon as you have a package installed that is not available from CRAN. It'll also replace your non-CRAN installs with CRAN packages.

@latot
Copy link
Author

latot commented Jun 5, 2024

no idea which part is a lazy evalualtion... seems some parts there are not that intuitive, but still was just a trick to try upgrade all.

Maybe is just better to wait for the function to upgrade the system.

Also, I have installed some packages that are not in CRAN, and running pkg_install does not fails with them, is that right?

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