Trouble Installing Packages in the QuickStart

We just announced the availability of the RStudio QuickStart. You can download it here:

Installing packages into the QuickStart can be problematic when the package itself has a system dependency that is not satisfied out of the box. Because we tried to minimize download size, we left out some system dependencies that may be needed by your R packages. You might run into this in the RStudio Server IDE (http://localhost:5000/rstudio/) or in the Deployment log when publishing to RStudio Connect (http://localhost:5000/rsconnect/).

Specifically, let's say we wanted to install the sf R package, which depends on the units R package. We might run into an error like the following in the Deployment log for RStudio Connect:

configure: error: in `/tmp/Rtmp6Dn2bo/R.INSTALL92865974ada/units':
configure: error: 
--------------------------------------------------------------------------------
  Configuration failed because libudunits2.so was not found. Try installing:
    * deb: libudunits2-dev (Debian, Ubuntu, ...)
    * rpm: udunits2-devel (Fedora, EPEL, ...)
    * brew: udunits (OSX)
  If udunits2 is already installed in a non-standard location, use:
    --configure-args='--with-udunits2-lib=/usr/local/lib'
  if the library was not found, and/or:
    --configure-args='--with-udunits2-include=/usr/include/udunits2'
  if the header was not found, replacing paths with appropriate values.
  You can alternatively set UDUNITS2_INCLUDE and UDUNITS2_LIBS manually.
--------------------------------------------------------------------------------

See `config.log' for more details
ERROR: configuration failed for package ‘units’
* removing ‘/home/rstudio/R/x86_64-pc-linux-gnu-library/3.4/units’

The RStudio QuickStart is based on the "Debian" (specifically, Ubuntu) flavor of Linux, so the important line here is: * deb: libudunits2-dev (Debian, Ubuntu, ...)

This line shows us which system package needs to be installed on the system. In this case, it is libudunits2-dev. This is the system package required by the units R package.

To install this system package, log into the RStudio IDE at http://localhost:5000/rstudio/ as the user rstudio.

Once the IDE is loaded, navigate to the "Terminal" pane, which is next to the R "Console" by default.

In the terminal pane, execute the following:

sudo apt-get update -y && sudo apt-get install -y libudunits2-dev

This command will update the list of package repositories and then install the libudunits2-dev system package. If you need a different system package, simply alter the command to install the package you need:

sudo apt-get update -y && sudo apt-get install -y <system-package>

Note that not all R packages emit such an elegant error message when they are missing a system dependency. Figuring out which system dependency is missing can be an artful exercise in those cases. Search engines and RStudio Community can be useful tools to resolve such problems. Feel free to comment below with any package installation issues you are having in the RStudio QuickStart!

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.