CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Installation (
-   -   OpenFoam 1.6 Permissions in Ubuntu 9.04 (

AlanR August 6, 2009 18:02

OpenFoam 1.6 Permissions in Ubuntu 9.04
I'm trying to install OpenFoam 1.6 on Ubuntu 9.04. I have downloaded and unpacked the four download files, and edited the $HOME/OpenFOAM/OpenFOAM-1.6/etc/bashrc file as stated in the readme file installation notes.
When I try to source the file, or open a new terminal window, I get the following message: bash: /home/alan/OpenFOAM/OpenFOAM-1.6/etc/bashrc: Permission Denied.
I have permission to edit the .bashrc file in my home directory, but not the bashrc file or other files (like the controlDict) that were unpacked in the OpenFOAM directories. Do I have a problem with permissions? How do I correct it, so I can update my environment?

Thanks in advance, Alan

linnemann August 7, 2009 05:49

Hey try this

sudo chown -R alan:yourgroup /home/alan/OpenFOAM/
sudo chmod -R 755 /home/alan/OpenFOAM/

Substitute yourgroup in the first line with a group if you need some other user to access your openfoam install files, otherwise just neglect it and do

sudo chown -R alan /home/alan/OpenFOAM/
sudo chmod -R 755 /home/alan/OpenFOAM/

It should work.

AlanR August 7, 2009 14:04

Thank you

Thank you, that fixed it.:cool:
I will get better at Linux eventually.

I made (and already fixed) the same mistake I read in some other threads: The installation instructions tell you to make a directory called $HOME/OpenFOAM. I made one called "/home/OpenFOAM" - which is wrong. Type $HOME in the terminal and make the OpenFOAM directory there. In my case that's "/home/alan/OpenFOAM".

With directories in the right place and permissions set correctly, the directions in the readme file worked for my installation.

Nickul August 13, 2009 18:22


baaah,, I'm flummuxed completely now.... I'm a complete newbie to Linux so I apologise for the basic question but where do I install Openfoam? :)

$HOME/OpenFOAM seems to be the favoured option but then you say at the end of your post "In my case that's "/home/alan/OpenFOAM"

A most confused Nick

AlanR August 13, 2009 18:31

I'm pretty new at linux myself. $HOME is not the same thing as /home. To find out what it is on your system enter 'echo $HOME'. When I do that, I get /home/alan. The correct installation directory for OpenFOAM on my system is: $HOME/OpenFOAM which is the same directory as /home/alan/OpenFOAM. Don't make the mistake I made and put it in /home/OpenFOAM.

I hope this helps. I'm still having problems getting ParaFoam to work.


Nickul August 13, 2009 18:40

Not suprisingly when I type that in I get /home/nick !!

What has just twigged in my head is that $HOME is a shorthand for the USER directory.

Thankyou, that is making a bit more sense

Nickul August 13, 2009 19:31

I've had exactly the same permissions trouble , but the second post fixed it good and proper.

I'm completely unable to run either the foamSystemCheck or the foamInstallationTest scripts though , I just get a "command not found" error.

akidess August 14, 2009 15:08

You should not have any troubles with permissions extracting OpenFOAM into your home directory, so I think something isn't right from the get-go.

Your system cannot find the files because the bashrc file is probably not being sourced. Maybe a wrong path in your ~/.bashrc. By the way, "~/" is equivalent to "$HOME/".

Nickul August 14, 2009 17:38

I've checked and double checked the paths but no joy.
So literally I have this as my last few lines of my bashrc file. (So this is my $HOME/bashrc) ;

# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if [ -f /etc/bash_completion ]; then
. /etc/bash_completion

. $HOME/OpenFOAM/OpenFOAM-1.6/etc/bashrc

akidess August 14, 2009 17:48

That looks ok. Try executing ". $HOME/OpenFOAM/OpenFOAM-1.6/etc/bashrc" in a terminal window and if there is no output try executing foamInstallationTest in that terminal.

Nickul August 14, 2009 17:55

not a sausage :)

nick@nick-desktop:~$ .$HOME/OpenFOAM/OpenFOAM-1.6/etc/bashrc
bash: ./home/nick/OpenFOAM/OpenFOAM-1.6/etc/bashrc: No such file or directory

akidess August 14, 2009 17:57

You need a space between the dot and $HOME :)

Nickul August 14, 2009 18:07

ahh hah ! thats sorted it a treat.


So what has happened? I figure the $HOME /bashrc file is a bit like an autoexec.bat and config.sys files of yesteryear and then adding this line references the openfoam bashrc file that then sets up the envoirenment variables.....
So typing this last line into the terminal (.$HOME/OpenFOAM/OpenFOAM-1.6/etc/bashrc)registered the OpenFoam bashrc onto the system ? rather than letting the $home/bashrc file do it????????

akidess August 14, 2009 18:21

Yeah, the bashrc is actually a lot like autoexec.bat, except that each user has his own bashrc. Executing ". $HOME/OpenFOAM/OpenFOAM-1.6/etc/bashrc" does set up all the environment variables.

Exactly the same happens by adding that line to ~/.bashrc, except that the command in ~/.bashrc is only executed when you open a new terminal (like autoexec.bat is only executed once after booting). So all you did was manually source the file instead of letting the system do it.

wouter December 28, 2009 20:45

hello Nick,

I think you need to edit $HOME/.bashrc not $HOME/bashrc (dot missing!) you do not see this file with 'ls' but with 'ls -a' you do.
Hope this helps


All times are GMT -4. The time now is 16:31.