Current environment-modules package installs the
/etc/profile.d/modules.sh script to get the module function
initialized in interactive shells but no configuration is made to make
module available in non-interactive shells.
Most users also expect to get the module function defined when running
a shell script or when connecting to a host with ssh.
You can find several people expressing this issue on AskUbuntu for instance:
https://askubuntu.com/q/1348222/1028641
https://askubuntu.com/q/1275066/1028641
https://askubuntu.com/q/1539132/1028641
https://askubuntu.com/q/1490728/1028641
Steps to reproduce the issue:
1. apt-get install bash environment-modules
2. bash -c 'module --version'
It would be useful to also configure shells to initialize module in
non-interactive mode when installing environment-modules package. Or
at least to print a warning message at the end of the package
installation to indicate some extra configuration steps to perform.