Since March of this year, Debian Buster (Debian 10) has been frozen and has become the new stable release and for this reason the installation of R 3.6.0 (available since April 26th) on Buster requires the backports kindly provided by Johannes Ranke. Yesterday, I decided to install R 3.6.0 on my computer, so I used them, which basically means that:
- I appended
deb http://cran.wu.ac.at/bin/linux/debian buster-cran35/
to/etc/apt/sources.list
; - I added the key to configure the secure apt.
In order to do a fresh install, I first removed all the files related to R 3.5.2, i.e. I opened a terminal and entered:
# apt-get --purge remove r-base r-base-dev r-base-core
Then, I installed the new version
# apt-get update
# apt-get install r-base r-base-dev r-base-core
After that, R 3.6.0 was installed and ready to do stats ✅. Before installing my list of packages, I took two extra steps. First, I configured Java for R (because some packages need it).
# R CMD javareconf JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/
Second, I edited Renviron.site
. For Debian-based linux distributions, R 3.6.0
is now shipped with a Renviron.site
file that includes the following line:
_R_CHECK_COMPILATION_FLAGS_KNOWN_='-Wformat -Werror=format-security -Wdate-time'
which avoids a note when checking a package. I edited this file to add back my list of default packages and the token I used for rcites:
R_DEFAULT_PACKAGES='utils,datasets,grDevices,graphics,stats,methods,devtools'
# TOKENS
SPECIESPLUS_TOKEN='cannot_reveal_iit'
Note that if I would have opened R at this stage it would have complained about uninstalled packages 😉.
Once done, I installed the set of 📦 I employ the most. In the past, I
have used sudo apt-get install "r-cran-.*"
but decided not to this time.
First, because I do not use all of them. Second, because I have found some
conflicts. For instance, I wasn’t able to install both r-cran-rmarkdown
and
r-cran-v8
: the latter requires libnode64
while the former requires nodejs
which are not compatible… So if I try to install r-cran-rmarkdown
while
r-cran-v8
is installed, I get:
The following packages will be REMOVED:
libnode64
To overcome such issue, I cherry-picked the set of packages to be installed with apt-get
and here is my list of packages (note that it triggers the installation of a longer list):
# apt-get install r-cran-v8
# apt-get install "r-cran-rcpp.*" r-cran-reticulate r-cran-rjava r-cran-devtools r-cran-doparallel r-cran-sf r-cran-lwgeom r-cran-lme4 r-cran-ade4 r-cran-ape r-cran-vegan r-cran-rgl r-cran-webshot r-cran-cli r-cran-pillar r-cran-taxize r-cran-repr r-cran-reprex r-cran-biocmanager
By the way, if you are looking for a specific package with apt-get
, you can
use apt search "r-cran-"
for CRAN packages, and apt search "r-bioc-"
for
Bioconductor ones. This being done, I opened R and did a quick check of the
default paths to library :
|
|
Packages installed where in two of these 3:
/usr/lib/R/library
includes all the core and recommended packages./usr/lib/R/site-library
includes the packages installed viaapt-get
I decided to use /usr/local/lib/R/site-library
to store packages I would
install via install.packages()
. To do so, I simply changed the permission to
make this folder writable by myself without using super user privileges: sudo chmod 777 /usr/local/lib/R/site-library
. Then, I completed the installation:
|
|
This way, I do not need to use a user library which I don’t really need as I am the only user of my computer 😅.
To conclude this post, I’d like to show the list of packages included in the 3 different folders:
|
|
As you may have noticed, some packages are installed in both /usr/local/lib/R/site-library
and in /usr/lib/R/site-library
:
|
|
and R uses the one from /usr/local/lib/R/site-library
:
|
|
Why are they installed twice? I don’t know yet! But I sure will let you know when I understand this!