Problems installing mosaic packages on Chromebook (Linux)

Hello. I need to download the package "mosaic" (I don't understand if this is the same as ggmosaic, which i successfully downloaded). I have very little experience with RStudio but I use it on my HP Chromebook with a Linux beta system. I downloaded R and RStudio through the Linux terminal and have had some problems with other packages like tidyverse, which I have solved through installing the following packages:
sudo apt-get install libxml2 libxml2-dev sudo apt-get install libssl-dev
$ sudo apt-get install libcurl4-openssl-dev

When I try installing mosaic in RStudio i get the following error message:

Installing package into ‘/home/solrunnyb/R/x86_64-pc-linux-gnu-library/4.0’
(as ‘lib’ is unspecified)
also installing the dependencies ‘terra’, ‘raster’, ‘leaflet

Installing package into ‘/home/solrunnyb/R/x86_64-pc-linux-gnu-library/4.0’
(as ‘lib’ is unspecified)
also installing the dependencies ‘terra’, ‘raster’, ‘leaflet’

What am I doing wrong? The same error message comes up for all four dependencies. As a new user I'm not allowed to upload the whole code but i'll try posting it in the comments.

 install.packages("mosaic")
Installing package into ‘/home/solrunnyb/R/x86_64-pc-linux-gnu-library/4.0’
(as ‘lib’ is unspecified)
also installing the dependencies ‘terra’, ‘raster’, ‘leaflet’

trying URL 'https://cloud.r-project.org/src/contrib/terra_1.5-21.tar.gz'
Content type 'application/x-gzip' length 636954 bytes (622 KB)
==================================================
downloaded 622 KB

trying URL 'https://cloud.r-project.org/src/contrib/raster_3.5-15.tar.gz'
Content type 'application/x-gzip' length 580594 bytes (566 KB)
==================================================
downloaded 566 KB

trying URL 'https://cloud.r-project.org/src/contrib/leaflet_2.1.0.tar.gz'
Content type 'application/x-gzip' length 2017045 bytes (1.9 MB)
==================================================
downloaded 1.9 MB

trying URL 'https://cloud.r-project.org/src/contrib/mosaic_1.8.3.tar.gz'
Content type 'application/x-gzip' length 3570522 bytes (3.4 MB)
==================================================
downloaded 3.4 MB

* installing *source* package ‘terra’ ...
** package ‘terra’ successfully unpacked and MD5 sums checked
** using staged installation
configure: CC: gcc -std=gnu99
configure: CXX: g++ -std=gnu++11
checking for gdal-config... no
no
configure: error: gdal-config not found or not executable.
ERROR: configuration failed for package ‘terra’
* removing ‘/home/solrunnyb/R/x86_64-pc-linux-gnu-library/4.0/terra’
Warning in install.packages :
  installation of package ‘terra’ had non-zero exit status
ERROR: dependency ‘terra’ is not available for package ‘raster’
* removing ‘/home/solrunnyb/R/x86_64-pc-linux-gnu-library/4.0/raster’
Warning in install.packages :
  installation of package ‘raster’ had non-zero exit status
ERROR: dependency ‘raster’ is not available for package ‘leaflet’
* removing ‘/home/solrunnyb/R/x86_64-pc-linux-gnu-library/4.0/leaflet’
Warning in install.packages :
  installation of package ‘leaflet’ had non-zero exit status
ERROR: dependency ‘leaflet’ is not available for package ‘mosaic’
* removing ‘/home/solrunnyb/R/x86_64-pc-linux-gnu-library/4.0/mosaic’
Warning in install.packages :
  installation of package ‘mosaic’ had non-zero exit status

The downloaded source packages are in
	‘/tmp/RtmpybD78a/downloaded_packages’ 

You are missing another system dependency for the terra package, on Linux C++11, GDAL (>= 2.2.3), GEOS (>= 3.4.0), PROJ (>= 4.9.3), sqlite3 are required for this package.

Since you haven't told us what Linux distribution you are using, I can't give you specific installation commands but as an example, for Ubuntu you would use these commands.

sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable
sudo apt-get update
sudo apt-get install libgdal-dev libgeos-dev libproj-dev
1 Like

Thank you for the reply! I am not quite sure how to check my distribution, but the command 'hostnamectl' gave me the following output:

Static hostname: penguin
Icon name: computer-container
Chassis: container
Machine ID: 169fe91150ae49476727915e6165a895
Boot ID: 3e920234413a400ba8d0aba49d889c86
Virtualization: lxc
Operating System: Debian GNU/Linux 11 (bullseye)
Kernel: Linux 5.4.163-17384-g99ca1c60d20c
Architecture: x86-64

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.