With help from this forum, I was able to get R and RStudio working on Zorin 16 Lite. I now need to install the 'tidyverse' package for R, but attempting the install gives this error:
$ sudo R
(R starts up)
> install.packages("tidyverse")
Installing package into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
Warning: dependencies ‘MASS’, ‘lattice’ are not available
also installing the dependencies ‘nlme’, ‘Matrix’, ‘mgcv’, ‘systemfonts’, ‘textshaping’, ‘ggplot2’, ‘ragg’, ‘rvest’, ‘xml2’
trying URL 'https://cloud.r-project.org/src/contrib/nlme_3.1-163.tar.gz'
Content type 'application/x-gzip' length 848981 bytes (829 KB)
==================================================
downloaded 829 KB
trying URL 'https://cloud.r-project.org/src/contrib/Matrix_1.6-1.1.tar.gz'
Content type 'application/x-gzip' length 2065748 bytes (2.0 MB)
==================================================
downloaded 2.0 MB
trying URL 'https://cloud.r-project.org/src/contrib/mgcv_1.9-0.tar.gz'
Content type 'application/x-gzip' length 1112050 bytes (1.1 MB)
==================================================
downloaded 1.1 MB
trying URL 'https://cloud.r-project.org/src/contrib/systemfonts_1.0.5.tar.gz'
Content type 'application/x-gzip' length 80638 bytes (78 KB)
==================================================
downloaded 78 KB
trying URL 'https://cloud.r-project.org/src/contrib/textshaping_0.3.7.tar.gz'
Content type 'application/x-gzip' length 35100 bytes (34 KB)
==================================================
downloaded 34 KB
trying URL 'https://cloud.r-project.org/src/contrib/ggplot2_3.4.4.tar.gz'
Content type 'application/x-gzip' length 3159578 bytes (3.0 MB)
==================================================
downloaded 3.0 MB
trying URL 'https://cloud.r-project.org/src/contrib/ragg_1.2.6.tar.gz'
Content type 'application/x-gzip' length 425391 bytes (415 KB)
==================================================
downloaded 415 KB
trying URL 'https://cloud.r-project.org/src/contrib/rvest_1.0.3.tar.gz'
Content type 'application/x-gzip' length 94659 bytes (92 KB)
==================================================
downloaded 92 KB
trying URL 'https://cloud.r-project.org/src/contrib/xml2_1.3.5.tar.gz'
Content type 'application/x-gzip' length 272664 bytes (266 KB)
==================================================
downloaded 266 KB
trying URL 'https://cloud.r-project.org/src/contrib/tidyverse_2.0.0.tar.gz'
Content type 'application/x-gzip' length 704618 bytes (688 KB)
==================================================
downloaded 688 KB
ERROR: dependency ‘lattice’ is not available for package ‘nlme’
* removing ‘/usr/local/lib/R/site-library/nlme’
ERROR: dependency ‘lattice’ is not available for package ‘Matrix’
* removing ‘/usr/local/lib/R/site-library/Matrix’
* installing *source* package ‘systemfonts’ ...
** package ‘systemfonts’ successfully unpacked and MD5 sums checked
** using staged installation
Package fontconfig was not found in the pkg-config search path.
Perhaps you should add the directory containing `fontconfig.pc'
to the PKG_CONFIG_PATH environment variable
No package 'fontconfig' found
Package freetype2 was not found in the pkg-config search path.
Perhaps you should add the directory containing `freetype2.pc'
to the PKG_CONFIG_PATH environment variable
No package 'freetype2' found
Using PKG_CFLAGS=
Using PKG_LIBS=-lfontconfig -lfreetype
--------------------------- [ANTICONF] --------------------------------
Configuration failed to find the fontconfig freetype2 library. Try installing:
* deb: libfontconfig1-dev (Debian, Ubuntu, etc)
* rpm: fontconfig-devel (Fedora, EPEL)
* csw: fontconfig_dev (Solaris)
* brew: freetype (OSX)
If fontconfig freetype2 is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a fontconfig freetype2.pc file. If pkg-config
is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:
R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'
-------------------------- [ERROR MESSAGE] ---------------------------
<stdin>:1:10: fatal error: fontconfig/fontconfig.h: No such file or directory
compilation terminated.
--------------------------------------------------------------------
ERROR: configuration failed for package ‘systemfonts’
* removing ‘/usr/local/lib/R/site-library/systemfonts’
* installing *source* package ‘xml2’ ...
** package ‘xml2’ successfully unpacked and MD5 sums checked
** using staged installation
Package libxml-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libxml-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libxml-2.0' found
Package libxml-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libxml-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libxml-2.0' found
Using PKG_CFLAGS=
Using PKG_LIBS=-lxml2
------------------------- ANTICONF ERROR ---------------------------
Configuration failed because libxml-2.0 was not found. Try installing:
* deb: libxml2-dev (Debian, Ubuntu, etc)
* rpm: libxml2-devel (Fedora, CentOS, RHEL)
* csw: libxml2_dev (Solaris)
If libxml-2.0 is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a libxml-2.0.pc file. If pkg-config
is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:
R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'
--------------------------------------------------------------------
ERROR: configuration failed for package ‘xml2’
* removing ‘/usr/local/lib/R/site-library/xml2’
ERROR: dependencies ‘nlme’, ‘Matrix’ are not available for package ‘mgcv’
* removing ‘/usr/local/lib/R/site-library/mgcv’
ERROR: dependency ‘systemfonts’ is not available for package ‘textshaping’
* removing ‘/usr/local/lib/R/site-library/textshaping’
ERROR: dependency ‘xml2’ is not available for package ‘rvest’
* removing ‘/usr/local/lib/R/site-library/rvest’
ERROR: dependencies ‘MASS’, ‘mgcv’ are not available for package ‘ggplot2’
* removing ‘/usr/local/lib/R/site-library/ggplot2’
ERROR: dependencies ‘systemfonts’, ‘textshaping’ are not available for package ‘ragg’
* removing ‘/usr/local/lib/R/site-library/ragg’
ERROR: dependencies ‘ggplot2’, ‘ragg’, ‘rvest’, ‘xml2’ are not available for package ‘tidyverse’
* removing ‘/usr/local/lib/R/site-library/tidyverse’
The downloaded source packages are in
‘/tmp/Rtmpr5gSsS/downloaded_packages’
Warning messages:
1: In install.packages("tidyverse") :
installation of package ‘nlme’ had non-zero exit status
2: In install.packages("tidyverse") :
installation of package ‘Matrix’ had non-zero exit status
3: In install.packages("tidyverse") :
installation of package ‘systemfonts’ had non-zero exit status
4: In install.packages("tidyverse") :
installation of package ‘xml2’ had non-zero exit status
5: In install.packages("tidyverse") :
installation of package ‘mgcv’ had non-zero exit status
6: In install.packages("tidyverse") :
installation of package ‘textshaping’ had non-zero exit status
7: In install.packages("tidyverse") :
installation of package ‘rvest’ had non-zero exit status
8: In install.packages("tidyverse") :
installation of package ‘ggplot2’ had non-zero exit status
9: In install.packages("tidyverse") :
installation of package ‘ragg’ had non-zero exit status
10: In install.packages("tidyverse") :
installation of package ‘tidyverse’ had non-zero exit status
The installation fails because I don't have the 'lattice', 'fontconfig', and 'libxml-2.0' packages. When I try to install these packages manually, R says they aren't available for my current version (3.6.3).
I'm running R 3.6.3 because the up-to-date version of R (4.x) requires a newer version of libc6 that Ubuntu doesn't support (see Installing r-base on Zorin OS (libc6 2.35 needed)). The workaround to this was to install a version of R from the cran2deb repository (cran2deb4ubuntu 4.0 : “cran2deb4ubuntu Build Team” team), which ended up being 3.6.3.
Or at least, that's my understanding? From what I can tell, my options here are to
- Update R to the current version. This may or may not be possible, depending on whether I messed up the installation from cran2deb the first time.
- Install an older and/or compatible version of the package. Probably also from cran2deb? But I think install.packages should have already been checking the cran2deb repository, and it still failed, so idk really.