# Installation problem on Ubuntu 20.04: libgfortran.so.4: cannot open shared object file: No such file or directory

**URL:** <https://community.freefem.org/t/installation-problem-on-ubuntu-20-04-libgfortran-so-4-cannot-open-shared-object-file-no-such-file-or-directory/2293>\
**Category:** FreeFEM installation\
**Created:** [February 25, 2023, 9:27am UTC](https://community.freefem.org/t/installation-problem-on-ubuntu-20-04-libgfortran-so-4-cannot-open-shared-object-file-no-such-file-or-directory/2293 "2023-02-25T09:27:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Smerdjakov](https://avatars.discourse-cdn.com/v4/letter/s/f4b2a3/32.png) [@Smerdjakov](https://community.freefem.org/u/Smerdjakov)\
**Post date:** [February 25, 2023, 9:27am UTC](https://community.freefem.org/t/installation-problem-on-ubuntu-20-04-libgfortran-so-4-cannot-open-shared-object-file-no-such-file-or-directory/2293/1 "2023-02-25T09:27:59Z")

</div>

I tried to install FreeFem on Ubuntu 20.04, as recommended on [Ubuntu installation](https://doc.freefem.org/introduction/installation.html#ubuntu-installation).

Everything seems to be ok until I try to run my .edp script, when I get the error

` ` ` `  
FreeFem++: error while loading shared libraries: libgfortran.so.4: cannot open shared object file: No such file or directory  
` ` ` `

I found similar error messages on this forum, as well as other sources on the web, e.g. [Ubuntu installation issue](https://community.freefem.org/t/installation-on-ubuntu-20-04/525), and others.

Yet I am unable to solve it.  
I have gfortran 11.3.0. It seems that gfortran 7 is needed, but I cannot even find a way to install it as it not on the Linux repositories.

I was hoping there would be some newer version of libgfortran.so.+, to link as in the solution I mentioned before, but I do not know how to find them.

If I issue the command, as suggested by another expert user non this forum

` ` ` `  
ls /usr/lib/libgfortran.so\*

` ` ` `  
I get

` ` ` `  
ls: cannot access ‘/usr/lib/libgfortran.so\*’: No such file or directory

` ` ` `

Any suggestion please? I am really eager to get my scripts up and running again.  
Thanks

---

<div class="post-metadata">

**Author:** ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)\
**Post date:** [February 25, 2023, 3:59pm UTC](https://community.freefem.org/t/installation-problem-on-ubuntu-20-04-libgfortran-so-4-cannot-open-shared-object-file-no-such-file-or-directory/2293/2 "2023-02-25T15:59:42Z")

</div>

This is not the recommended way to install FreeFEM. That one is: [GitHub - FreeFem/FreeFem-sources: FreeFEM source code](https://github.com/FreeFem/FreeFem-sources#freefem).

---

<div class="post-metadata">

**Author:** ![Smerdjakov](https://avatars.discourse-cdn.com/v4/letter/s/f4b2a3/32.png) [@Smerdjakov](https://community.freefem.org/u/Smerdjakov)\
**Post date:** [February 26, 2023, 10:10am UTC](https://community.freefem.org/t/installation-problem-on-ubuntu-20-04-libgfortran-so-4-cannot-open-shared-object-file-no-such-file-or-directory/2293/3 "2023-02-26T10:10:57Z")

</div>

Thanks very much for this.  
I did try the process you suggest, seemed to go through.  
I got an error after `autoreconf -i ` about some packages missing (unzip, bison), got this sorted, moved on, got some warnings during compilation of PETSc and other solvers, and a couple of failed steps at the `make check` step though).

Tried to run my .edp script with

```auto

FreeFem++ my_script.edp

```

and got the same error message as before

```auto
FreeFem++: error while loading shared libraries: libgfortran.so.4: cannot open shared object file: No such file or directory

```

This must be the previous installation done still being called. I searched about how to uninstall, and ended up with

```auto
rm -rf /usr/local/share/freefem++ /usr/local/lib/ff++ 
rm -f /usr/local/bin/FreeFem++	/usr/local/bin/FreeFem++-nw /usr/local/bin/FreeFem++-mpi /usr/local/bin/FreeFem++-x11

```

Is this OK? How to uninstall it properly? Should have maybe done it before installing from source?

Now when I try

```auto
FreeFem++ my_script.edp

```

I get

Command ‘FreeFem++’ not found, but can be installed with:  
sudo apt install freefem++

I wonder do I need to issue some

```auto
EXPORT PATH = <..>

```

command, , pointing to some FreeFeem++ executable?

Sorry I am really not that computer-literate, I apologise for the trivial issues.  
I would have expected it to run anyhow, as I am issuing

```auto
FreeFem++ my_script.edp

```

from the FreeFem-sources directory, where my script is and presumably the FreeFem++ executable.

Thanks a lot for your support

---

<div class="post-metadata">

**Author:** ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)\
**Post date:** [February 26, 2023, 1:28pm UTC](https://community.freefem.org/t/installation-problem-on-ubuntu-20-04-libgfortran-so-4-cannot-open-shared-object-file-no-such-file-or-directory/2293/4 "2023-02-26T13:28:20Z")

</div>

You need to ensure that the binary is in your path indeed.

---

<div class="post-metadata">

**Author:** ![Smerdjakov](https://avatars.discourse-cdn.com/v4/letter/s/f4b2a3/32.png) [@Smerdjakov](https://community.freefem.org/u/Smerdjakov)\
**Post date:** [February 26, 2023, 9:43pm UTC](https://community.freefem.org/t/installation-problem-on-ubuntu-20-04-libgfortran-so-4-cannot-open-shared-object-file-no-such-file-or-directory/2293/5 "2023-02-26T21:43:41Z")

</div>

Made it, thanks . I still had an issue with not finding libhdf5.so.103, but creating a symbolic link to libhdf5\_serial.so.103 (only \_serial versions were in the installation) made it, it works a charm now, thank you very much
