I am able to replicate this error message by disconnecting myself from the internet, and attempting to install a package.
- You obviously have internet access to post this question to this forum, but are you connected when you try to install this package?
- You may also behind a proxy or firewall that prevents you connection to CRAN.
Check if this solution works for you, install.packages unable to access index for repository: Try disabling “secure download method for HTTP”,
That is, Global option -> Packages-> Use secure download method for HTTP.