> ## Documentation Index
> Fetch the complete documentation index at: https://docs.domino.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Unable to install R package | Error : Package is not available for your version of R

> Fix the "package is not available for this version of R" CRAN error by specifying an alternate mirror inline or updating your default mirror in .Rprofile or rsession.conf.

## **Issue**

When building an environment or installing a package inside a workspace, R raises an error similar to the following:

```
Warning in install.packages :
  package 'renv' is not available for this version of R

Warning in install.packages :
  unable to access index for repository https://cran.us.r-project.org/bin/...:
  cannot open URL 'https://cran.us.r-project.org/bin/.../PACKAGES'
```

The package isn't available from the default Comprehensive R Archive Network (CRAN) mirror ([https://cran.us.r-project.org/](https://cran.us.r-project.org/)) configured for this environment. The same package may be available from a different CRAN mirror.

## **Quick fix: specify a different CRAN mirror inline**

Pass a different repo argument directly to install.packages():

`install.packages("renv", repo = "https://cran.r-project.org/")`

This overrides the default mirror for this one installation call without changing any configuration files.

## **Permanent fix: update the default CRAN mirror**

To avoid specifying the `repo` argument every time, update the default CRAN mirror using one of the options below.

### **Option 1: edit `rsession.conf` in your compute environment**

Add the r-cran-repos setting to your rsession.conf file and point it to the correct CRAN mirror. For example:

`r-cran-repos=https://cran.r-project.org/`

Locate rsession.conf in your compute environment's R session configuration directory.

### **Option 2: edit .Rprofile or Rprofile.site**

Set the default CRAN mirror in your .Rprofile or Rprofile.site file. Find both files under your R home directory. Add the following:

`options(repos = c(CRAN = "https://cran.r-project.org/"))`

* .Rprofile — applies settings for your user session only

* Rprofile.site — applies settings for all users on the system

After saving either file, restart your R session for the changes to take effect.


## Related topics

- [ERROR: Could not install packages due to an EnvironmentError: [Errno 13] Permission denied:](/knowledge-base/error-could-not-install-packages-due-to-an-environmenterror-errno-13-permission-denied.md)
- [Troubleshooting](/knowledge-base/troubleshooting-overview.md)
- [R package](/cloud/reference/r-package/domino-r-package.md)
- [Installing Archived R Packages No Longer Available on CRAN](/knowledge-base/installing-r-packages-from-archive.md)
