user13869189
user13869189

Reputation:

How to install libgfortran.so.3 on ubuntu 20.04

When I try to install libgfortran.so.3 on Ubuntu 20.04 using:

sudo apt-get install libgfortran3  

it shows:

E: Unable to locate package libgfortran3

How can I install Fortran on 20.04?

Upvotes: 8

Views: 32728

Answers (3)

Debanjan Pal
Debanjan Pal

Reputation: 21

To install libgfortran libraries in Ubuntu 20.04:

  1. First install gcc version 6
  2. Then install libgfrotran3

Use this link to download the files. Click here

Upvotes: 1

Edmund Walsh
Edmund Walsh

Reputation: 111

The problem here is that 20.04 doesn't support g++-6. To get around this you need a multi-step process:

  1. Put a temporary repository into /etc/apt/sources.list. For me that was deb http://gb.archive.ubuntu.com/ubuntu/ bionic main universe

  2. Now you can install gcc version 6 sudo apt-get install g++-6

  3. Make that the default version sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 6

  4. Now install gfortran sudo apt-get install libgfortran3

  5. Make sure it works strings /usr/lib/x86_64-linux-gnu/libgfortran.so.3.0.0 | grep GFORTRAN*

Upvotes: 11

nicholas like
nicholas like

Reputation: 11

libgfortran3 is not supported any more in Ubuntu 20.04 as it depends on an older version of gcc, which is no longer maintained in this version of the distribution. You can install a later version of libgfortran using:

sudo apt-get install libgfortran5

Upvotes: 0

Related Questions