Installing OpenFOAM2012-dev on mint

I keep getting this error each time i try to install openFoam2012-dev on my computer running mint 20. Each time i put the following command

$ sudo apt install openfoam2012-dev

I get this.

Reading package lists… Done
Building dependency tree
Reading state information… Done
E: Unable to locate package openfoam2012-dev

I have tried several times following all the steps as given on the preCICE page. Can anyone help please.

Did you try the instructions on the OpenFOAM homepage (debian · Wiki · Development / openfoam · GitLab) and did you check whether openfoam exists as an installation package? Run apt list | grep openfoam to see all available packages that have openfoam in there name. If openfoam2012-dev does not show up, something went wrong.

Yes i tried those instructions every step but its still giving the same result. I manually checked for any OpenFOAM repository and there was nothing. I did the same steps with ubuntu and it worked perfectly well but its not on this mint linux

Did you run sudo apt-get update after adding the repository and what are the output after running wget -q -O - https://dl.openfoam.com/add-debian-repo.sh | sudo bash and apt list | grep openfoam?

You could also try run the three steps mentioned on the OpenFOAM documentation (debian · Wiki · Development / openfoam · GitLab) manually and see how that works for you. Linux Mint 20 is based on Ubuntu 20.04 (Focal Fossa) in case you need to add the name of the distribution somewhere.

here is the information that i am getting after doing what you have suggested.
$ wget -q -O - https://dl.openfoam.com/add-debian-repo.sh | sudo bash
[sudo] password for lka62:
Detected distribution code-name: ulyssa
Overwrote /etc/apt/sources.list.d/openfoam.list
Importing openfoam gpg key… done
Overwrote /etc/apt/trusted.gpg.d/openfoam.gpg
Running apt-get update… done

The repository is setup! You can now install packages.
:~$ apt list | grep openfoam

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

libopenfoam/focal 1906.191111+dfsg1-2build1 amd64
openfoam-examples/focal,focal 1906.191111+dfsg1-2build1 all
openfoam/focal 1906.191111+dfsg1-2build1 amd64
:~$

I have also tried that debian Wiki development link you just posted and its not working

You could try to edit the file /etc/apt/sources.list.d/openfoam.list and replace the occurences of ulyssa by focal. Afterwards, run sudo apt-get update and check whether apt list | grep openfoam gives more installation options. However, I have no Linux Mint here so I cannot test that myself.

Just as addition: You should roughly know/understand what you are doing when editing the files as suggested by me. Otherwise, there are further installation options installed on the OpenFOAM homepage/wiki, see here. Alternatively you could switch to another Linux distribution that is officially supported by OpenFOAM.

@lkadzungura the add-debian-repo.sh script identifies your release using information in your /etc/lsb-release. This will then try to add one of the OpenFOAM PPA repositories. Since there is currently no repository for ulyssa, it does not know which repository to add.

You could manually add the respective Ubuntu repository. I guess the following should work for you:

sudo add-apt-repository -S 'deb https://dl.openfoam.com/repos/deb/dists/focal/ main'
# or maybe
sudo add-apt-repository -S 'deb https://dl.openfoam.com/repos/deb focal main'

I have not tested the command. If you find that it needs some tweak, please post here. This documentation page may help.

i have changed ulyssa to focal inside the openfoam.list document then i did sudo apt-get update and then installed. it worked. However i am now getting the following:

echo "source /usr/lib/openfoam/openfoam2012/etc/bashrc" >> ~/.bashrc source ~/.bashrc
bash: /usr/lib/openfoam/openfoam/etc/bashrc: No such file or directory
bash: /usr/share/openfoam/etc/bashrc: No such file or directory

I have checked inside this location /usr/lib/openfoam/openfoam2012/etc/ and the bashrc file is there.

I am not sure where the error is getting this path (/usr/lib/openfoam/openfoam/etc/) coz its not there but the path had to be this /usr/lib/openfoam/openfoam2012/etc/

i figured the way i entered the command up there is not clear:
:~ echo "source /usr/lib/openfoam/openfoam2012/etc/bashrc" >> ~/.bashrc :~ source ~/.bashrc
bash: /usr/lib/openfoam/openfoam/etc/bashrc: No such file or directory
bash: /usr/share/openfoam/etc/bashrc: No such file or directory

i have solved the problem. I opened the .bashrc file and noticed it had saved a source wrongly earlier when i kept trying many other options. So i deleted the wrong source path and left the correct path and it worked well

1 Like

Great to hear that it works now!

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.