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

Error when trying to install spacific packages: "is not a valid R package, it is an empty archive" #658

Open
apcamargo opened this issue Jul 2, 2024 · 1 comment

Comments

@apcamargo
Copy link

When trying to install some specific packages (geosphere, and fullRankMatrix), I get the following error:

> pak::pkg_install("fullRankMatrix")
                                                                           
→ Will install 1 package.
→ Will download 1 package with unknown size.
+ fullRankMatrix   0.1.0 [dl]
  
ℹ Getting 1 pkg with unknown size
✔ Cached copy of fullRankMatrix 0.1.0 (x86_64-pc-linux-gnu-ubuntu-22.04) is the latest build
✔ No downloads needed, all packages are cached                               
Error:                                                                  
! error in pak subprocess
Caused by error in `verify_extracted_package(filename, pkg_cache)`:
! 
/tmp/RtmpayG4sq/file1ab472c47dc/src/contrib/x86_64-pc-linux-gnu-ubuntu-22.04/4.4/fullRankMatrix_0.1.0.tar.gz
is not a valid R package, it is an empty archive.
Type .Last.error to see the more details.

install.packages works normally. This was previously described in a closed issue (#518). Just as the author of that issue, I don't have storage limitations.

I'm running R from a container that was create from the following Dockerfile:

FROM rocker/tidyverse:latest

RUN apt-get update \
    && apt-get install -y --no-install-recommends \
    libglpk-dev libxt-dev cmake build-essential libcurl4-openssl-dev libnode-dev libnlopt-dev

RUN R -q -e 'install.packages("pak")'
RUN R -q -e 'pak::pkg_install(c("brunnermunzel", "ggforce", "patchwork", "gt", "khroma", "Biostrings", "viridis", "gtools", "dunn.test", "fs", "ggokabeito", "ggtree", "ggtreeExtra", "ggnewscale", "Peptides", "lmerTest", "gluedown", "TreeDist", "Quartet", "cowplot", "ape", "phytools", "ggblend", "ggseqlogo", "bio3d", "colorspace", "plotwidgets", "PCAtools", "cluster", "dbscan", "sf", "rnaturalearth", "rnaturalearthdata", "styler"))'
@drkrynstrng
Copy link

drkrynstrng commented Dec 10, 2024

This issue happens when the first path in .libPaths() is not writable by the user.

For Rocker container images, currently this happens because the user's writable library is set as the last path. See this issue: rocker-org/rocker-versioned2#857

One solution is to re-order the library paths so that the user's writable library is set as the first path. Something like:

.libPaths("~/R/x86_64-pc-linux-gnu-library/4.4")

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