How To Install environment-modules on CentOS 8

environment-modules is Provides dynamic modification of a user’s environment

Introduction

In this tutorial we learn how to install environment-modules on CentOS 8.

What is environment-modules

The Environment Modules package provides for the dynamic modification of a user’s environment via modulefiles. Each modulefile contains the information needed to configure the shell for an application. Once the Modules package is initialized, the environment can be modified on a per-module basis using the module command which interprets modulefiles. Typically modulefiles instruct the module command to alter or set shell environment variables such as PATH, MANPATH, etc. modulefiles may be shared by many users on a system and users may have their own collection to supplement or replace the shared modulefiles. Modules can be loaded and unloaded dynamically and atomically, in an clean fashion. All popular shells are supported, including bash, ksh, zsh, sh, csh, tcsh, as well as some scripting languages such as perl. Modules are useful in managing different versions of applications. Modules can also be bundled into metamodules that will load an entire suite of different applications. NOTE have access to the module alias.

We can use yum or dnf to install environment-modules on CentOS 8. In this tutorial we discuss both methods but you only need to choose one of method to install environment-modules.

Install environment-modules on CentOS 8 Using dnf

Update yum database with dnf using the following command.

sudo dnf makecache --refresh

The output should look something like this:

CentOS Linux 8 - AppStream                                       43 kB/s | 4.3 kB     00:00    
CentOS Linux 8 - BaseOS                                          65 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - ContinuousRelease                               43 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - Extras                                          23 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - FastTrack                                       40 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - HighAvailability                                36 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - Plus                                            24 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - PowerTools                                      50 kB/s | 4.3 kB     00:00    
Extra Packages for Enterprise Linux Modular 8 - x86_64           13 kB/s | 9.2 kB     00:00    
Extra Packages for Enterprise Linux 8 - x86_64                   24 kB/s | 8.5 kB     00:00    
Metadata cache created.

After updating yum database, We can install environment-modules using dnf by running the following command:

sudo dnf -y install environment-modules

Install environment-modules on CentOS 8 Using yum

Update yum database with yum using the following command.

sudo yum makecache --refresh

The output should look something like this:

CentOS Linux 8 - AppStream                                       43 kB/s | 4.3 kB     00:00    
CentOS Linux 8 - BaseOS                                          65 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - ContinuousRelease                               43 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - Extras                                          23 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - FastTrack                                       40 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - HighAvailability                                36 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - Plus                                            24 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - PowerTools                                      50 kB/s | 4.3 kB     00:00    
Extra Packages for Enterprise Linux Modular 8 - x86_64           13 kB/s | 9.2 kB     00:00    
Extra Packages for Enterprise Linux 8 - x86_64                   24 kB/s | 8.5 kB     00:00    
Metadata cache created.

After updating yum database, We can install environment-modules using yum by running the following command:

sudo yum -y install environment-modules

How To Uninstall environment-modules on CentOS 8

To uninstall only the environment-modules package we can use the following command:

sudo dnf remove environment-modules

environment-modules Package Contents on CentOS 8

/etc/environment-modules
/etc/environment-modules/initrc
/etc/environment-modules/modulespath
/etc/environment-modules/siteconfig.tcl
/etc/modulefiles
/etc/profile.d/modules.csh
/etc/profile.d/modules.sh
/usr/bin/envml
/usr/bin/modulecmd
/usr/lib/.build-id
/usr/lib/.build-id/e0
/usr/lib/.build-id/e0/57f89b1230f497b3151c88c19534dddc26b04e
/usr/lib/rpm/macros.d/macros.environment-modules
/usr/lib64/libtclenvmodules.so
/usr/share/Modules
/usr/share/Modules/bin
/usr/share/Modules/bin/add.modules
/usr/share/Modules/bin/createmodule.py
/usr/share/Modules/bin/createmodule.sh
/usr/share/Modules/bin/mkroot
/usr/share/Modules/init
/usr/share/Modules/init/bash
/usr/share/Modules/init/bash_completion
/usr/share/Modules/init/cmake
/usr/share/Modules/init/csh
/usr/share/Modules/init/fish
/usr/share/Modules/init/fish_completion
/usr/share/Modules/init/ksh
/usr/share/Modules/init/ksh-functions
/usr/share/Modules/init/ksh-functions/ml
/usr/share/Modules/init/ksh-functions/module
/usr/share/Modules/init/ksh-functions/switchml
/usr/share/Modules/init/lisp
/usr/share/Modules/init/perl.pm
/usr/share/Modules/init/profile-compat.csh
/usr/share/Modules/init/profile-compat.sh
/usr/share/Modules/init/profile.csh
/usr/share/Modules/init/profile.sh
/usr/share/Modules/init/python.py
/usr/share/Modules/init/r.R
/usr/share/Modules/init/ruby.rb
/usr/share/Modules/init/sh
/usr/share/Modules/init/tcl
/usr/share/Modules/init/tcsh
/usr/share/Modules/init/tcsh_completion
/usr/share/Modules/init/zsh
/usr/share/Modules/init/zsh-functions
/usr/share/Modules/init/zsh-functions/_module
/usr/share/Modules/libexec
/usr/share/Modules/libexec/modulecmd.tcl
/usr/share/Modules/modulefiles
/usr/share/Modules/modulefiles/dot
/usr/share/Modules/modulefiles/module-git
/usr/share/Modules/modulefiles/module-info
/usr/share/Modules/modulefiles/modules
/usr/share/Modules/modulefiles/null
/usr/share/Modules/modulefiles/use.own
/usr/share/doc/environment-modules
/usr/share/doc/environment-modules/CONTRIBUTING.txt
/usr/share/doc/environment-modules/ChangeLog
/usr/share/doc/environment-modules/MIGRATING.txt
/usr/share/doc/environment-modules/NEWS.txt
/usr/share/doc/environment-modules/README
/usr/share/doc/environment-modules/diff_v3_v4.txt
/usr/share/doc/environment-modules/example.txt
/usr/share/licenses/environment-modules
/usr/share/licenses/environment-modules/COPYING.GPLv2
/usr/share/man/man1/ml.1.gz
/usr/share/man/man1/module-c.1.gz
/usr/share/man/man1/module.1.gz
/usr/share/man/man4/modulefile-c.4.gz
/usr/share/man/man4/modulefile.4.gz
/usr/share/modulefiles
/usr/share/vim/vimfiles/ftdetect/modulefile.vim
/usr/share/vim/vimfiles/ftplugin/modulefile.vim
/usr/share/vim/vimfiles/syntax/modulefile.vim

References

Summary

In this tutorial we learn how to install environment-modules on CentOS 8 using yum and dnf.