Beginner guide

TeX Live and TeXstudio

Full TeX Live installation with texlive-full, TeXstudio setup, and fixing the PDF viewer integration on an Ubuntu-based distro.

Beginner Updated Linux Mint 22.3 Cinnamon (Ubuntu 24.04 Noble base); also tested on Zorin OS 18.1 Pro

Verified Working

Hardware context: Lenovo ThinkPad L14 Gen 2 (Intel i5-1135G7, 16GB RAM, Intel Iris Xe, 1366x768)

Overview

On Linux, the standard LaTeX distribution is TeX Live, and texlive-full installs all of it in one go (~6 GB) so you never hit a missing-package error mid-document. This guide installs TeX Live and the TeXstudio editor, then shows how to remove the few unwanted extras that texlive-full pulls in — safely, without letting apt cascade into removing TeX Live itself.


Prerequisites

  • Any Ubuntu 24.04-based distro
  • ~6 GB free disk space for texlive-full
  • Internet connection
  • Before removing TeX packages, review the clean installation and removal best practices, especially --no-autoremove and apt-mark manual

The Problem (Windows User Perspective)

On Windows, you’d install MiKTeX and get a GUI package manager that downloads LaTeX packages on-the-fly. On Linux, the standard LaTeX distribution is TeX Live. A common low-friction approach is to install texlive-full, which gives you almost everything at once (~6 GB) and greatly reduces missing-package surprises. Then you add TeXstudio as the GUI editor — a more feature-rich alternative to TeXworks (which ships with TeX Live on most distros) or to Windows tools like WinEdt.


Solution

Step 1 — Install TeX Live (Full)

sudo apt update
sudo apt install texlive-full

This takes a while to download (~6 GB) but installs every LaTeX package you’ll ever need: natbib, graphicx, booktabs, longtable, amsmath, hyperref, geometry, and thousands more.

Alternative: Minimal install (~400 MB) if disk space is tight:

sudo apt update
sudo apt install \
  texlive-latex-base \
  texlive-latex-recommended \
  texlive-latex-extra \
  texlive-fonts-recommended

Step 2 — Install TeXstudio (GUI Editor)

sudo apt install texstudio

For a newer version via PPA:

sudo add-apt-repository ppa:sunderme/texstudio
sudo apt update
sudo apt install texstudio

Step 3 — Configure TeXstudio

  1. Open TeXstudio from your app menu
  2. Go to Options → Configure TeXstudio → Commands — verify paths show /usr/bin/pdflatex
  3. Set Options → Configure TeXstudio → Build → Default Compiler → select pdflatex

Key shortcuts in TeXstudio:

Shortcut Action
F5 Build and view PDF
F6 Compile only
F7 View PDF

The full build sequence (pdflatex → bibtex → pdflatex × 2) can be triggered with a single F5.


Cleaning Up Unwanted Extras

texlive-full installs some extra apps you probably don’t need:

App What It Is Needed?
prerex CLI tool for drawing course prerequisite charts No
vprerex GUI editor for prerex charts No
xterm Classic X terminal emulator No
uxterm Unicode xterm wrapper (bundled with xterm) No

To remove them safely (without breaking your TeX Live installation):

sudo apt remove --no-autoremove prerex vprerex xterm

The --no-autoremove flag is critical — without it, apt will try to remove ~194 packages including essential TeX Live components like biber, texlive-fonts-extra, and texlive-publishers.

Note: uxterm is not a separate package — it’s bundled inside xterm and gets removed with it.

Prevent apt from suggesting TeX Live removal

After removing extras, apt may incorrectly mark TeX Live packages as “no longer required.” Fix this:

sudo apt-mark manual texlive-full

If apt still suggests removing packages, mark the key ones:

sudo apt-mark manual \
  texlive-full \
  texlive-bibtex-extra \
  texlive-fonts-extra \
  texlive-formats-extra \
  texlive-publishers \
  texlive-xetex \
  biber \
  cm-super

Verify with:

sudo apt autoremove --dry-run

This should show few or no TeX Live packages in the removal list.


What Didn’t Work (and Why)

Approach Tried Why It Failed
sudo apt remove prerex vprerex xterm uxterm (without —no-autoremove) Cascades into removing 194 packages including critical TeX Live components — 4.5 GB would be lost
sudo apt remove uxterm separately uxterm is not a standalone package — it’s part of the xterm package
Running sudo apt autoremove after removing extras Incorrectly removes TeX Live packages it considers orphaned

Verification

# Verify TeX Live is installed
pdflatex --version
bibtex --version

# Verify TeXstudio is installed
texstudio --version

# Verify extras are gone
which prerex vprerex xterm
# Should return nothing

# Compile a test document
echo '\documentclass{article}\begin{document}Hello, LaTeX!\end{document}' > /tmp/test.tex
pdflatex -output-directory=/tmp /tmp/test.tex
# Should produce /tmp/test.pdf

Troubleshooting

Symptom Cause Fix
TeXstudio can’t find pdflatex Paths not auto-detected Options → Configure → Commands → set path to /usr/bin/pdflatex
Missing .sty file error during compilation Minimal install missing a package sudo apt install texlive-latex-extra or search with apt-cache search <package>
apt suggests removing TeX Live packages Packages marked as auto-installed sudo apt-mark manual texlive-full
Extra apps still showing in menu after removal Desktop cache not refreshed Log out and log back in

Complete Removal

# Remove TeXstudio
sudo apt remove texstudio

# Remove TeX Live (WARNING: removes ~6 GB of packages)
sudo apt remove texlive-full
sudo apt autoremove --purge

Discussion

Continue the conversation about this guide. Loading comments connects to GitHub Discussions through giscus.

Open community discussions on GitHub

Check before you copy

This command needs care. Read its context, confirm the target and location, and keep a recovery path.

Copying does not run a command.