If module(1) availability differs between GUI and CLI, then module initialization on your system differs by type of shell invocation, meaning non-interactive vs. interactive vs. login vs. remote.
For diagnostics, from a terminal in an X11 session where "module list" currently fails, run:
xterm -ls
If "module list" _does_ work in the resulting new window, then your distro has shells configured to read /etc/profile.d/* for login shells only, which has been the historic default.
To rectify, your choices are:
(a) Have your X11 terminal flavor always invoke shells as login shells, not merely interactive shells. Consult the terminal application's preferences or its man page. For xterm specifically, add to your ~/.Xresources file or your distro's equivalent under /etc/ :
XTerm*loginShell: true
One way to actually pick up and test this change is to end and re-start your entire X11 session.
(b) Have the module initialization done for shells invoked as _non-login_ shell [and this not be needlessly repeated if it _is_ a login shell.] To this end, search for "etc/" in the shell's man page; for bash(1), see section "INVOCATION".
It is not quite trivial to hook this in correctly for all shell implementations offered, to all local users, in all invocation types, and remain so across system updates/re-installations.
With best regards,
--
Michael Sternberg, Ph.D.
Principal Scientific Computing Administrator
Center for Nanoscale Materials
Argonne National Laboratory
> On Jan 16, 2023, at 06:37, Zhéxué M. Krawutschke <sys...@ro...> wrote:
> …
> After the "make && make install" I add the following 2 links to "/etc/profile.d":
> ln -s /usr/local/Modules/Release_5/5.2.0/init/profile.csh modules.csh
> ln -s /usr/local/Modules/Release_5/5.2.0/init/profile.sh modules.sh
>
> After that, I can log in to the TTY console as well as via SSH and do not receive any error messages. What does not work properly is the work under X-Window.
> …
> Z. Matthias
|