If you use RStudio Package Manager binaries with the required system dependencies, then stringi should install just fine in any online or air-gapped Linux environment. Note: Binary package installations will be much faster than compiling packages from source.
In air-gapped or semi-offline (protected by an outbound proxy) environments, stringi's request for system dependencies may be rejected and will cause an installation failure. This is true for RStudio Server Pro and for RStudio Connect. The solution is to install the required system dependencies for your operating system and install the stringi package binary from an RStudio Package Manager instance that you host behind your firewall. We strongly recommend using the RStudio Package Manager in air gapped environments. If you are not using the RStudio Package Manger and/or you need to install stringi from source you can follow the instructions below. Note that installing stringi from source is not supported on RHEL. If you need more information, please contact email@example.com.
Support for stringi in air-gapped (offline) environments
|Operating system||Required system dependency||Binary installation
Using RStudio Package Manager
|Compiling from source
|SUSE / SLES||libicu-devel||Supported||Supported|
|Centos / RHEL||libicu-devel||Supported||Not Supported|
Why installing stringi is hard
The stringi and dependent packages are commonly used in R for string manipulation, regex parsing, and the like. However, stringi's system dependencies (libicu) can make for difficult installation in an air-gapped environment.
In an online environment, the installation process of stringi is savvy enough to go get the system dependencies it needs at build time. This makes for a very friendly and simple user experience for most users. However, in an air-gapped or semi-offline (protected by an outbound proxy) environment, this request for system dependencies from the internet may be rejected and will cause an installation failure.
Note: There are several options to get stringi installed successfully on your system. For more information on the installation process and system dependencies that the package uses, see the excellent writeup maintained by the package author. At the time of writing, the latest stringi package installation requires the version of the ICU library to be >= 52.
Using RStudio Package Manager
RStudio Package Manager is a repository management server to organize and centralize R packages across your team, department, or entire organization. Two noteworthy features in this context are that it:
- Provides a list of system dependencies for individual packages and entire repositories
- Provides binary (pre-built) R packages for Linux operating systems
As a result, RStudio Package Manager simplifies package management and installation for air-gapped Linux infrastructure by providing pre-built R packages and the list of system dependencies needed to run them.
System dependencies - Ubuntu & SUSE / SLES
- Ubuntu: libicu-dev
- SUSE / SLES: libicu-devel
The system-provided version of libicu is sufficient to satisfy stringi's requirements (>= 52). As a result, you can install stringi from source or binary because it will pick up the system version of libicu and be built properly (even in an air-gapped environment).
System dependencies - CentOS / RHEL
- Centos / RHEL: libicu-devel
On these systems, the system-provided version of libicu is not sufficient to satisfy stringi's version requirement. As a result, you cannot install stringi from source. We recommend that you install stringi from a binary which will include bundled system dependencies and will work out of the box.
Note: If you need to install stringi from source on one of these operating systems, please reach out to your Customer Success representative and share this use case with us. You can also follow the directions below for "Without RStudio Package Manager."
Without RStudio Package Manager
When you are installing stringi without the option of binaries from RStudio Package Manager, then your installation process will require building the package from source. If your operating system provided version of libicu satisfies stringi's requirements, then you can build the package from source even in an air-gapped or semi-offline environment.
At the time of writing, stringi's system dependencies are satisfied by the system provided version of libicu for the following operating systems. If your operating system provided version of libicu does not satisfy stringi's requirements, then you must either open up internet access to the locations that stringi tries to get its sources from or install stringi manually following the directions for air-gapped installation.
- Ubuntu 18.04; 20.04
- SUSE 15.2
- SLES 12sp5; 15sp2
At the time of writing, stringi's system dependencies are NOT satisfied by the system provided version of libicu for the following operating systems:
- CentOS / RHEL 7; 8
Options for installing stringi in RStudio Connect
1. Use RStudio Package Manager
In non-interactive environments like RStudio Connect, the user or admin does not have control over the package installation process. In this scenario, we recommend using RStudio Package Manager along with the required system dependencies. If RStudio Package Manager is not available then you will need to install stringi as an external package.
2. Install as an external package
RStudio Connect allows for manual installation of packages through use of the external packages (i.e. packages that are managed and installed manually and provided to RStudio Connect through the system library). Note: Use of external packages is highly discouraged in all situations save exceptions like stringi, rJava, ROracle, etc. that have very particular system dependency requirements.
- Install stringi manually into the system library for each R installation utilized by RStudio Connect (this is most easily done by installing the package as root, which should default to the system library)
- Add the following section to the RStudio Connect configuration at /etc/rstudio-connect/rstudio-connect.gcfg
External = stringi
- Restart RStudio Connect
Once this is complete, the following behavior can be expected:
- RStudio Connect will bypass installation of stringi when deploying R content and trust that it is available in the system library
- If stringi is not available in the system library for all R installations, RStudio Connect will fail to start
- All content using a given version of R will utilize the stringi installed into the system library for that R version
- This means that updating, removing, or otherwise changing stringi in the system library will simultaneously affect all RStudio Connect content using the given R version.
There is more information about this process in the RStudio Connect Admin Guide. If you have questions or difficulties about the process of getting stringi to work with RStudio Connect, please reach out to your Customer Success representative or the RStudio support team.