Skip to content

Instantly share code, notes, and snippets.

@wkrea
Forked from shivams/textlive-full-beefless.md
Created September 2, 2020 13:30
Show Gist options
  • Star 22 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save wkrea/b91e3d14f35d741cf6b05e57dfad8faf to your computer and use it in GitHub Desktop.
Save wkrea/b91e3d14f35d741cf6b05e57dfad8faf to your computer and use it in GitHub Desktop.
`texlive-full` without the beef

TLDR;

On an Debian/Ubuntu-based system, to install texlive-full without docs and language packs, simply do this:

sudo apt install `sudo apt --assume-no install texlive-full | \
		awk '/The following additional packages will be installed/{f=1;next} /Suggested packages/{f=0} f' | \
		tr ' ' '\n' | grep -vP 'doc$' | grep -vP 'texlive-lang' | grep -vP 'latex-cjk' | tr '\n' ' '`

After this, if you wish to install the language packs, selectively install them. E.g.:

sudo apt install texlive-lang-english texlive-lang-european texlive-lang-french texlive-lang-german

texlive-full without all the beef

No Beef

To install LaTeX on Linux systems, there is the texlive-full package which occupies more than 6GB space. If you install the minimal LaTeX (with some recommended packages installed), it can occupy somewhere between 500MB to 1GB space, but it's pretty unusable and you will perpetually be installing packages in future.

So, it has become customary to install the texlive-full package because it's the most hassle-free solution. But we can prune out some of the beef that may not be essential for many people, especially if you are short on space. There are 2 sets of packages which can be avoided from the installation without losing out on anything crucial (depending on your use-case):

  • Docs Packages (occupy around 2GB space) : e.g. texlive-fonts-extra-doc
  • Language/Fonts Packages (occupy around 1GB space) :
    • general language packages : e.g. texlive-lang-french
    • latex-cjk-all : the Chinese-Japanese-Korean language and fonts metapackage

Selective Installation

Now, texlive-full is a metapackage which installs about 286 packages. To selectively remove the docs and/or the language packages, we can first extract the list of packages that texlive-full installs using apt and then filter out the docs and/or the language packs using the following command:

#Remove the grep section for docs and/or language packs as per your preference
sudo apt install `sudo apt --assume-no install texlive-full | \
		awk '/The following additional packages will be installed/{f=1;next} /Suggested packages/{f=0} f' | \
		tr ' ' '\n' | \
        grep -vP 'doc$' | \
        grep -vP 'texlive-lang' | \
        grep -vP 'latex-cjk' | \
        tr '\n' ' '`

After this, install the language packs of your choice:

sudo apt install texlive-lang-english texlive-lang-european

Packages

I did a comparison of the various download and installation sizes scenario:

Package Download Size Install Size
texlive-full 3135 MB 6423 MB
texlive-full without Docs 1760 MB 4653 MB
texlive-full without Docs, Lang Packs and CJK Packs 1249 MB 3554 MB
texlive-minimal (with some recommended packages) 200 MB 929 MB

References:

@bjoekeldude
Copy link

Thanks!

@Parracho
Copy link

Parracho commented Feb 2, 2023

Thanks man

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment