I have R in 3.6.3 version and I want to download 4.0.0 version. I downloaded from https://cran.r-project.org/src/base/R-4/ tar gz file but I have no idea how can I install it. Could you please give me a command which can install this R version from tar gz file ?
Asked
Active
Viewed 2,169 times
1
-
[This](https://stackoverflow.com/questions/4739837/how-do-i-install-an-r-package-from-the-source-tarball-on-windows) < might be of help to you. Do respond if it worked. – SophomoreNumberN Nov 25 '20 at 14:23
-
1That method is for compiling R from scratch. While it is possible and supported, I instead encourage you to use the installers for windows, found https://cran.r-project.org/bin/windows/. At a minimum, go to "base" and download the installer; it is often necessary (depending on the packages you intend to use) to install Rtools as well. – r2evans Nov 25 '20 at 14:23
-
@SophomoreNumberN, that's for installing tarballs of packages. I think the OP is trying to install a tarball of R itself (as suggested by the link). – r2evans Nov 25 '20 at 14:24
-
1@SophomoreNumberN I believe this solution is very good but only for packages – John Nov 25 '20 at 14:25
-
Just go to https://cran.r-project.org/, then download and install the version for your current OS. Alternatively, you can take a look at the package `installr` – tester Nov 25 '20 at 14:28
-
I wrote a [powershell script](https://gist.github.com/stevecondylios/477fba43bce461bfb1e11b2a4019b39d) that quickly installs RStudio and R on windows, but you'll have to replace the links to the most recent downloads as it still points to older software versions. Hope it helps – stevec Nov 25 '20 at 15:01
1 Answers
1
Install R from Source on Linux
You can find a detailed description for a range of different Linux systems here.
In short, you will need to run the following chain of commands:
First to install dependencies. This will depend on your Linux distribution. For Linux Mint, you can do
sudo apt-get build-dep r-base
Then, specify your desired R version
export R_VERSION=4.2.1
In a folder of your choice, download the .tar.gz (For versions other than 4.X, you may need to adjust the link)
curl -O https://cran.rstudio.com/src/base/R-4/R-${R_VERSION}.tar.gz
tar -xzvf R-${R_VERSION}.tar.gz
cd R-${R_VERSION}
To build and install, run from the same shell
./configure \
--prefix=/opt/R/${R_VERSION} \
--enable-memory-profiling \
--enable-R-shlib \
--with-blas \
--with-lapack
make
sudo make install
In case the ./configure ...
step does not work out, you may need to install the missing binaries individually by hand.
You can check the installation by running
/opt/R/${R_VERSION}/bin/R --version
and create a symlink
sudo ln -s /opt/R/${R_VERSION}/bin/R /usr/local/bin/R
sudo ln -s /opt/R/${R_VERSION}/bin/Rscript /usr/local/bin/Rscript
Done!
Your R installation will be in
/opt/R/${R_VERSION}

Scriddie
- 2,584
- 1
- 10
- 17