DaddyTheRunner
Posts: 8
Joined: Sun Sep 13, 2015 11:56 pm

Help Installing R 3.3.1 from Raspbian Stretch

Sat Oct 22, 2016 1:31 am

Hello,

I have successfully install R from the stable version of Raspbian Jessie (version 3.1.1). Unfortunately, some of the R packages I want to use are not compatible or available for this older version.

I want to install the latest version of R (version 3.3.1) which is available via the stretch repository. However, when I add stretch to the /etc/apt/sources.list file, apt-get install r-base wants to make way too many upgrades to my system. For example it wants to remove python3-rpi.gpio as well as a bunch of other python3 stuff. Also it wants to upgrade python3 to version 3.5.

In total, it wants to upgrade 73 packages, install 48 new packages, and remove 14. This seems a bit excessive. Is there a way to simply upgrade from R version 3.1.1 to R version 3.3.1 without including all of the extra stuff I suspect is bloat. I call it bloat because apt-get seems to want to make all of the same changes regardless of what package I want to install once I add stretch to the sources.list file. Therefore, I really doubt it is all necessary just to upgrade R to the latest available version.

Thanks in advance for any advice and help you can provide.

User avatar
rpdom
Posts: 20857
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Help Installing R 3.3.1 from Raspbian Stretch

Sat Oct 22, 2016 6:22 am

It is not "bloat", it is just trying to make sure that you have the latest version of installed software based on the releases you have selected.

It is possible to "pin" Stretch to a low priority so apt will only install software you select and anything it actually depends on.

Create a file /etc/apt/preference.d/stretch with these contents:

Code: Select all

Package: *
Pin: release n=Stretch
Pin-Priority: 10
Now when you apt-get update and apt-get upgrade your Pi, it shouldn't try installing anything from Stretch.

To install packages from Stretch you will have to specify it:

Code: Select all

apt-get install -t stretch r-base
You will still get quite a few extra packages installed as the updated version needs newer libraries and that will affect the whole system

DaddyTheRunner
Posts: 8
Joined: Sun Sep 13, 2015 11:56 pm

Re: Help Installing R 3.3.1 from Raspbian Stretch

Sat Oct 22, 2016 5:29 pm

Thanks for the information. I'll give it a try. I fully understand the need for updated libraries. However, I knew there were additional unnecessary packages because R does not require Python. Therefore, I was surprised to see it wanting to update Python 3.4 to 3.5 as well as the LibreOffice upgrades which I also knew were unnecessary for updating R.

Return to “Advanced users”