Jonny Phelps
Jonny Phelps

Reputation: 2727

Install specific R version on Ubuntu-16.04

I'm a complete novice with Ubuntu. I've found questions that are the same as mine but I'm finding the advice difficult to follow.


Context

We have a dockerfile running from ubuntu:16.04. On this we install R along with other tools e.g git & sql.

The current method is to add this repo: add-apt-repository ppa:marutter/rrutter3.5 and call apt-get install r-base

This works fine but we're really worried about the R versions. Our code is being used in production on 3.5.2 R version. When we re-build the Docker image from scratch now the repo automatically updates us to 3.6.0. We want to be able to fix the R version until a later release when we can test 3.6.0 more

I've looked at https://hub.docker.com/_/r-base/, and can build a dockerfile with FROM r-base:3.5.2 with no problems. But combining it with my current dockerfile that installs the other tools e.g. git, is beyond me


Research

https://superuser.com/questions/1396699/how-to-install-r-3-5-1-on-ubuntu-16-with-apt-get

They say there is a way of pointing at the R version required and installing it from Source. Ideally I'd like to find a repository I can install the specific version from. If I can't, is this straightforward to do?

Install previous versions of R on ubuntu

The answer was hard for me to understand without more knowledge of ubuntu.

https://cloud.r-project.org/bin/linux/ubuntu/README.html

It links to this page, but I can't see how I would pick the R version. It only mentions 3.6 & 3.4

https://askubuntu.com/questions/435232/install-older-version-of-software-and-dependencies

In this one they specify r-base=3.0.2-1precise0. I tried this with r-base=3.5.2, but I'm guessing I need to change my repository from rrutter


I've spent a lot of time Googling this, but it's a bit of a minefield. Any guidance would be great! If I'm missing anything useful, I apologise. Let me know and I'll update my post

Best, Jonny

Upvotes: 2

Views: 997

Answers (1)

Boris van Katwijk
Boris van Katwijk

Reputation: 3188

You can create a Dockerfile using the r-base image and installing git:

FROM r-base:3.5.2

RUN apt-get update && \
    apt-get upgrade -y && \
    apt-get install -y git

Upvotes: 2

Related Questions