[R] update.packages() fails due to searching for old versions of packages
Rui Barradas
ru|pb@rr@d@@ @end|ng |rom @@po@pt
Sat Dec 20 23:34:20 CET 2025
Às 19:30 de 20/12/2025, Michael McQuaid escreveu:
> When I try to update packages, the package manager appears to search for
> old versions of the packages, despite seemingly knowing about the existence
> of newer versions. Here is an example where I try to update the e1071
> package and it seems to recognize that the current version is 1.7-17 but
> then searches for and fails to find 1.7-16. This happens for every package
> I try to update, I've just included one here for brevity. I have tried
> several mirrors including wustl, utk, and iastate. I wonder if there is
> some file on my system pointing to the old version. I also tried updating
> from R 4.5.1 to 4.5.2, but the issue persists. I am on macOS Tahoe 26.2 on
> an M1 Macbook Pro.
>
> $ Rscript -e 'update.packages(oldPkgs=c("e1071"))'
> e1071 :
> Version 1.7-16 installed in /Users/mm223266/Library/R/arm64/4.5/library
> Version 1.7-17 available at https://cloud.r-project.org
> Update? (Yes/no/cancel)
> trying URL '
> https://cloud.r-project.org/bin/macosx/big-sur-arm64/contrib/4.5/e1071_1.7-16.tgz
> '
> Error in download.file(urls, destfiles, "libcurl", mode = "wb", ...) :
> cannot open URL '
> https://cloud.r-project.org/bin/macosx/big-sur-arm64/contrib/4.5/e1071_1.7-16.tgz
> '
> In addition: Warning messages:
> 1: In download.file(urls, destfiles, "libcurl", mode = "wb", ...) :
> downloaded length 0 != reported length 279
> 2: In download.file(urls, destfiles, "libcurl", mode = "wb", ...) :
> cannot open URL '
> https://cloud.r-project.org/bin/macosx/big-sur-arm64/contrib/4.5/e1071_1.7-16.tgz':
> HTTP status was '404 Not Found'
> Warning in download.packages(pkgs, destdir = tmpd, available = available, :
> download of package ‘e1071’ failed
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide https://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
Hello,
R 4.5.2 on Windows 11, sessionInfo at end.
I cannot reproduce this on Windows 11 but I am getting another error.
>Rscript -e "update.packages(oldPkgs=c('e1071'))"
Error in contrib.url(repos, type) :
trying to use CRAN without setting a mirror
Calls: update.packages -> available.packages -> unique -> contrib.url
Execution halted
So I don't have a default mirror set.
But after explicitly passing one, it works as expected.
Rscript -e "update.packages(oldPkgs=c('e1071'), repos =
'https://cloud.r-project.org')"
Warning: package 'mgcv' in library 'C:/Program Files/R/R-4.5.2/library'
will not be updated
e1071 :
Version 1.7-16 installed in C:/Program Files/R/R-4/site-library
Version 1.7-17 available at https://cloud.r-project.org
Update? (Yes/no/cancel)
There is a binary version available but the source version is later:
binary source needs_compilation
e1071 1.7-16 1.7-17 TRUE
installing the source package 'e1071'
trying URL 'https://cloud.r-project.org/src/contrib/e1071_1.7-17.tar.gz'
Content type 'application/x-gzip' length 318056 bytes (310 KB)
==================================================
downloaded 310 KB
The version being installed is e1071_1.7-17.tar.gz
>Rscript -e "packageVersion('e1071')"
[1] '1.7.17'
>Rscript -e "sessionInfo()"
R version 4.5.2 (2025-10-31 ucrt)
Platform: x86_64-w64-mingw32/x64
Running under: Windows 11 x64 (build 22631)
Matrix products: default
LAPACK version 3.12.1
locale:
[1] LC_COLLATE=Portuguese_Portugal.utf8 LC_CTYPE=Portuguese_Portugal.utf8
[3] LC_MONETARY=Portuguese_Portugal.utf8 LC_NUMERIC=C
[5] LC_TIME=Portuguese_Portugal.utf8
time zone: Europe/Lisbon
tzcode source: internal
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] compiler_4.5.2
Hope this helps,
Rui Barradas
More information about the R-help
mailing list