I have just downloaded texmaker to make a local copy of a tex file from overleaf but when I try to generate the pdf I get the following error

Latex Error: File 'algorithm.sty' not found.

My computer runs Ubuntu a fix online says to run the following command in the terminal

sudo apt-get install texlive-science

That hasn't worked either.

If anyone can help that would be much appreciated thank you

  • Welcome to TeX.SX! Probably there is just a typo. The quoted error message sais algorthim while, you propably wanted to use algorithm.
    – leandriis
    Jun 18, 2020 at 19:17
  • @leandriis: Is this a typo contest? :o)
    – Bernard
    Jun 18, 2020 at 19:19
  • 1
    You might want to install apt-file, then run sudo apt-file update and then apt-file search algorithm.sty, this will tell you exactly which Ubuntu deb package provides this file (if any)
    – daleif
    Jun 18, 2020 at 19:20
  • @leandriis The output was this, I will be honest I have no idea what to do with it. latexml: /usr/share/perl5/LaTeXML/Package/algorithm.sty.ltxml texlive-lang-arabic: /usr/share/texlive/texmf-dist/tex/lualatex/simurgh/simurgh-algorithm.sty texlive-science: /usr/share/texlive/texmf-dist/tex/latex/algorithms/algorithm.sty
    – MP34
    Jun 18, 2020 at 19:38
  • do not use the distro package manager; install texlive from tug.org/texlive/quickinstall.html Jun 18, 2020 at 20:01

1 Answer 1


I was having the same issue and installing texlive-science package solved the issue:

sudo apt-get update -y

sudo apt-get install -y texlive-science

  • thank you, this works for me too.
    – arilwan
    Apr 20, 2021 at 9:26
  • I have windows and I have the same problem. Texlive-science doesn't seem to exist for windows. How can I solve this problem? Dec 13, 2021 at 13:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.