Score:1

Why does my terminal show -bash: /usr/share/lmod/lmod/init/sh: No such file or directory

in flag
-bash: /usr/share/modules/init/sh: No such file or directory

When I open up my terminal this appears first. I was trying to install lmod, and I think this might be a result due to that. How do I remove it ?

Artur Meinild avatar
vn flag
It's likely something that has been added to your `~/.bashrc` or similar file.
Nate T avatar
it flag
Can you type `cat ~/.bashrc` in another terminal and paste the output to your question? if you right click terminal and select 'preferences', you can create another profile and specify '/bin/zsh' as the command. That will let you get around bash completely, for the time being.
Nate T avatar
it flag
You can also hold `ctrl+shift+F2` for tty. There is a separate terminal on every F key from 2-6. `ctrl+shift+F1` will bring you back.
Pranav Satheesh avatar
in flag
Here is the output for `cat ~/ .bashrc` : https://jpst.it/2yDPb
Score:1

EDIT:

As per this, installation of lmod probably changed one or more of the files in /etc/profile.d/*.sh.

You could try checking this (e.g., with the last modification date), and then look for the culprit.

Some info you could post to help:

  1. The contents of "suspicious" files among those referred to.
  2. The sequence of commands you used to install lmod. You could get this if you have history enabled.
  3. An exact copy of everything you get when launching a terminal, including possibly the prompt.

From a terminal, execute bash. You will likely see the same error message. If so, you can execute (preferably from a new terminal) bash -x -v. The options are:

  -v  Print shell input lines as they are read.
  -x  Print commands and their arguments as they are executed.

This way you would be able to identify the culprit of the error message.

Nate T avatar
it flag
Can you still use bash? If you are in ps2-4 ( cursor but no $, possibly a > ) you may be able to get around it with `CONTROL + c` . Remember also that there are multiple bash versions. If all else fails, you can reset the $TERM variable in .bashrc.
Pranav Satheesh avatar
in flag
`bash` doesn't return any output. But `bash - x -v` does, but the output is pretty long. I am not sure how to find the error there.
sancho.s ReinstateMonicaCellio avatar
pl flag
@PranavSatheesh - 1) Can you successfully execute commands (e.g., `ls -l`) in the prompt you get with `bash`? 2) Output of `bash - x -v` can be long. Can you spot the error message within it? You may copy all that output into a text editor and search. Please post the 10 lines above and 10 lines after the error message.
Pranav Satheesh avatar
in flag
I tried searching for the error message in `bash - x -v` output, but couldn't find it . Here's the output in txt file : https://justpaste.it/4zzpd
Pranav Satheesh avatar
in flag
I also tried `ls /etc/profile.d/` to see what's going on there. I can see the modules.sh file there: https://justpaste.it/24gvi
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.