[R] customizing library locations for R in ubuntu
Dirk Eddelbuettel
edd @end|ng |rom deb|@n@org
Wed May 14 13:53:21 CEST 2025
On 9 May 2025 at 16:41, Ivan Krylov via R-help wrote:
| This is not guaranteed to work, especially for (but not limited to)
| packages that compile source code and link to various interfaces inside
| R: https://stat.ethz.ch/pipermail/r-help/2025-April/480832.html
|
| This problem is more visible on Ubuntu than on Windows. On GNU/Linux
| systems, R packages will link to the third-party libraries you install
| from the GNU/Linux repositories. When you update your Ubuntu
| installation, the installed packages may stop working.
That is where an approach such as r2u [1] shines: it integrates the package
management with the system management.
So when you, say, install stringi, the system manager (apt) knows which
libicu* version you now depend on and will not remove it until all known uses
are upgraded to a new version of libicu*, for example by updating stringi via
the binary r-cran-stringi provided by r2u. Ditto for all other third-party
dependencies such as database, compression, graphics, ... libraries. Give it
a try, easy to do in a container such as rocker/r2u:24.04.
r2u can of course still be combined with user-local and/or system-local
library paths specific to local development, or non-CRAN packages, or ...
Turning the helper package bspm off as in
bspm::disable(); install.packages(pkgname
or
bspm::disable(); remotes::install_github(repo_and_package)
makes it works as it usually does (without system integration). So a 'best
of both worlds' approach is available.
Cheers, Dirk
[1] See https://eddelbuettel.github.io/r2u for more
--
dirk.eddelbuettel.com | @eddelbuettel | edd using debian.org
More information about the R-help
mailing list