Score:3

Can´t install R 4.1 on Ubuntu Server 20.04 (Raspberry Pi)

cn flag
Hry

i have a fresh & clean install of Ubuntu Server 20.04 64bit running on my new raspberry pi 4.

The first thing i did was creating a new user with sudo privileges. This was followed by sudo update and sudo upgrade.

After that i tried to install R 4.1.0 (latest available R Version). I followed the guide on this page but i´m getting an error on step 3:

The following packages have unmet dependencies:
 r-base : Depends: r-base-core (>= 4.1.0-1.2004.0) but it is not going to be installed
          Depends: r-recommended (= 4.1.0-1.2004.0) but it is not going to be installed

When i run apt-cache policy r-base* the (relevant) output is this:

r-base-core:
  Installed: (none)
  Candidate: 3.6.3-2
  Version table:
     3.6.3-2 500
        500 http://ports.ubuntu.com/ubuntu-ports focal/universe arm64 Packages
        100 /var/lib/dpkg/status
r-base:
  Installed: (none)
  Candidate: 4.1.0-1.2004.0
  Version table:
     4.1.0-1.2004.0 500
        500 https://cloud.r-project.org/bin/linux/ubuntu focal-cran40/ Packages
        500 http://ppa.launchpad.net/marutter/rrutter4.0/ubuntu focal/main arm64 Packages
     4.0.5-1.2004.0 500
        500 https://cloud.r-project.org/bin/linux/ubuntu focal-cran40/ Packages
     4.0.4-1.2004.0 500
        500 https://cloud.r-project.org/bin/linux/ubuntu focal-cran40/ Packages
     4.0.3-1.2004.0 500
        500 https://cloud.r-project.org/bin/linux/ubuntu focal-cran40/ Packages
     4.0.2-1.2004.0 500
        500 https://cloud.r-project.org/bin/linux/ubuntu focal-cran40/ Packages
     4.0.1-1.2004.0 500
        500 https://cloud.r-project.org/bin/linux/ubuntu focal-cran40/ Packages
     4.0.0-1.2004.0 500
        500 https://cloud.r-project.org/bin/linux/ubuntu focal-cran40/ Packages
     3.6.3-2 500
        500 http://ports.ubuntu.com/ubuntu-ports focal/universe arm64 Packages

So the sources should be ok, but they don´t seem to find the r-base-core version 4.1.0 on the r-project repository - apt only finds the official ubuntu release, which is outdated... i don´t know what to do :(

Score:2
zw flag

This means that your arm64 arch is not supported by the 3rd party repositories.
Evidences are below:

So you have to remove 3rd-party repositories by

sudo add-apt-repository -r ppa:marutter/rrutter4.0
sudo add-apt-repository -r "deb https://cloud.r-project.org/bin/linux/ubuntu focal-cran40/"

and to continue using R 3.6 from official repositories on your RPi.
Or do fresh install of Ubuntu 21.04 which ships R 4.0 if you are sure about latest R version need.


Other option is to compile R 4.1 version locally. You need to enable source code repositories, then download the R source code, compile it and install compiled binaries and other components. Use commands below:

sudo sed -i "s/# deb-src/deb-src/g" /etc/apt/sources.list
sudo apt-get update
sudo apt-get build-dep r-base-dev

cd ~/Downloads
wget -c https://cran.r-project.org/src/base/R-4/R-4.1.0.tar.gz
tar -xf R-4.1.0.tar.gz
cd R-4.1.0
./configure
make -j9
sudo make install

Then you can run this locally installed R version.

N0rbert avatar
zw flag
Answer updated with instruction of R 4.1 compilation.
Hry avatar
cn flag
Hry
Thanks - you saved the day :)
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.