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 Verified Working Updated 5 min read Tested on Zorin OS 18.1 Pro (Ubuntu 24.04 Noble base) Hardware Lenovo ThinkPad L14 Gen 2

What This Guide Achieves

GoalStatus
Install a complete LaTeX distribution (TeX Live)Done
Install a professional GUI editor (TeXstudio)Done
Clean up unwanted extras that come with texlive-fullDone
Fix apt package management issues after cleanupDone

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 (the Linux equivalent of TeXworks or 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:

ShortcutAction
F5Build and view PDF
F6Compile only
F7View 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:

AppWhat It IsNeeded?
prerexCLI tool for drawing course prerequisite chartsNo
vprerexGUI editor for prerex chartsNo
xtermClassic X terminal emulatorNo
uxtermUnicode 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 TriedWhy 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 separatelyuxterm is not a standalone package — it’s part of the xterm package
Running sudo apt autoremove after removing extrasIncorrectly 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

SymptomCauseFix
TeXstudio can’t find pdflatexPaths not auto-detectedOptions → Configure → Commands → set path to /usr/bin/pdflatex
Missing .sty file error during compilationMinimal install missing a packagesudo apt install texlive-latex-extra or search with apt-cache search <package>
apt suggests removing TeX Live packagesPackages marked as auto-installedsudo apt-mark manual texlive-full
Extra apps still showing in menu after removalDesktop cache not refreshedLog 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