Clean install for R Shiny Server on Ubuntu - Dependency errors

Hey there,

I'm installing an R Shiny Server on Ubuntu 16.04 for a new developer in our group. I have had zero experience with R / Shiny prior to this.

I've prepared a VM with Ubuntu 16 and followed the instructions here: Download Shiny Server for Ubuntu 16.04 or later - RStudio

Unfortunately, the command:

sudo su - \
-c "R -e \"install.packages('shiny', repos='https://cran.rstudio.com/')\""

Ends with these warning that, I suppose, prevent the sample app from really launching. I want to be sure that there is a stable and ready to work environment so I'd like to understand what is happening and how to fix this, so I can help the developer in case he run in some issues while deploying.

The error and warnings are the following:

ERROR: dependencies ‘digest’, ‘rlang’ are not available for package ‘htmltools’
* removing ‘/usr/local/lib/R/site-library/htmltools’
ERROR: dependency ‘rlang’ is not available for package ‘later’
* removing ‘/usr/local/lib/R/site-library/later’
ERROR: dependency ‘rlang’ is not available for package ‘cachem’
* removing ‘/usr/local/lib/R/site-library/cachem’
ERROR: dependency ‘rlang’ is not available for package ‘ellipsis’
* removing ‘/usr/local/lib/R/site-library/ellipsis’
ERROR: dependencies ‘digest’, ‘rlang’, ‘htmltools’ are not available for package ‘sass’
* removing ‘/usr/local/lib/R/site-library/sass’
ERROR: dependency ‘htmltools’ is not available for package ‘jquerylib’
* removing ‘/usr/local/lib/R/site-library/jquerylib’
ERROR: dependencies ‘later’, ‘rlang’ are not available for package ‘promises’
* removing ‘/usr/local/lib/R/site-library/promises’
ERROR: dependencies ‘promises’, ‘later’ are not available for package ‘httpuv’
* removing ‘/usr/local/lib/R/site-library/httpuv’
ERROR: dependencies ‘htmltools’, ‘sass’, ‘digest’, ‘jquerylib’, ‘rlang’ are not available for package ‘bslib’
* removing ‘/usr/local/lib/R/site-library/bslib’
ERROR: dependencies ‘httpuv’, ‘digest’, ‘htmltools’, ‘later’, ‘promises’, ‘rlang’, ‘bslib’, ‘cachem’, ‘ellipsis’, ‘lifecycle’ are not available for package ‘shiny’
* removing ‘/usr/local/lib/R/site-library/shiny’

The downloaded source packages are in
        ‘/tmp/Rtmp8r5eQA/downloaded_packages’
Warning messages:
1: In install.packages("shiny", repos = "https://cran.rstudio.com/") :
  installation of package ‘htmltools’ had non-zero exit status
2: In install.packages("shiny", repos = "https://cran.rstudio.com/") :
  installation of package ‘later’ had non-zero exit status
3: In install.packages("shiny", repos = "https://cran.rstudio.com/") :
  installation of package ‘cachem’ had non-zero exit status
4: In install.packages("shiny", repos = "https://cran.rstudio.com/") :
  installation of package ‘ellipsis’ had non-zero exit status
5: In install.packages("shiny", repos = "https://cran.rstudio.com/") :
  installation of package ‘sass’ had non-zero exit status
6: In install.packages("shiny", repos = "https://cran.rstudio.com/") :
  installation of package ‘jquerylib’ had non-zero exit status
7: In install.packages("shiny", repos = "https://cran.rstudio.com/") :
  installation of package ‘promises’ had non-zero exit status
8: In install.packages("shiny", repos = "https://cran.rstudio.com/") :
  installation of package ‘httpuv’ had non-zero exit status
9: In install.packages("shiny", repos = "https://cran.rstudio.com/") :
  installation of package ‘bslib’ had non-zero exit status
10: In install.packages("shiny", repos = "https://cran.rstudio.com/") :
  installation of package ‘shiny’ had non-zero exit status
>
>

And they happens immediately after downloading them, following this step of the process:

> install.packages('shiny', repos='https://cran.rstudio.com/')
Installing package into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
Warning: dependencies ‘digest’, ‘rlang’, ‘lifecycle’ are not available
also installing the dependencies ‘sass’, ‘jquerylib’, ‘httpuv’, ‘htmltools’, ‘later’, ‘promises’, ‘bslib’, ‘cachem’, ‘ellipsis’

Just to add to this, when I try and reach the VM on port 3838, the server respond but the "sample app" that should show up, it's not.

Since Ubuntu-16.04 is no longer supported, my guess is that you're getting an old version of R and the required dependencies are out of date.

I suggest you use a more modern image of Ubuntu, e.g. 18.04 or even 20.04 and try again.

If that's not an option, please tell us the version of R that you have installed on that machine.

I can change OS, no problem.

If that fixes the problems, maybe it would be worth trying to contact whoever can update those installation instructions to suggest an higher version of Ubuntu.

Reinstalling from Ubuntu 20.04 LTS
It's still running but first thing to note is that it requires to install the build-essentials. Nothing terrible but worth nothing that it'll try to run make and fail otherwise.

Simply run sudo apt-get install build-essential before running

sudo su - \
-c "R -e \"install.packages('shiny', repos='https://cran.rstudio.com/')\""

All good using Ubuntu 20.04 LTS.

Thanks @andrie :slight_smile:

If your question's been answered (even by you!), would you mind choosing a solution? It helps other people see which questions still need help, or find solutions if they have similar problems. Here’s how to do it:

Done, thank you for reminding me.

marked my answer as it contains some specific additional info but thanks to Andrie again for pointing out the probable issue with an outdated version of the libraries :slight_smile:

This topic was automatically closed 7 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.