I am new to ubuntu and basically know nothing. I am using ubuntu 12.04 (need this exact version). I was trying to install OpenFOAM 2.1.1, from the source code. I needed to source the bashrc file, I did exactly as explained on their website (http://openfoam.org/download/2-1-1-source/) but it did not work. I needed OpenFOAM urgently, so I downloaded normally rather than from the source code. When you install that way, OpenFOAM is created in /opt instead of home. OpenFOAM was working, but the solver I was gonna use was not, so I removed OpenFOAM completely. Now I'm trying to install from the source code again, and in source bashrc step, I keep getting this error:

bash: /opt/openfoam211/etc/bashrc: No such file or directory

Why is it still trying to source to the old file that does not even exist anymore? The annoying thing is, I did it before, exact same computer, exact same steps, but I reinstalled ubuntu a while back (same exact ubuntu) and this time I can't do it.

Edit: Apparently I thought bashrc and .bashrc is the same thing, and they were obviously not. Problem solved.

  • Did you edit your ~/.bashrc file to include source $HOME/OpenFOAM/OpenFOAM-2.1.1/etc/bashrc, and then do a source $HOME/.bashrc at the terminal command prompt? – heynnema Jan 10 '17 at 19:20
  • Yes, I did exactly that. – Nerys Jan 10 '17 at 19:33
  • In terminal, what is the output of cat $HOME/OpenFOAM/OpenFOAM-2.1.1/etc/bashrc? And grep -i openfoam $HOME/.bashrc? – heynnema Jan 10 '17 at 19:41
  • First one gives this as result pasted.co/a0d4c73f and second one this source /opt/openfoam211/etc/bashrc – Nerys Jan 10 '17 at 20:04

From the comments...

When editing your ~/.bashrc file, the instructions say to add the following command...

source $HOME/OpenFOAM/OpenFOAM-2.1.1/etc/bashrc

and you entered...

source /opt/openfoam211/etc/bashrc

You could actually even leave the edit out of ~/.bashrc, because the file at $HOME/OpenFOAM/OpenFOAM-2.1.1/etc/bashrc is effectively empty.

  • Comments are not for extended discussion; the entire conversation taking place here and all other comments have been moved to chat. – Thomas Ward Jan 15 '17 at 2:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.