unble to install Shiny Package on ubuntu Operating system and R Packages

Hello Guys,

I am attempting to install Shiny and Shiny Server on Ubuntu. I have install R and RStudio on ubuntu.

While installing the Shiny or devtools package, i am getting the below error.


install.packages('shiny')
Installing package into ‘/home/asset/R/x86_64-pc-linux-gnu-library/3.4’
(as ‘lib’ is unspecified)
trying URL 'https://cloud.r-project.org/src/contrib/shiny_1.2.0.tar.gz'
Content type 'application/x-gzip' length 2987723 bytes (2.8 MB)
==================================================
downloaded 2.8 MB

  • installing source package ‘shiny’ ...
    ** package ‘shiny’ successfully unpacked and MD5 sums checked
    ** R
    ** inst
    ** preparing package for lazy loading
    Warning: S3 methods ‘format.staticPath’, ‘format.staticPathOptions’, ‘print.staticPath’, ‘print.staticPathOptions’ were declared in NAMESPACE but not found
    Error in library.dynam(lib, package, package.lib) :
    shared object ‘httpuv.so’ not found
    ERROR: lazy loading failed for package ‘shiny’
  • removing ‘/home/asset/R/x86_64-pc-linux-gnu-library/3.4/shiny’
    Warning in install.packages :
    installation of package ‘shiny’ had non-zero exit status

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

library(shiny)
Error in library(shiny) : there is no package called ‘shiny’


How to install R packages on ubuntu OS?

Try installing this dependency first

install.packages("httpuv")

Thanks for your help.
But While installing httpuv package, i got below error.

install.packages('httpuv')
Installing package into ‘/home/asset/R/x86_64-pc-linux-gnu-library/3.4’
(as ‘lib’ is unspecified)
trying URL 'https://cloud.r-project.org/src/contrib/httpuv_1.5.1.tar.gz'
Content type 'application/x-gzip' length 1758514 bytes (1.7 MB)
==================================================
downloaded 1.7 MB

ERROR: failed to lock directory ‘/home/asset/R/x86_64-pc-linux-gnu-library/3.4’ for modifying
Try removing ‘/home/asset/R/x86_64-pc-linux-gnu-library/3.4/00LOCK-httpuv’
Warning in install.packages :
installation of package ‘httpuv’ had non-zero exit status

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

library(httpuv)
Error: package or namespace load failed for ‘httpuv’ in library.dynam(lib, package, package.lib):
shared object ‘httpuv.so’ not found
In addition: Warning message:
S3 methods ‘format.staticPath’, ‘format.staticPathOptions’, ‘print.staticPath’, ‘print.staticPathOptions’ were declared in NAMESPACE but not found

How to fix this error?

This looks like a permissions issue, try running this command from a system terminal and then try to install httpuv again

sudo rm /home/asset/R/x86_64-pc-linux-gnu-library/3.4/00LOCK-httpuv

Another thing to try would be installing httpuv as super user from the terminal

sudo su - -c "R -e \"install.packages('httpuv', repos='http://cran.rstudio.com/')\""
1 Like

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