How To Install Erlang on Rocky Linux 10
Erlang stands as one of the most robust functional programming languages designed specifically for building concurrent, distributed, and fault-tolerant systems. Installing Erlang on Rocky Linux 10 opens doors to developing high-performance applications and serves as a foundation for popular software like RabbitMQ, Elixir applications, and numerous enterprise-grade messaging systems.
This comprehensive guide walks through multiple installation methods for Erlang on Rocky Linux 10, ensuring you have the knowledge to choose the best approach for your specific needs. Whether you’re setting up a development environment, preparing a production server, or simply exploring concurrent programming concepts, this tutorial provides detailed instructions, troubleshooting tips, and optimization strategies.
Rocky Linux 10 provides an excellent platform for Erlang development and deployment, offering enterprise-grade stability with modern package management capabilities. The installation process varies depending on your requirements, available system resources, and intended use cases.
Prerequisites and System Requirements
Before installing Erlang on your Rocky Linux 10 system, ensure you meet the necessary prerequisites and have the required tools available.
System Requirements
Rocky Linux 10 requires specific hardware and software configurations for optimal Erlang performance. Your system should have a minimum of 2GB RAM and 10GB available disk space for a complete installation. Administrative privileges through sudo access or root account are essential for package installation and system configuration.
Ensure your Rocky Linux 10 system maintains active internet connectivity for downloading packages and dependencies. Most Erlang installation methods require accessing external repositories and downloading source files or pre-compiled packages.
Required Development Tools
Erlang compilation from source demands several development tools and libraries. The GNU make utility serves as the primary build system, while a compatible C compiler like gcc or clang handles the compilation process. Perl 5 is mandatory for various build scripts and configuration processes during installation.
Development headers for ncurses, termcap, or termlib libraries enable proper terminal functionality within the Erlang shell. Without these libraries, only basic shell functionality remains available, significantly limiting interactive capabilities.
The sed (Stream Editor) utility performs essential text transformations during the build process. Most Rocky Linux 10 installations include sed by default, but verify its availability before proceeding with source compilation.
System Updates and Preparation
Update your package index to ensure access to the latest software versions and security patches:
sudo dnf update -y
Enable the Extra Packages for Enterprise Linux (EPEL) repository if your installation requires additional development tools:
sudo dnf install epel-release -y
Verify your system architecture and version compatibility:
uname -a
cat /etc/rocky-release
User Permissions and Access
Configure a non-root user account with appropriate sudo privileges for secure package installation. Running installations as root poses security risks and violates best practices for system administration.
Basic command-line proficiency and understanding of Linux package management concepts enhance your installation experience. Familiarity with text editors like vi, nano, or emacs proves helpful when configuring environment variables and editing configuration files.
Installation Method 1: Using PackageCloud Repository
The PackageCloud repository method offers the most straightforward approach for installing Erlang on Rocky Linux 10, providing automated dependency resolution and simplified maintenance.
Repository Setup and Configuration
PackageCloud hosts optimized Erlang packages specifically designed for Rocky Linux and compatible distributions. This repository maintains packages built by the RabbitMQ team, ensuring compatibility with message broker installations and related software.
Add the PackageCloud repository using the automated script:
curl -s https://packagecloud.io/install/repositories/rabbitmq/erlang/script.rpm.sh | sudo bash
This command downloads and executes the repository configuration script, adding the necessary repository files to /etc/yum.repos.d/
and importing required GPG keys for package verification.
Step-by-Step Installation Process
Once the repository is configured, install Erlang using the DNF package manager:
sudo dnf install erlang -y
The installation process automatically resolves dependencies and downloads required packages. DNF handles the complete installation workflow, including dependency checking, package downloading, and system integration.
Monitor the installation progress and verify successful completion:
dnf list installed | grep erlang
Package Components and Dependencies
The PackageCloud Erlang package includes essential components for most development and production scenarios. Core modules like kernel, stdlib, and common applications come pre-installed and configured.
DNF automatically resolves and installs dependencies including OpenSSL libraries, ncurses development packages, and other runtime requirements. This automated approach minimizes manual configuration and reduces installation complexity.
Verification of Repository Installation
Confirm successful repository installation by checking package information:
rpm -qi erlang
Verify repository configuration files exist in the correct location:
ls -la /etc/yum.repos.d/ | grep rabbitmq
Advantages and Considerations
Repository installation provides automatic security updates and simplified maintenance procedures. Package updates integrate seamlessly with system-wide update processes, ensuring consistent security patches and bug fixes.
This method suits production environments requiring stable, tested packages with predictable update cycles. The repository approach minimizes compilation time and eliminates build-related complications.
Installation Method 2: From Source Compilation
Source compilation offers maximum flexibility and access to the latest Erlang features, making it ideal for development environments and custom installations.
Downloading Erlang Source Code
Download the latest stable Erlang/OTP release from the official website. Version 28.0.2 represents the current stable release as of this writing:
cd /tmp
wget https://github.com/erlang/otp/releases/download/OTP-28.0.2/otp_src_28.0.2.tar.gz
Alternatively, clone the source repository directly from GitHub for access to development branches:
git clone https://github.com/erlang/otp.git otp_src_28.0.2
Preparation and Dependencies
Install essential build dependencies before starting compilation:
sudo dnf groupinstall "Development Tools" -y
sudo dnf install ncurses-devel openssl-devel java-1.8.0-openjdk-devel unixODBC-devel -y
Create a dedicated installation directory for better organization:
sudo mkdir -p /usr/local/erlang
Configuration and Build Process
Extract the source archive and navigate to the source directory:
tar -zxf otp_src_28.0.2.tar.gz
cd otp_src_28.0.2
Set the ERL_TOP environment variable for the build process:
export ERL_TOP=`pwd`
Configure the build with appropriate options:
./configure --prefix=/usr/local/erlang --without-javac --enable-smp-support --enable-threads --enable-kernel-poll
The configuration process checks system dependencies and generates build files. The --without-javac
option disables Java integration if not required, while --enable-smp-support
optimizes for multi-core systems.
Compilation and Installation
Begin the compilation process:
make
Compilation time varies based on system specifications, typically requiring 15-30 minutes on modern hardware. Monitor progress and address any error messages that appear during the build process.
Install the compiled Erlang system:
sudo make install
Environment Variables Configuration
Configure system-wide environment variables by editing the profile file:
sudo vi /etc/profile
Add the following lines at the end of the file:
export ERL_HOME=/usr/local/erlang
export PATH=$ERL_HOME/bin:$PATH
Apply the configuration changes:
source /etc/profile
Advantages of Source Installation
Source compilation provides access to cutting-edge features and allows custom optimization flags tailored to your specific hardware configuration. This approach enables fine-grained control over included modules and features.
Development environments benefit from source installation’s flexibility, particularly when testing new features or contributing to Erlang development. Custom patches and modifications integrate easily with source-based installations.
Installation Method 3: Direct RPM Package Installation
Direct RPM installation suits scenarios requiring specific Erlang versions or offline installation environments without internet connectivity.
Obtaining RPM Packages
Download appropriate RPM packages from the RabbitMQ Erlang RPM repository on GitHub. Select packages compatible with Rocky Linux 10 (el10.x86_64 architecture):
wget https://github.com/rabbitmq/erlang-rpm/releases/download/v25.3.2.7/erlang-25.3.2.7-1.el9.x86_64.rpm
Manual RPM Installation Process
Install the downloaded RPM package using DNF for automatic dependency resolution:
sudo dnf localinstall erlang-25.3.2.7-1.el9.x86_64.rpm -y
DNF automatically resolves and installs required dependencies when available in configured repositories. This approach combines manual package selection with automated dependency management.
Dependency Resolution
Manual dependency management may be necessary when installing RPM packages without repository access. Identify missing dependencies using:
rpm -qpR erlang-25.3.2.7-1.el9.x86_64.rpm
Download and install dependency packages as needed, maintaining proper installation order to avoid conflicts.
When to Use Direct RPM Installation
Direct RPM installation proves valuable for air-gapped environments, specific version requirements, or custom enterprise deployments. This method provides precise version control without relying on external repositories.
Testing environments benefit from RPM installation when evaluating specific Erlang versions or testing compatibility with particular applications.
Installation Verification and Testing
Thorough verification ensures successful Erlang installation and proper system integration across all installation methods.
Basic Functionality Testing
Launch the Erlang shell to verify basic functionality:
erl
Successful installation displays output similar to:
Erlang/OTP 28 [erts-14.0] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [jit:ns]
Eshell V14.0 (abort with ^G)
1>
Check the installed Erlang version:
erl -version
Exit the Erlang shell using:
1> q().
Creating and Running Test Programs
Create a simple Hello World program to test compilation and execution capabilities:
vi hello.erl
Add the following Erlang code:
% Hello World test program
-module(hello).
-export([helloworld/0]).
helloworld() ->
io:format("Hello from Rocky Linux 10 with Erlang!~n").
Compilation and Execution Testing
Compile the test program within the Erlang shell:
erl
1> c(hello).
{ok,hello}
Execute the compiled program:
2> hello:helloworld().
Hello from Rocky Linux 10 with Erlang!
ok
Advanced Verification Tests
Test crypto module functionality to ensure SSL/TLS capabilities:
1> crypto:info_lib().
Successful output indicates proper OpenSSL integration and cryptographic functionality.
Verify distributed Erlang capabilities:
1> net_kernel:start([test, shortnames]).
{ok,<0.XX.0>}
Integration Testing
Test RabbitMQ compatibility if message broker integration is planned. Verify third-party application compatibility by attempting to load relevant modules and libraries.
Monitor system resource usage during testing to establish baseline performance metrics and identify potential optimization opportunities.
Common Issues and Troubleshooting
Understanding common installation problems and their solutions accelerates troubleshooting and minimizes downtime during Erlang setup.
Dependency-Related Problems
OpenSSL version compatibility issues frequently occur when mixing different installation methods or using outdated system libraries. Verify OpenSSL version compatibility:
openssl version
Install compatible OpenSSL development packages:
sudo dnf install openssl-devel -y
Missing development headers cause compilation failures during source installation. Install the complete development toolchain:
sudo dnf groupinstall "Development Tools" "C Development Tools and Libraries" -y
libcrypto.so dependency problems manifest as runtime errors when loading the crypto module. Resolve by updating OpenSSL packages or rebuilding Erlang with compatible library versions.
Repository and Package Issues
Repository access problems occur due to network connectivity issues or misconfigured proxy settings. Verify repository accessibility:
dnf repolist | grep rabbitmq
GPG key verification failures prevent package installation. Manually import required keys:
sudo rpm --import https://packagecloud.io/rabbitmq/erlang/gpgkey
Package version conflicts arise when multiple Erlang installations coexist. Remove conflicting packages before proceeding with new installations:
sudo dnf remove erlang\* -y
Compilation Errors (Source Installation)
Build dependency errors halt compilation processes. Ensure all required development packages are installed before configuring the build environment.
Configure script parameter optimization improves compatibility with specific system configurations. Review configure output for warnings and adjust parameters accordingly.
Make compilation failures often indicate insufficient system resources or missing dependencies. Increase available memory or swap space for resource-constrained systems:
sudo fallocate -l 2G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
Runtime and Execution Issues
PATH and environment variable problems prevent Erlang shell startup. Verify PATH configuration:
echo $PATH
which erl
Module loading errors indicate incomplete installations or corrupted packages. Reinstall affected packages or rebuild from source to resolve module dependencies.
Permission and access issues prevent normal operation in multi-user environments. Adjust file permissions and ownership as needed:
sudo chown -R root:root /usr/local/erlang
sudo chmod -R 755 /usr/local/erlang
System-Specific Troubleshooting
Rocky Linux 10 specific considerations include SELinux policy adjustments for applications requiring special permissions. Check SELinux status and configure policies as needed:
sestatus
sudo setsebool -P httpd_can_network_connect 1
Firewall configuration enables distributed Erlang communication across network interfaces. Configure firewall rules for Erlang port ranges:
sudo firewall-cmd --permanent --add-port=4369/tcp
sudo firewall-cmd --permanent --add-port=9100-9200/tcp
sudo firewall-cmd --reload
Diagnostic Commands and Tools
System information gathering commands assist in troubleshooting complex issues:
# System information
hostnamectl
free -h
df -h
# Package verification
rpm -V erlang
dnf history info
Log file analysis provides detailed error information for persistent problems. Check system logs for Erlang-related messages:
sudo journalctl | grep -i erlang
tail -f /var/log/messages
Post-Installation Configuration and Optimization
Proper configuration and optimization maximize Erlang performance and ensure smooth operation in production environments.
System-Wide Configuration
Environment variable optimization ensures consistent Erlang access across all user accounts. Configure variables in /etc/environment
for system-wide availability:
echo 'ERL_HOME=/usr/local/erlang' | sudo tee -a /etc/environment
echo 'PATH=/usr/local/erlang/bin:$PATH' | sudo tee -a /etc/environment
User-specific configurations provide flexibility for development environments while maintaining system-wide defaults. Create .erlang
files in user home directories for custom shell configurations:
echo 'io:format("Welcome to Erlang on Rocky Linux 10!~n").' > ~/.erlang
Performance Tuning
Memory allocation parameters significantly impact Erlang application performance. Configure heap sizes and memory management options based on application requirements:
export ERL_FLAGS="+K true +A 64"
Scheduler configuration optimizes CPU utilization for multi-core systems. Set scheduler count to match available CPU cores:
erl +S 4:4
Network and distribution settings enhance performance for distributed applications. Configure TCP buffer sizes and connection limits:
export ERL_EPMD_PORT=4369
export ERL_DIST_PORT_RANGE_LOW=9100
export ERL_DIST_PORT_RANGE_HIGH=9200
Security Considerations
File permissions and ownership protect Erlang installations from unauthorized access. Regularly audit and adjust permissions:
sudo find /usr/local/erlang -type f -exec chmod 644 {} \;
sudo find /usr/local/erlang -type d -exec chmod 755 {} \;
sudo find /usr/local/erlang/bin -type f -exec chmod 755 {} \;
Network security for distributed nodes requires proper authentication and encryption configuration. Enable SSL/TLS for inter-node communication in production environments.
Regular update procedures maintain security and stability. Establish automated update schedules for repository-based installations:
sudo dnf update erlang -y
Integration with Development Tools
IDE and editor integration enhances development productivity. Configure popular editors like VS Code, Vim, or Emacs with Erlang syntax highlighting and language support.
Version management tools like kerl or asdf provide flexible Erlang version switching for development environments:
# Install kerl
curl -O https://raw.githubusercontent.com/kerl/kerl/master/kerl
chmod a+x kerl
sudo mv kerl /usr/local/bin/
Container deployment considerations include creating optimized Docker images with pre-installed Erlang environments for consistent deployment across development and production environments.
Use Cases and Next Steps
Understanding common Erlang applications and development paths guides your next steps after successful installation.
Common Applications
RabbitMQ message broker installation represents one of the most popular Erlang applications. Install RabbitMQ after Erlang setup:
curl -s https://packagecloud.io/install/repositories/rabbitmq/rabbitmq-server/script.rpm.sh | sudo bash
sudo dnf install rabbitmq-server -y
Distributed system development leverages Erlang’s built-in clustering and fault-tolerance capabilities. Explore OTP (Open Telecom Platform) design patterns for building robust distributed applications.
Concurrent application programming benefits from Erlang’s actor model and lightweight process architecture. Start with simple concurrent programs before progressing to complex distributed systems.
Development Environment Setup
Project structure and build tools streamline Erlang development workflows. Tools like rebar3 provide project templates and dependency management:
# Install rebar3
wget https://s3.amazonaws.com/rebar3/rebar3
chmod +x rebar3
sudo mv rebar3 /usr/local/bin/
Testing framework configuration ensures code quality and reliability. Erlang includes EUnit and Common Test frameworks for comprehensive testing strategies.
Continuous integration setup enables automated testing and deployment. Configure CI/CD pipelines with Jenkins, GitLab CI, or GitHub Actions for Erlang projects.
Production Deployment Considerations
Monitoring and logging setup provides visibility into application performance and system health. Configure tools like Prometheus, Grafana, or ELK stack for comprehensive monitoring.
Backup and recovery procedures protect against data loss and system failures. Implement regular backup schedules for Erlang applications and configuration files.
Load balancing and clustering distribute application load across multiple nodes. Configure HAProxy or nginx for load balancing Erlang applications.
Congratulations! You have successfully installed Erlang. Thanks for using this tutorial for installing the Erlang programming language on your Rocky Linux 10 system. For additional help or useful information, we recommend you check the official Erlang website.