Download of package ‘terra’ failed - solution

I had difficulties installing the "terra" package:

Warning in install.packages :
  URL 'http://mirror.aarnet.edu.au/pub/CRAN/bin/macosx/contrib/4.1/terra_1.4-22.tgz': Timeout of 60 seconds was reached
Error in download.file(url, destfile, method, mode = "wb", ...) : 
  download from 'http://mirror.aarnet.edu.au/pub/CRAN/bin/macosx/contrib/4.1/terra_1.4-22.tgz' failed

I found a post by @tessaulaen on this topic at Download of package ‘terra’ failed, with no solution recorded.
Like tessaluen, I had tried several mirrors with the same response.

I navigated to the base page of the mirror (mine was http://mirror.aarnet.edu.au/pub/CRAN/bin/macosx/contrib/4.1) and found the terra package by doing a find on the page. I observed the package is much larger than most packages, at over 90Mb - likely the cause of the problem. I downloaded it manually by right clicking on it and choosing "Save link as..."

Once it was downloaded I installed it from the local file with

install.packages("~/Downloads/terra_1.4-22.tgz", repos=NULL, type="source")

I hope this solution helps others with the same problem.

1 Like