fortls command not found

In this troubleshooting guide we learn how to fix fortls command not found error message

Introduction

When you run more command in linux terminal / console, you get the following error message

fortls: command not found

or when using sudo you get the following error message

sudo: fortls: command not found

Solutions to fortls: command not found

How To Fix fortls: command not found in Ubuntu / Debian / Kali Linux / Raspbian

In Ubuntu fortls is provided by fortran-language-server package.

fortran-language-server is:

Fortran Language Server (fortls) is an implementation of the Language Server Protocol. It can be used with editors that supports the protocol (e.g. Emacs with elpa-lsp-mode) to offer support for code completion and documentation.

Supported LSP features include:

  • Document symbols (textDocument/documentSymbol)
  • Auto-complete (textDocument/completion)
  • Signature help (textDocument/signatureHelp)
  • GoTo/Peek definition (textDocument/definition)
  • Hover (textDocument/hover)
  • GoTo implementation (textDocument/implementation)
  • Find/Peek references (textDocument/references)
  • Project-wide symbol search (workspace/symbol)
  • Symbol renaming (textDocument/rename)
  • Documentation parsing (Doxygen and FORD styles)
  • Diagnostics

To fix this problem, we can install more using the command below.

sudo apt-get -y install fortran-language-server

This command might take some time to finish depending on your machine internet connection.

You can also use apt command to install fortran-language-server.

sudo apt -y install fortran-language-server

Or if you have aptitude installed you can use the following command.

sudo aptitude install fortran-language-server

Summary

In this tutorial we learn how to fix fortls command not found error in Ubuntu / Debian / Kali Linux or Raspbian distribution.