0

I’m trying to install gfortran on Kali Linux with

sudo apt install gfortran

so I can build SciPy and gensim in a Python 3.12 virtual environment, but I keep getting this error:

Package gfortran is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or is only available from another source
E: Package 'gfortran' has no installation candidate

I followed official fortran page

sudo apt install gfortran

to check what version was installed type:

gfortran --version

You can install multiple versions up to version 10 (on Ubuntu 22.04) by typing the version number immediately after “gfortran”, e.g.:

sudo apt install gfortran-8
  • I checked too many sources, they are mentioning installing gfortran-versionNo but this does not work:

      apt search gfortran
    
      libgfortran5/now 14.2.0-8 amd64 [installed,local]
        Runtime library for GNU Fortran applications
    
  • sources.list file is correct:

    cat /etc/apt/sources.list
    deb http://http.kali.org/kali kali-rolling main contrib non-free non-free-firmware
    
  • I downloaded different package versions from Debian archive directory for GCC version 12 and version 13, tried to install them manually, none of them got installed

  • I run those commands:

    sudo apt update --fix-missing
    sudo apt clean
    duso apt autoclean
    
  • clearing the apt cache did not work:

    sudo rm /var/lib/apt/lists/*_*
    sudo apt update
    

How can I install a working Fortran compiler (gfortran) on Kali Linux?

this is system info:

Distributor ID: Kali
Description:    Kali GNU/Linux Rolling
Release:        2024.4
Codename:       kali-rolling
4
  • 5
    gfortran is available in Kali so there’s probably something wrong on the system. Try clearing the repository cache before updating again: sudo rm /var/lib/apt/lists/*_* then sudo apt update. Commented Sep 22 at 5:08
  • 1
    I'm able to install the gfortran package in a kalilinux/kali-rolling Docker container. The current Python on Kali Linux is 3.13.7. Could you say something about what release of Kali Linux you are running? Commented Sep 22 at 8:35
  • 1
    @MarcusMüller They want to build software that is written in Fortran. This is clear from the question. And gfortran is readily available on Kali Linux. IMHO, they would be able to get themselves into the same situation regardless of whether they ran Debian or Ubuntu, and it should be solvable on their current system without warranting a full system reinstallation. Commented Sep 22 at 8:39
  • @Yilmaz Execute command-not-found gfortran to see a package that provides gfortran Commented Sep 23 at 13:22

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.