# R image cran repo fixed to older release

**URL:** <https://renku.discourse.group/t/r-image-cran-repo-fixed-to-older-release/413>\
**Category:** RenkuLab\
**Created:** [15 September 2021 10:49 UTC](https://renku.discourse.group/t/r-image-cran-repo-fixed-to-older-release/413 "2021-09-15T10:49:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![a\_user](https://avatars.discourse-cdn.com/v4/letter/a/a8b319/32.png) [@a\_user](https://renku.discourse.group/u/a_user)\
**Post date:** [15 September 2021 10:49 UTC](https://renku.discourse.group/t/r-image-cran-repo-fixed-to-older-release/413/1 "2021-09-15T10:49:45Z")

</div>

Hi all

We’re currently setting up an R based image and are installing a number of packages, including “rfishbase”. That package specifically had an update recently (3.1.9), but installing it in our image installs an older version (3.1.7).

We are using the most recent base image renku/renkulab-r:4.0.5-0.8.0

I found that the cran repository is fixed to an older version from earlier this year:

> options(“repos”)  
> $repos  
> CRAN  
> “[https://packagemanager.rstudio.com/cran/linux/focal/2021-05-17](https://packagemanager.rstudio.com/cran/linux/focal/2021-05-17)”

A bunch of questions to that:  
Where is that repo specified?  
Do you have any package caching in place or can I just overwrite the repo in the install.R file?

Thanks and cheers

---

<div class="post-metadata">

**Author:** ![gavin-k-lee](https://yyz2.discourse-cdn.com/free1/user_avatar/renku.discourse.group/gavin-k-lee/32/233_2.png) [@gavin-k-lee](https://renku.discourse.group/u/gavin-k-lee)\
**Post date:** [15 September 2021 12:29 UTC](https://renku.discourse.group/t/r-image-cran-repo-fixed-to-older-release/413/2 "2021-09-15T12:29:25Z")

</div>

Hi there,

Thanks for reporting that. The repo is inherited from some of the Rocker images that we use to build Renku images. There is a way to specify the specific version numbers in R.

In your install.R file you can put this code:

```auto
require(devtools)

install_version("rfishbase", version = "3.1.9", repos = "http://cran.us.r-project.org")

```

which will pull the version you want. When I start a session in that project, I can call rfishbase with the right version:

 ![image](https://global.discourse-cdn.com/free1/uploads/renku/original/1X/1acaeb216c5bdeecefa7c60e4953a22b9f1866cd.png)

Let us know if this still doesn’t solve the issue.

Cheers!  
Gavin

---

<div class="post-metadata">

**Author:** ![a\_user](https://avatars.discourse-cdn.com/v4/letter/a/a8b319/32.png) [@a\_user](https://renku.discourse.group/u/a_user)\
**Post date:** [15 September 2021 13:12 UTC](https://renku.discourse.group/t/r-image-cran-repo-fixed-to-older-release/413/3 "2021-09-15T13:12:42Z")

</div>

Hi Gavin

Thanks for that snippet. I looked into the rocker images, they seem to fix the repo for reproducibility.

Using your snippet for selecting a version works just as well as this for installing the latest one:

```auto
install.packages('rfishbase',dependencies=TRUE, repos='http://cran.rstudio.com/')

```

I found the documentation on setting up a newer repo version with the rstudio package manager:  
[https://packagemanager.rstudio.com/client/#/repos/1/overview](https://packagemanager.rstudio.com/client/#/repos/1/overview)

cheers
