R | Unable to Install Packages RStudio Issue (SOLVED)

If you are unable to install packages issue in R Studio, and facing any of the below mentioned error, you have landed on the right page:

Warning in install.packages :
unable to access index for repository https://cran.rstudio.com/src/contrib:
cannot open URL 'https://cran.rstudio.com/src/contrib/PACKAGES'
Warning in install.packages :
package ‘PACKAGE NAME’ is not available (for R version 3.6.0)
Warning in install.packages :
unable to access index for repository https://cran.rstudio.com/bin/windows/contrib/3.6:
cannot open URL 'https://cran.rstudio.com/bin/windows/contrib/3.6/PACKAGES'

Solution:

Solution 1: Use R code to solve install.package()

Use below command before using install.packages(“PACKAGE NAME”)

options(repos = c(CRAN = “http://cran.rstudio.com”))

install.packages(“package name“)

Solution 2: Use RStudio

Changing the configuration in R Studio to solve install packages issue.

Go To Tools -> Global option -> Packages. Then uncheck the option “Use secure download method for HTTP”.

problem unable to install package in R Studio solution
RStudio: Tools -> Global option -> Packages
problem unable to install package in R Studio solution
Rstudio: Under Packages uncheck the option“Use secure download method for HTTP”

For other RStudio issues refer to official Troubleshooting Guide here.

Conclusion

I certainly hope that this guide will help people spend less time figuring about package install debugging and leave more time for data analysis and development.

Start your Data Science Journey here.

Leave a Comment