# Installing Freefem on Ubuntu 20.04

**URL:** <https://community.freefem.org/t/installing-freefem-on-ubuntu-20-04/1994>\
**Category:** FreeFEM installation\
**Created:** [September 9, 2022, 7:37am UTC](https://community.freefem.org/t/installing-freefem-on-ubuntu-20-04/1994 "2022-09-09T07:37:34Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ivan\_Graham](https://avatars.discourse-cdn.com/v4/letter/i/57b2e6/32.png) [@Ivan\_Graham](https://community.freefem.org/u/Ivan_Graham)\
**Post date:** [September 9, 2022, 7:37am UTC](https://community.freefem.org/t/installing-freefem-on-ubuntu-20-04/1994/1 "2022-09-09T07:37:34Z")

</div>

I’m installing freefem on a new ubuntu laptop, following the instructions at [Installation guide](https://doc.freefem.org/introduction/installation.html)

Everything is OK until I am installing petsci. When I do

make petsc-slepc

I get the error:

cp: cannot create regular file ‘/usr/local/ff-petsc/r/lib/libtet.a’: Permission denied

* * *

make: \*\*\* [Makefile:234: petsc-3.17.0/tag-conf-real] Error 1

Can someone help?

---

<div class="post-metadata">

**Author:** ![frederichecht](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/frederichecht/32/15_2.png) [@frederichecht](https://community.freefem.org/u/frederichecht)\
**Post date:** [September 9, 2022, 8:18am UTC](https://community.freefem.org/t/installing-freefem-on-ubuntu-20-04/1994/2 "2022-09-09T08:18:46Z")

</div>

You need to to do some thing like

```auto
sudo chown -R $USER /usr/local/ff-petsc

```

or compile freefem++ under sudo ,  
if you was no sudo privilege reconfigure in place where you have access.like :

```auto
./configure --prefix=$HOME/mycode .....

```

---

<div class="post-metadata">

**Author:** ![Ivan\_Graham](https://avatars.discourse-cdn.com/v4/letter/i/57b2e6/32.png) [@Ivan\_Graham](https://community.freefem.org/u/Ivan_Graham)\
**Post date:** [September 9, 2022, 10:51am UTC](https://community.freefem.org/t/installing-freefem-on-ubuntu-20-04/1994/3 "2022-09-09T10:51:32Z")

</div>

Frederic, thanks for the advice.

I have sudo and did

sudo chown -R $USER /usr/local/ff-petsc

and this worked perfectly. So have installed PetSc-SlepSc successfully.

Now I have another problem at step 7 of the Installation Guide for Ubuntu: ``Build your **FreeFEM** library and executable’’

The output is below: I did run 3rdparty/getall before I ran these commands

ivan@ivan-XPS-9320:~/FreeFem-sources$ make -j

bash: syntax error near unexpected token `newline’

ivan@ivan-XPS-9320:~/FreeFem-sources$ make -j check

bash: nbProcs: No such file or directory

Thanks and best wishes. Ivan

---

<div class="post-metadata">

**Author:** ![Ivan\_Graham](https://avatars.discourse-cdn.com/v4/letter/i/57b2e6/32.png) [@Ivan\_Graham](https://community.freefem.org/u/Ivan_Graham)\
**Post date:** [September 9, 2022, 2:12pm UTC](https://community.freefem.org/t/installing-freefem-on-ubuntu-20-04/1994/4 "2022-09-09T14:12:04Z")

</div>

Frederic, thanks for the advice.

I have sudo and did

sudo chown -R $USER /usr/local/ff-petsc

and this worked perfectly. So have installed PetSc-SlepSc successfully.

Now I have another problem at step 7 of the Installation Guide for Ubuntu: ``Build your **FreeFEM** library and executable’’

The output is below: I did run 3rdparty/getall before I ran these commands

ivan@ivan-XPS-9320:~/FreeFem-sources$ make -j

bash: syntax error near unexpected token `newline’

ivan@ivan-XPS-9320:~/FreeFem-sources$ make -j check

bash: nbProcs: No such file or directory

Thanks and best wishes. Ivan

---

<div class="post-metadata">

**Author:** ![frederichecht](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/frederichecht/32/15_2.png) [@frederichecht](https://community.freefem.org/u/frederichecht)\
**Post date:** [September 9, 2022, 3:54pm UTC](https://community.freefem.org/t/installing-freefem-on-ubuntu-20-04/1994/5 "2022-09-09T15:54:12Z")

</div>

Yes have after compiled Petsc and Slepc to ré configure  
So do  
./reconfigure  
make -j 10

---

<div class="post-metadata">

**Author:** ![Ivan\_Graham](https://avatars.discourse-cdn.com/v4/letter/i/57b2e6/32.png) [@Ivan\_Graham](https://community.freefem.org/u/Ivan_Graham)\
**Post date:** [September 10, 2022, 6:40am UTC](https://community.freefem.org/t/installing-freefem-on-ubuntu-20-04/1994/6 "2022-09-10T06:40:48Z")

</div>

OK  
I have done

./reconfigure  
make-j 10

and this has run successfully. Now I am at step 8

make install

I run this and get errors at the very end:

make[3]: Entering directory ‘/home/ivan/FreeFem-sources/src/nw’  
/usr/bin/mkdir -p ‘/usr/local/bin’  
/usr/bin/install -c FreeFem++ FreeFem+±nw ffglut ‘/usr/local/bin’  
/usr/bin/install: cannot remove ‘/usr/local/bin/FreeFem++’: Permission denied  
/usr/bin/install: cannot remove ‘/usr/local/bin/FreeFem+±nw’: Permission denied  
/usr/bin/install: cannot remove ‘/usr/local/bin/ffglut’: Permission denied  
make[3]: \*\*\* [Makefile:594: install-binPROGRAMS] Error 1  
make[3]: Leaving directory ‘/home/ivan/FreeFem-sources/src/nw’  
make[2]: \*\*\* [Makefile:850: install-am] Error 2  
make[2]: Leaving directory ‘/home/ivan/FreeFem-sources/src/nw’  
make[1]: \*\*\* [Makefile:549: install-recursive] Error 1  
make[1]: Leaving directory ‘/home/ivan/FreeFem-sources/src’  
make: \*\*\* [Makefile:800: install-recursive] Error 1  
ivan@ivan-XPS-9320:~/FreeFem-sources$

You do say that it’s not necessary to run make install, but if I call Freefem from the command line I get the error:

ivan@ivan-XPS-9320:~/Dropbox/computing/freefem\_code$ FreeFem++ Laplace.edp  
FreeFem++: error while loading shared libraries: libgfortran.so.4: cannot open shared object file: No such file or directory
