I've installed R (version 3.6.0) on my ubuntu 18.04 which I run on the windows subsystem WSL.
Now I'm having a problem to install some specific packages. For example xml2
. When I run the command install.packages("xml2")
, i get the following error:
mv: cannot move '/usr/local/lib/R/site-library/00LOCK-xml2/00new/xml2' to '/usr/local/lib/R/site-library/xml2': Permission denied
ERROR: moving to final location failed
I guess there might be some way to give myself full permission for managing my own stuff, does anyone know how to get around this issue?
This solution suggested on stackoverflow.com worked for me.
Uninstall R version 3.6.0, and remove the R PPA if there is one from your software sources in
/etc/apt/sources.list
by preceding the line containing this PPA with a#
character to turn it into a comment. Then runsudo apt update
to refresh your list of available software. Now that you have removed the R packages that don't work, you are ready to install r-base and r-cran-xml2 from the default Ubuntu 18.04 repositories.To install xml2 R package in Ubuntu 18.04 open the terminal and type:
This GNU R XML parser package works with XML files using a simple, consistent interface. It's built on top of the 'libxml2' C library.