Download of package ‘terra’ failed

Hi. I have problems downloading the terra package. The message is:

Warning in install.packages :
downloaded length 54617208 != reported length 96919656
Warning in install.packages :
URL '': Timeout of 60 seconds was reached
Error in download.file(url, destfile, method, mode = "wb", ...) :
download from '' failed
Warning in install.packages :
download of package ‘terra’ failed

I already close all files on my RStudio hoping that it would be solved but the issue remains the same.

I am waiting for any helps toward this.
Thank you.

Check the GitHub infomation.

If you have Windows you need first install RTools. You need the "raster" , "Rcpp" and "
remotes" packages. Next install "terra" from github.


I tried this but it doesn't solve. Do you have any solutions?

This seems like a connectivity issue, R is not being able to complete the download from the CRAN repository you have selected, these are some things to try.

  • Choose a different CRAN repository, RStudios repository is a good choice ( or you could choose one that is geographically closer to you.
  • Disable secure download setting.
  • Check if your internet connection has traffic restrictions of some kind, like a firewall, proxy server, etc. This is usually the case when you are at work or school.

I already changed my CRAN repository to my country's but I still face the same problem. Also, I already checked my internet and it is good since I check the connection on both laptop and phone but the package cannot be downloaded.

Check this other problems:

May be update GDAL/PROJ.

But is very extranger this problem.
I think that you need update all the librarys or try whit RCloud.

@M_AcostaCH, in this case the installation process never actually starts because the download fails so the issues you are referencing are not relevant to this situation, or at least not yet.

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.