How to Install Environment-Modules Lmod on Manjaro
Environment-modules Lmod is an alternative to the traditional Tcl-based Environment-modules system for dynamically managing your shell environment on a per-application basis. This tutorial will provide step-by-step instructions on how to install Environment-modules Lmod on Manjaro.
Step 1: Update and Upgrade your System
The first step is to make sure your system is up to date.
sudo pacman -Syu
Step 2: Install Required Packages
Install the packages required to build Lmod:
sudo pacman -S lua readline
Step 3: Clone the Lmod Repo
Clone the Lmod repository:
git clone https://github.com/TACC/Lmod
Step 4: Build and Install Lmod
Build and install Lmod:
cd Lmod
./configure --prefix=/usr
make
sudo make install
Step 5: Update your Shell
Lmod is not yet integrated with Manjaro's system-wide environment. To use Lmod, you'll need to add the following lines to your shell configuration file:
source /etc/profile.d/z00_lmod.sh
alias module='source /etc/profile.d/z00_lmod.sh ; module'
For Bash users, run this command:
echo -e "\nsource /etc/profile.d/z00_lmod.sh" >> ~/.bashrc
echo -e "\nalias module='source /etc/profile.d/z00_lmod.sh ; module'\n" >> ~/.bashrc
For Zsh users, run this command:
echo -e "\nsource /etc/profile.d/z00_lmod.sh" >> ~/.zshrc
echo -e "\nalias module='source /etc/profile.d/z00_lmod.sh ; module'\n" >> ~/.zshrc
Step 6: Verify Lmod Installation
Source your shell config file or open a new terminal window and type:
module avail
If Lmod is installed correctly, you should see a list of available modules.
Congratulations, you have successfully installed Environment-modules Lmod on Manjaro.