Use "Module" to manage your Linux working env

Only To:  Software developers in Linux.

 

 

Linux use “module” to manage its functions, that is our working env (including: kernel, libs, tools…).

 

Below are some basic “module” commands, you need to know in your daily work.

 

List modules already loaded into your environment.

·        module list

·        Note:

o   Some modules may be loaded automatically by other modules.

o   And some tools (like “source build_init.sh”, “git_setup.sh”) will also unload/load some needed modules automatically.

o   So “module list” may give different output for shell windows, which have run: “source build_init.sh”.

 

Load modules

·        module load - load modules into your working shell window temporally.

o   Like: module load git/1.7.6; module load tp_isa_be/current

o   Note: modules loaded by “module load” are only valid in your working shell window. They will disappear after you close the window, and are not valid in other shell windows.

·        module initadd – load modules permanently (be added into your login bash, thus can be loaded automatically whenever you open a new shell window).

o   Like: module initadd java/1.6.0

·        Edit your login bash, to let some modules be loaded automatically. Refer to: How to setup your linux account

 

Unload modules

·        Module unload – unload modules from your working shell window

o   Like: module unload git/1.7.5

·        Edit your login bash, remove “module load …” from there. Refer to: How to setup your linux account

 

Check available modules

·        module avail [-a] [my_module]           - list [all] available modules

o   Like: module avail [-a] tww/perl

o   Then you can select a specific version to load. Like: module load tww/perl/5.8.8

Q&A:

1.      How to solve module confilct?

Some times, you may meet below error/warning, like: “WARNING: git/1.7.6 cannot be loaded due to a conflict. HINT: Might try module unload git first”. Then you need to open your login bash (~/.env/user.bashrc) to check, and unload some un-needed modules using “module unload xxx”.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值