For the complete documentation index, see llms.txt. This page is also available as Markdown.

18.2 Rocky Linux Compatibility Layer

FreeBSD provides a Rocky Linux 9.7 compatibility layer through the emulators/linux-rl9 Port (which includes linux_base-rl9). This section covers installation steps, version verification, and basic configuration.

Installing the Rocky Linux Compatibility Layer via FreeBSD Ports

Rocky Linux Version Number Overview

As of February 16, 2026, the FreeBSD Ports emulators/linux-rl9 (whose corresponding base package is emulators/linux_base-rl9) is built on the Rocky Linux 9.7 distribution.

View the current Linux distribution version information within the Rocky Linux compatibility layer environment:

bash-5.1$ cat /etc/redhat-release      # Inside the Rocky Linux compatibility layer
Rocky Linux release 9.7 (Blue Onyx)

This version number serves only as a reference, not as an absolute identifier. The /etc/redhat-release file is provided by the Rocky Linux rocky-release package and contains static text. A Linux distribution is essentially a collection of multiple independent packages. The version information of a single package cannot determine that all packages in the distribution belong to the same version; therefore, the version number of a Linux distribution is a relative concept.

Further examination of the commit record emulators/linux_base-rl9: update to Rocky Linux 9.7 (+) reveals that what truly determines the version number is the value of the LINUX_DIST_VER variable in the Mk/Uses/linux.mk file within the Ports framework:

.  if empty(linux_ARGS)
.    if exists(${LINUXBASE}/etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7)  # Check if RPM-GPG-KEY-CentOS-7 exists in the compatibility layer; if so, it is a CentOS 7 compatibility layer
linux_ARGS=		c7
.    elif exists(${LINUXBASE}/etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-9) # Check if RPM-GPG-KEY-Rocky-9 exists in the compatibility layer; if so, it is a Rocky Linux 9 compatibility layer
linux_ARGS=		rl9
.    else
linux_ARGS=		${LINUX_DEFAULT}
.    endif
.  endif

.  if ${linux_ARGS} == c7  # Check if it is a CentOS 7 compatibility layer
LINUX_DIST_VER?=	7.9.2009    # Currently importing CentOS 7.9.2009
.  elif ${linux_ARGS} == rl9   # Check if it is a Rocky Linux 9 compatibility layer
LINUX_DIST_VER?=	9.7  # Currently importing Rocky Linux 9.7
.  else
ERROR+=			"Invalid Linux distribution: ${linux_ARGS}"  # If neither, print error message directly
.  endif

Enabling the Linux Compatibility Layer Service

Before installing the Rocky Linux compatibility layer, you must first enable the Linux compatibility layer service.

Enable the Linux compatibility layer service and set it to start on boot:

Start the Linux compatibility layer service immediately:

Installing the Base System

  • Install using pkg:

  • Alternatively, install using Ports:

After installation, you also need to configure related services.

Restart the system for changes to take effect.

Installing the Rocky Linux 10 Compatibility Layer via Shell Script

The following script will build Rocky Linux 10.2 (codename Red Quartz) under /compat/rocky.

Rocky Linux 10 Compatibility Layer

References

Last updated