How to fix LaTeX Error: File `scrartcl.cls’ not found on Ubuntu

Problem:

You want to compile your LaTeX file on Ubuntu using latex or pdflatex but you see an error message like this:

! LaTeX Error: File `scrartcl.cls' not found.

Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: cls)

Solution

sudo apt -y install texlive-latex-recommended

This will install, among many other LaTeX files, scrartcl.cls.