Before starting, read the disclaimer below.
Long live $\TeX$!
If you are a Mac and $\TeX$ user, you are likely a MacTeX user. If you’ve been using it for a while, you have probably accumulated a fair number of versions, since it is on a roughly yearly release cycle. To remove the cruft before installing a new release, I’ve taken to removing the old installation. If you’ve tried this, you may have looked at the uninstall instructions, e.g. for 2011, and found them to be, well, somewhat lacking, e.g. stackexchange. The last part, where the instructions suggest using Show Files from the installer, not particularly useful, given the number of files involved, and the fact there didn’t seem to be a way (on 10.7.4) to export the file list.
What’s installed
Like the uninstall procedure expects, you’ll need access to the 2011
MacTeX.mpkg.zip
file. Make a directory and unzip the file
1 2 3 |
|
which could create a MacTeX.mpkg
directory in your pwd
. Now you can
build a table of contents from the archives included, assuming bash
1 2 3 |
|
Relax, it may take some time, on the order of a minute or two.
Dirs and files
From the toc
, the files and dirs can be separated. We know two
directories whose individual files and sub-directories will be removed
wholesale
1 2 |
|
These trees are filtered from the toc to reduce the noise in the output.
A small script will test
if a line is a directory (-d
) or a regular
file (-f
)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
|
The P
var holds the sed
patterns to filter everything below the tree
heads identified above. For my install, the directories output were
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
|
Clearly, there are some directories that should not be removed! My revised dir list was
1 2 3 4 |
|
So, in addition to the two trees we already expected to prune, the
additional installed ImageMagick
and ghostscript
dirs will be
removed. These were removed by invoking
1
|
|
where sudo
is necessary, as it was installed as root
. On to the
files, like removing the dirs, invoke
1
|
|
Once complete, you should feel about 1.7 GB lighter for the full install.
The preference pane
To remove the old preference pane from System Preferences
1
|
|
Comments
If you instead installed the smaller package, or also added the extras,
use the same process once you obtain a toc
from the files.
Now the upgrade
Out with the old and in with the new. The old cruft is gone and you can install the new release. Happy $\TeX$-ing.
Disclaimer
This is the process I used to clean-up Mac$\TeX$ 2011. Use it at your own risk. This procedure is provided AS-IS and without warranty of any kind. In no event will I be liable for any damages arising out of the use or inability to use this process. For example, if it causes wild flying monkeys to burst from your bum, proceed to rend your citadel down around your ears, put your old floppy disk into your toaster and use it to set fire to the detritus of your keep and salt the very earth, all while you watch from the last remaining parapet: your problem, not mine.