Skip to content

Do not use the alternative Archive URL on PPM #623

Description

@gaborcsardi

Because sometimes PPM serves a source package there, while serving a binary at the proper URL:

! error in pak subprocess
Caused by error in `verify_extracted_package(filename, pkg_cache)`:
! 
'/tmp/RtmpraRRfO/file10aed93d50/src/contrib/x86_64-pc-linux-gnu-ubuntu-22.04/4.4/later_1.3.2.tar.gz'
is not a valid binary, it is missing later/Meta/package.rds.

pak only uses the alternative URL for a repo named 'CRAN', so a workaround is to name your repo something else, e.g. 'PPM' seems appropriate.

Activity

  1. added
    bugan unexpected problem or unintended behavior
    on May 2, 2024
  2. gaborcsardi commented on May 2, 2024

    @gaborcsardi
    MemberAuthor

    We only use it if the repo is called CRAN, but that's not enough, because people sometimes use PPM with the name CRAN.

  3. gaborcsardi commented on May 2, 2024

    @gaborcsardi
    MemberAuthor

    This needs to be fixed somewhere here: https://github.com/r-lib/pkgcache/blob/c227fe90b20959ac0d3f4e8a2897ed9117f70ee0/R/packages-gz.R#L311
    Maybe we can filter based on the URL, e.g. if the URL contains __linux__. It should only matter on Linux, on other platforms we don't use the Archive.

  4. alethor commented on May 3, 2024

    @alethor

    I'm slightly confused about how this workaround works, could you give a concrete example?

  5. gaborcsardi commented on May 3, 2024

    @gaborcsardi
    MemberAuthor

    @alethor

    > options(repos = c(CRAN = "https://packagemanager.posit.co/cran/__linux__/jammy/latest"))
    
    > pak::pkg_install("hommel")
    ✔ Updated metadata database: 3.70 MB in 9 files.
    ✔ Updating metadata database ... done
    
    → Will install 1 package.
    → Will download 1 package with unknown size.
    + hommel   1.6 [dl]
    
    ℹ Getting 1 pkg with unknown size
    ✔ Got hommel 1.6 (x86_64-pc-linux-gnu-ubuntu-22.04) (11.43 kB)
    ✔ Downloaded 1 package (11.43 kB) in 1.3s
    Error:
    ! error in pak subprocess
    Caused by error in `verify_extracted_package(filename, pkg_cache)`:
    ! /tmp/RtmpZFurxM/file31416a7e1f/src/contrib/x86_64-pc-linux-gnu-ubuntu-22.04/4.4/hommel_1.6.tar.gz is not a valid binary, it is
    missing hommel/Meta/package.rds.
    Type .Last.error to see the more details.
    

    OTOH:

    > options(repos = c(PPM = "https://packagemanager.posit.co/cran/__linux__/jammy/latest"))
    > pak::pkg_install("hommel")
    ✔ Updated metadata database: 4.79 MB in 4 files.
    ✔ Updating metadata database ... done
    
    → Will install 1 package.
    → Will download 1 package with unknown size.
    + hommel   1.6 [dl]
    
    ℹ Getting 1 pkg with unknown size
    ✔ Got hommel 1.6 (x86_64-pc-linux-gnu-ubuntu-22.04) (206.95 kB)
    ✔ Downloaded 1 package (206.95 kB) in 1.1s
    ✔ Installed hommel 1.6  (1s)
    ✔ 1 pkg + 1 dep: kept 1, added 1, dld 1 (206.95 kB) [10.9s]
    
  6. gaborcsardi commented on May 3, 2024

    @gaborcsardi
    MemberAuthor

    This is now fixed in the nightly builds, install like this: https://pak.r-lib.org/reference/install.html#nightly-builds

  7. added a commit that references this issue on May 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugan unexpected problem or unintended behavior

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions