0

I have a new computer in the same network as the old one. In the new one, I first installed RStudio, then the latest version of R (I hope the order does not matter). Now, the new R installation gets "unable to access index for repository" error for every library. Simple task becomes hours of googling, during which I tried the following:

  1. tick or untick use secure download method for http in global options (was ticked in the old computer)
  2. try different, close my location repositories in global settings
  3. copy the folder of an existing package (like ggplot2) from the old computer to the new one's library folder (does not become visible in packages pane)
  4. uninstall and reinstall R
  5. compare installations (the only difference is that in the old computer, folder RTools is under c:/program files while in the new one I accepted the standard location and folder (c:/Rtools40)

Please note that both computers are in the same corporate network, so the firewall and other network settings are the same.

Phil
  • 7,287
  • 3
  • 36
  • 66
Peter
  • 31
  • 3
  • [Unable to access index for repository](https://community.rstudio.com/t/unable-to-access-index-for-repository-warning-in-install-packages/111314/10) – Isaiah Nov 10 '22 at 08:22
  • I have had new corporate machines arrive with tighter security than the old machine. If you hotspot through your phone, without VPN, what happens? Also, if you ping cran.rstudio.com what happens? – Isaiah Nov 10 '22 at 08:30
  • With hotspots, I still have to connect to network via VPN. Ping, tracert etc. are disabled (same thing with the old laptop). I can visit the cran.rstudio.com website, though. – Peter Nov 11 '22 at 12:15
  • I also checked the link provided by Isaiah. Both .rprofile and Rprofile.Site files are located in c:/users/username/AppData/local/Programs/R/R-4.2.2/ (first one in library/base subfolder). Both are last modified in 2018 or 2020, i.e. they came with the installation. Not sure why I should edit them. – Peter Nov 11 '22 at 12:36

1 Answers1

0

Finally I found the reason: our company uses an internal repository that mirrors an external one. After inserting a custom repository, everything worked perfectly.

I hope this helps if someone runs to a similar problem.

Thanks everyone for your comments!

Peter
  • 31
  • 3
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Nov 15 '22 at 16:13