When running pdflatex on ubuntu 18.04 I get LaTeX Error: File marginnote.sty not found.

locate marginnote.sty



But he does find e. g. amssymb.

locate amssymb




latex --version


pdfTeX 3.14159265-2.6-1.40.18 (TeX Live 2017/Debian)
kpathsea version 6.2.3
Copyright 2017 Han The Thanh (pdfTeX) et al.
There is NO warranty.  Redistribution of this software is
covered by the terms of both the pdfTeX copyright and
the Lesser GNU General Public License.
For more information about these matters, see the file
named COPYING and the pdfTeX source.
Primary author of pdfTeX: Han The Thanh (pdfTeX) et al.
Compiled with libpng 1.6.34; using libpng 1.6.34
Compiled with zlib 1.2.11; using zlib 1.2.11
Compiled with poppler version 0.62.0

I now applied sudo texhash /usr/share/texlive/texmf-dist but that did not help.

The reason probably is that I did some updates with python3 before (up to then everthing worked fine), e. g.

sudo apt autoremove python2
sudo apt autoremove python2.7
sudo apt install -y python3-pip

Can you help me to get pdflatex running again (this is more important to me than python3 and pip3)?

1 Answer 1


This helped:

sudo apt-get install texlive-latex-extra

(And as I see during installation this uses python2.7; so indeed removing python2.7 caused the problem.)

  • Yep, LaTeX packaging in Ubuntu is a pain. I wish they could provide fake packages and just install a full TeXLive...
    – Rmano
    Jan 24, 2021 at 10:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .