MacTeX  |  Donate  |  FAQ  |  Help  |  TUG

Unix Install of TeXLive 2021

Preliminary Comment

This page is for users who want to install TeX Live 2021 on macOS 10.6 through 10.13, Snow Leopard through High Sierra. The MacTeX-2021 package does not support these systems, but TeX Live 2021 can be installed another way using the Unix install script. See also More on Unix Script for other reasons to use the Unix script on more recent systems, and special instructions to make it work on these systems.

Contents of MacTeX

MacTeX contains three pieces. The first, TeX Live, is a gigantic collection of command line programs like TeX, LaTeX, XeTeX, LuaTeX, and associated style and class files, fonts, documentation, etc. It is installed in /usr/local/texlive/2021 and thus hidden from most users. This software does the actual typesetting.

The second piece is Ghostscript, which can process postscript, eps, and pdf files. This is a command line program which users do not see directly. It is installed in /usr/local/bin with support files in various /usr/local folders. Most pieces of TeX Live do not require Ghostscript.

The third piece contains four GUI programs: TeXShop, TeX Live Utility, BibDesk, and LaTeXiT. These are the programs users actually see and use to interact with TeX. They are installed in /Applications/TeX, together with a small amount of documentation telling new users how to get started.

Older Systems

MacTeX-2021 supports macOS 10.14, 10.15, and 11, Mojave, Catalina, and Big Sur. In particular, the TeX Live Intel binaries were compiled on an Intel Mojave computer and the TeX Live Arm binaries were compiled o an Arm Big Sur computer. TeX Live combines these binaries into universal binaries which run natively on both kinds of computers and labels these binaries universal-darwin.

However, Mojca Miklavec compiled the 2021 binaries for older systems on Snow Leopard; her binaries are also in TeX Live. These binaries require Intel processors for systems 10.6 (Snow Leopard) and higher; TeX Live labels these binaries x86_64-darwinlegacy.

Most Mac users with older systems already have versions of Ghostscript and the GUI programs which work on their systems. They only need to update TeX Live. This is not possible with the MacTeX install package, but it is easy to do using the Unix install script which TeX Live supplies.

How to install TeX Live with the Unix Script

Installation requires two steps. The first installs the TeX Distribution on the Mac exactly as it is installed on Linux and Unix machines; this step is described in the following paragraphs. After step one is complete, obtain a small install package from the following link TeXDist-2021, and install it. This second step configures TeX so TeX Live Utility and various GUI programs can find it without further configuration. (The second step is automatically done by MacTeX.)

IMPORTANT: After this page was written, we discovered that TeXDist-2021 does not work on some older systems. We do not know when it works and when it fails because we do not have machines running systems earlier than Mojave. Please follow the instructions below and try to install TeXDist-2021 when asked to do so. If installation fails, read the section following this one.

To begin the installation, click the link install-tl-unx.tar.gz to download this item. Your Mac should automatically unzip it and you will find a file named "install-tl-unx.tar" in your downloads folder. Move this file to your home folder and click to untar it, producing a folder. A typical folder name is "install-tl-20210527", but the exact name varies by date.

Open Terminal in /Applications/Utilities. Type the word "cd" without quotes and a space in the resulting window. Then drag the install-tl folder created previously into the window and drop it there. This will add some text after the "cd". Activate the Terminal window by clicking in it if necessary, and press RETURN. Terminal will "change directory" to the install-tl folder.

Type "sudo ./install-tl" without the quotes, and press return. You might want to copy and paste this command rather than typing it because Unix is very picky; the last item is TL, but in small letters. You will be asked for your password. If you have admin status (and most users on single owner machines do), type your ordinary password.

There are two possible default modes for what happens next: a graphic mode and a pure text mode. Each mode asks several questions (providing default answers for these questions), and a way to start the actual install process. Luckily, all default answers are correct for the Macintosh except one. When you are asked for a default paper size, the answer is "A4" in most of the world and "letter" in other places.

The graphic mode briefly shows a picture of a lion, and then a panel with buttons and pull-down menus. Find the menu for paper size and select A4 or letter. Then push the "Install" button.

The textual mode outputs directly into Terminal. It may first ask "Import settings from previous TeX Live installation: (y/n):" Type "n" without the quotation marks. Then the screen will fill with questions. Type a capitol "O", without quotation marks. The screen will erase and show just that set of questions. If you want "letter" paper rather than "A4", type "P" without the quotation marks. Then type "R" without the quotation marks to get back to the full set of questions. Finally type "I" without the quotation marks to begin installation.

