The Raspberry Pi 4 is a great incremental improvement of the RPi platform. It handles Ubuntu 20.10 64-bit decently.
I mainly use R for my data-science practice, and I wanted to try R on this RPi. As of November 29, 2020, there are no pre-built packages I can use to install R. At a minimum, no r-base-core package is available for the arm64 platform at the R package repository. You have to compile R yourself.
Here’s a way to do it. AndrĂ©s Castro Socolich provided most of this, and I edited a couple of steps. Open a terminal window (Ctrl-Alt-T) and run the below lines, one at a time. Be advised: I have an RPi 4 with 8 GB RAM, and it used almost half the RAM at one point. Also, the first make command will take a long time.
sudo apt update
sudo apt upgrade
sudo apt-get install -y gfortran libreadline6-dev libx11-dev libxt-dev libpng-dev libjpeg-dev libcairo2-dev xvfb libzstd-dev texinfo texlive texlive-fonts-extra screen wget zlib1g-dev libbz2-dev liblzma-dev libpcre2-dev libcurl4-openssl-dev openjdk-11-jdk
cd /usr/local/src
sudo wget https://cran.rstudio.com/src/base/R-4/R-4.0.3.tar.gz
sudo su
tar zxvf R-4.0.3.tar.gz
cd R-4.0.3
./configure --enable-R-shlib
make
make install
cd ..
rm -rf R-4.0.3*
exit
cd
You’re done! To run R, type R
(yes, capital R) at the command prompt.