[tex-live] Issues with tlmgr and failed downloads

N Shah pony777 at gmail.com
Tue Sep 9 12:25:34 CEST 2008

Victor Ivrii suggested I cross post this here.  I posted this note in  
response to several member of the MacOS X TeX mailing list having  
issues with tlmgr:

From: N Shah <pony777 at gmail.com>
Subject: Re: tlmgr (was: [OS X TeX] MacTeX-2008)
Date: September 9, 2008 2:12:09 AM EDT
To: macosx-tex at email.esm.psu.edu

I've managed to get tlmgr working consistently and learned a few  
things along the way that may be of use to all of you.

As pointed out by Victor, tlmgr, by default, does in fact go to  
different CTAN mirror each time it needs to download something.   
Since all the mirrors are not in perfect sync, this leads to odd  
situations where the mirror from which tlmgr.tlpkdb (the package  
databased used to see if something new is available) could indicate  
that some package has been updated, yet, when tlmgr tries to download  
the update, it may try to get it from a different mirror that doesn't  
yet have the package.

When this situation occurs (or if the download fails for some other  
reason) bad things happen.  When updating a package, tlmgr first  
removes the old package and then downloads and installs the new one.   
Perfectly sensible unless the download fails.  When the download  
fails, the old package is not restored -- it simply disappears  
(having been removed as the first step in the update).  This is the  
likely cause of the various cases of disappearing files and programs  
reported in this thread.  I had my updmap and texdoc disappear due to  
failed download.  This is really bad behavior on the part of tlmgr  
and hopefully will be fixed in an update soon.

Should you find yourself missing files, the easiest solution is to  
just reinstall MacTex and start over.  Alternatively you can use  
'tlmgr search --file' to tell you to which package a particular file  
belongs.  For example 'tlmgr search --file updmap-sys' will reveal  
that updmap-sys is part of the bin-tetex.universal-darwin package.   
You can then use 'tlmgr install bin-tetex.universal-darwin' to  
restore the missing file.

To (mostly -- downloads can still fail) avoid this situation you need  
to tell tlmgr to not use the CTAN mirroring system, rather to  
download from a specific mirror.  This can be accomplished by using  
the --location command line option to tlmgr, e.g. your update command  
will be:

tlmgr --location http://ctan.math.utah.edu/tex-archive/systems/ 
texlive/tlnet/2008 update --all

This will force tlmgr to download from the specified ctan.  While it  
is true that one mirror may not in perfect sync with another,  
everything seems to be consistent within one mirror.  We are now left  
determining which mirror to use.  tlmgr has an environment variable  
that helps in figuring this out.  The variable TL_DOWNLOAD_ARGS  
contains the arguments passed to wget by tlmgr when downloading.  By  
setting this to "-v -O" you can get verbose output from wget and  
actually see which server mirror.ctan.org is telling wget to use.  To  
set the variable in your terminal enter for tcsh

setenv TL_DOWNLOAD_ARGS "-v -O"

or for bash


If you run 'tlmgr update --list' with this environment variable set,  
you'll see downloads coming from a variety of ctan mirrors.  This  
will allow you pick one that seems to give you consistently high  
speeds and a reliable connection.  You can then use that server in  
the location argument to tlmgr as I did above with  
ctan.math.utah.edu.  Note that you'll need to specify the whole url  
up to the year.

After implementing the above, I was able to get reliable updates to  
my MacTex installation.  Yeah, it's complicated, but that fact that  
automated mirroring works at all is a minor miracle.

Hope this helps some of you folks who ran into trouble.  Note if the  
above doesn't make sense to you, I would avoid tlmgr until the  
TeXLive folks have worked on it some more.  For an initial attempt at  
a package management system for something as steeped in legacy as  
TeXLive, tlmgr is a great start.  I'm sure it will become even better  
in the months and years to come.

  - Nirav

More information about the tex-live mailing list