The install window will display a long list of packages as each is downloaded, uncompressed, and installed. This process may take one to two hours or more. In the end, some additional messages will be printed, but these can be ignored because the final step will do them automatically. You now have TeX Live 2021.

Installation is not quite done; a small data structure must be added so the GUI applications can easily find the TeX Distribution. Click the link TeXDist-2021 to download a small install package. Find this package in your Downloads Folder and drag it to the desktop. Double click to install. Installation takes only a minute and your TeX Live 2021 installation is complete.

(By default, the install script runs in graphic mode. On the first versions of Big Sur, this mode crashed because of a problem with a program named "Wish" supplied by Apple. If you run into this problem, upgrade to a more recent version of Big Sur, or run the installer in text mode by typing "sudo ./install-tl --gui=text" rather than "sudo ./install-tl". In some versions of Big Sur, this mode first displays two dialogs complaining of problems. Both dialogs have "OK" buttons; just push those buttons. After that, installation proceeds normally.)

If TeXDist-2021 Fails

We have reports that High Sierra refuses to open TeXDist-2021 because it claims that the package is not signed. Actually TeXDist-2021 is both signed and notarized. High Sierra does not recognize the more secure signature adopted by Apple in later systems. TeXDist-2021 may work on earlier systems which did not require signatures. We'd appreciate reports of when it works and when it doesn't.

The main job of TeXDist-2021 is to define a symbolic link pointing to the binary folder of TeX Live. Applications can then use that link to find the binaries. Most macOS TeX applications look for binaries at /Library/TeX/texbin. You can create this link yourself using Terminal. Note that /Library is the system Library folder, not the Library folder in your home directory. Check that this folder has a subfolder named TeX. If not, create this subfolder. If you are installing on High Sierra or earlier, type the following and push RETURN after each line. In the third line, the word after sudo is LN, but with small letters.

      cd /Library/TeX
      sudo rm texbin
      sudo ln -s /usr/local/texlive/2021/bin/x86_64-darwinlegacy texbin
If you are installing on Mojave or later, the second line should be different, so type
      cd /Library/TeX
      sudo rm texbin
      sudo ln -s /usr/local/texlive/2021/bin/universal-darwin texbin

If you also want to use TeX or LaTeX from Terminal, you must configure your PATH to find TeX. Add /Library/TeX/texbin to your path. The method of doing this depends on which shell you use, so we leave that task to you. If you have several TeX distributions, you may want to add this new element to the start of your path so it is found first. We leave that decision up to you.

The previous method works, but it breaks the TeX Dist structure which makes it possible for TeX Live Utility to switch between TeX Live 2021 and earlier versions of TeX Live. A better approach is to install a TeX Dist structure for the distribution you just installed. To do that, skip the earlier steps and download postinstall2021.sh. Place this file in a directory, open Terminal, and change to that directory. Then type

 	sudo sh postinstall2021.sh
This command does most of the operations that TeXDist-2021 would have done using the shell script postinstall2021. You can open this script in an editor to see exactly what it will do.

Changing the Install Location

The installer has a button allowing users to select the location where TeX is installed. If you pick a location in your home directory, the "sudo" item in the command "sudo ./install-tl" listed earlier can be omitted, and then admin permission is not required to install TeX. Users who make this change should NOT install "TeXDist Installer" because this package is configured for the default location of TeX. These users will need to obtain and configure GUI programs on their own. Configuring these programs should not be difficult for knowledgable users, but we do not provide support for this option.

Possible Problems and How to Avoid Them

The Unix install script supports many different architectures: Linux of various sorts on machines with a variety of processors, Unix, and so forth. It is not created for the Macintosh because MacTeX supports that machine, but it can be used because the Macintosh runs Unix.

There is a way to force the installer to use graphic mode:
     sudo ./install-tl --gui
and a way to force the installer to use text mode:
     sudo ./install-tl --gui=text
Text mode has problems on recent systems, including Big Sur and possibly Catalina. The problems are due to Apple's security and signing requirements. When install-tl starts in text mode, a dialog from the Mac appears warning that wget is not signed by a recognized developer and should be thrown away. This dialog has an "OK" button. Push it. Almost immediately a second similar warning appears about xz. Push "OK" again. After that install-tl will work without further problems.

Acknowledgments ...

Happy TeXing on Mac OS X !

MacTeX Installer Support