Ubuntu: Build packages from source

I have a comment related to this post:

When I run install.packages() on Ubuntu, every package needs to be built from source.

Is this true for Red Hat as well?

Windows and MacOS have package binaries, which greatly reduce the amount of time for package installation.

Imagine if I had an Ubuntu server and I wanted to install 1,000 packages and each package took 5 minutes to build: (5* 1000) / 60 = 83. We're talking about 83 hours of build time (> 3 days)!

CRAN does not provide linux binaries for R packages. This statement from the R Installation and Administration document is instructive:

On Unix-alikes (except macOS) [install.packages] consults the list of available source packages on CRAN (or other repository/ies), downloads the latest version of the package sources, and installs them (via R CMD INSTALL ).

As an alternative, RStudio Package Manager enables users to install Linux binaries for R packages.

1 Like

Anything that makes it to CRAN is guaranteed to compile on Linux if system library dependencies are met. The same isn’t true of OS, and users on that platform are very fortunate that Simon Urbanek of the R Core Team takes on the nontrivial work of modifying the source to create the binaries. It’s foreseeable that future convergence with iOS could make that infeasible.