Failing to install tidyverse after updating R to 4.1.2

Question
Hello,
I just updated R from 4.0.1 to 4.1.2 and I fail to reinstall tidyverse.

Code

install.packages("tidyverse")

Environment
R: 4.1.2
RStudio: "Ghost Orchid" Release (8b9ced18, 2021-11-08) for macOS

Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) QtWebEngine/5.12.10 Chrome/69.0.3497.128 Safari/537.36

**Error message **
Retrieving 'https://cran.rstudio.com/bin/macosx/contrib/4.1/tidyverse_1.3.1.tgz' ...
OK [file is up to date]
/usr/bin/tar xf '~/Library/Application Support/renv/binary/R-4.1/x86_64-apple-darwin17.0/repository/tidyverse/tidyverse_1.3.1.tgz' -C '/var/folders/nx/ffcrpmcx7n7143gn07z9pt7m0000gn/T//RtmpG3xuCE/renv-description-388123cd9af8' 'tidyverse/DESCRIPTION'

tar: Error opening archive: Failed to open '~/Library/Application Support/renv/binary/R-4.1/x86_64-apple-darwin17.0/repository/tidyverse/tidyverse_1.3.1.tgz'
Erreur : error decompressing archive [error code 1]
Traceback (most recent calls last):
18: install.packages("tidyverse")
17: install(pkgs)
16: retrieve(names(remotes))
15: handler(package, renv_retrieve_impl(package))
14: renv_retrieve_impl(package)
13: renv_retrieve_repos(record)
12: renv_retrieve_repos_impl(record)
11: renv_retrieve_package(record, url, path)
10: renv_retrieve_successful(record, path)
9: renv_description_read(path, subdir = subdir)
8: filebacked(scope = "DESCRIPTION", path = path, callback = renv_description_read_impl,
subdir = subdir, ...)
7: callback(path, ...)
6: renv_archive_decompress(path, files = file, exdir = exdir)
5: renv_archive_decompress_tar(archive, files = files, exdir = exdir,
...)
4: renv_tar_decompress(tar, archive = archive, files = files, exdir = exdir,
...)
3: renv_system_exec(tar, args, action = "decompressing archive")
2: stopf(fmt, action, status)
1: stop(sprintf(fmt, ...), call. = call.)

Thank you very much in advance,

You seem to be using renv, packages in your package cache might not be compiled for the new R version and that could be causing the problem, try with

renv::restore(rebuild = TRUE)

It's a bug in renv. See Error updating packages: `*.tar.gz: Cannot open: No such file or directory` · Issue #953 · rstudio/renv · GitHub for more details.

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.