[tex-live] Messed up TL installation

Norbert Preining preining at logic.at
Thu Oct 20 03:01:45 CEST 2011

Hi Haines,

first of all, please read and try to understand clearly the distinction
between TeX Live as distriubuted by TUG, and the TeX Live packages
included in Debian.
Vladimir explained that in details.

Then, next step: Remember that
- Debian packages, so everything that is residing in /usr/bin /usr/share
  related to TeX, all that is ONLY AND EXCLUSIVELY configured
  with dpkg/apt-get/aptitude and files in /etc/texmf.
  (NOTE NOTE NOTE: THERE IS NO !!!!! tlmgr for texlive in Debian!!!)
- TeX Live from TUG as installed via install-tl is ONLY AND EXCLUSIVELY
  configured with tlmgr.

Most of your problems stem from your misconception of these two facts,
you tried to configure TeXLive form TUG with dpkg, and Debina TeX Live
with tlmgr etc.

The otherthing is about PATH adjustment. This is not specific to TeX or
whatever, there you should simply read the guide book on Unix, your
distribution, or ask in a normal user group for that.

Ok, are you still with me and did you digest the above part, internalized
it, and have it actively in memory, then we can continue:

>From now on, I will denote the real "TeX Live" as distributed from TUG
over the CTAN servers as
	TUG TeX Live
and the packages in Debian, current version 2009, as
	Debina TeX Live
just to be sure what we talking about.

On Mi, 19 Okt 2011, Haines Brown wrote:
> advice to delete an old version of TL before installing a newer 
> version. What I did was to delete the texmf directories, and that got 

Probably that advice was given with respect to TeX Live itself, but
not the Debian packages. In Debian you can have only ONE version
of Debian TeX Live. But even when it refers to TUG TeX Live it is wrong,
there is absolutely no need to uninstall an old version of TUG TeX Live.

But you can many different versions of TUG TeX Live, I myself have 2009,
2011, Debian version, plus the dev version on my computer, and use them
according to my needs.

> My initial question is, if one is upgrading to CTAN 2011, is it true 
> that old versions of TL should be removed first? If so, does this 
> refer to both TL 2010 and TL 2009? By "removal" does that use of a 
> package manager, such as aptitude purge? But if the old TL was 
> installed manually, what is the best way to remove it?

In Debian you cannot upgrade to TL2011, because there are no packages
for TL2011 in Debian by now.

> I not only removed the old texmf directories, but also ran # aptitude 
> purge texlive. I then installed TL 2011 from CTAN using the install-tl 
> binary. This procedure messed things up in various ways it seems, and 
> I'm trying to recover.

First of all, that is THE WORST you can do.  I guess nobody suggest
you that.

Packages of a distribution should be installed and removed ONLY 
with the distribution's package manager. So what you should have
done is
	aptitude --purge '~ntexlive' tex-common
which would purge all packages which contain the pattern texlive in
their name. BUt you woulkd have run into troubles, because many
packages depend on one of the texlive* package, so you cannot
simply remove them without removing also the depending package.

There are several ways around that, but I don't describe them here,
just search.

> Although I can run latex, lualatex, biber commands on .tex documents, 
> when I tried to install a CTAN package using $ sudo tlmgr, I could not 
> do it because I was told texlive-common and texlive-base were not 

That is IMPOSSIBLE!!! You are mixing things up.

If you do
	$ sudo tlmgr
then the code in tlmgr would be called. That includes NO WHATSOEVER remote
reference to dpkg/apt, so e message that texlive-common etc are
not configured, which is coming from dpkg, *cannot* appear.

> configured. Then I tried to run # tlmgr (using su rather than sudo), 
> and this time it installed the package but also configured 
> texlive-common and texlive-base. However, this configuration was 

That is ALSO impossible. tlmgr does NOT call any dpkg calls.

(BTW, you can trust me on that, I have written tlmgr, and I have
packaged TeX Live for Debian, so I know both *very* well)

> applied to TL 2009!

That is ALSOimpossible. tlmgr NEVER calls dpkg.

>   # dpkg --configure texlive-base
>     Setting up texlive-base (2009-11) ...  
>     ...

That is something YOU invoked, and as I said, Debian packages are 2009,
and all actions taken by dpkg act on these packages.

> So apparently, although I removed texmf driectories and purged 
> texlive, my system still thinks it has TL 2009. While aptitude says 
> "no":
>   $ aptitude show texlive
>   Package: texlive                         
>   State: not installed
>   Version: 2009-11
>   ...

texlive is a metapackage that in turn depends on some packages. If you
want the full Debian texlive, you need to install
You can see all texlive related pakcages with
	dpkg -l 'texlive*'
and you will see there are MANY.

>   $ ls /var/cache/apt/archives/ | grep texlive
>   texlive_2009-11_all.deb
>   ...

That is only because it was downloaded once and the cache not cleaned.

> Should I have first removed all texlive_2009 packages from the 
> archive?

Irrelevant, they are only there in case you want to re-install the package,
then apt(get/tidude) does not need to re-download it. You can remove all
these files with
	aptitude clean

> In going through this, somehow I messed up my environment for texlive. 
> For example, user can run tlmgr:
>   $ which tlmgr
>   /usr/local/texlive/2011/bin/i386-linux/tlmgr

That is fine.

> But I can't run it by using sudo: 
>   $ sudo tlmgr -gui
>   sudo: tlmgr: command not found

See /etc/sudoers, and the option
	Defaults	env_reset
	Defaults	secure_path=....
and read the manpage for sudoers.

> Sudo uses user's environment (sudo user's the double path to texlive 
> because the path is defined in both ~/.bashrc and in ~/.profile), but 
> root looks to /etc/bash.bashrc where I had to manually append:
>   PATH=/usr/local/texlive/2011/bin/i386-linux:$PATH; export PATH

You only need to do it ONCE, that is enough. If you put it in
it should be loaded by all users and root.

> I've spent so much time running around in circles on this that I'm 
> tempted to buy a new hard disk and install debian from scratch. It 
> would be far less costly to do so, but I still am not comfortable 
> about installing texlive from CTAN without messing things up, such as 
> where to manually define paths.

You should follow very simple steps now:
- first REMOVE  TeX Live 2011 from ALL PATH (bashrc, ...) EVERYWHERE
- log out and in
- become root
- make sure that you don't have TL2011 in the path
now we start fixing your installation of Debian
- Try the following commands, sometimesin different orders, several times
  until it seems tobe settled:
	aptitude -f install
	dpkg --configure -a
That should install TL2009 again (BUT DON'T MIND THAT!!) and you should
get a fixed installation.
(why remove TL2011 from the path: because otherwise the calls to tex
/pdftex/fmtutil etc are allreferring to TL2011, whcih is a bug)

Now we get TL2011 integrated. I assume from what you have written 
that you installed it as root (btw, if you are the only user on the
computer, it is MUCH more reliable to install it as you yourself,
so you can easily use tlmgr.You can also achieve that now by just
	chown -R youruid.yourgid /usr/local/texlive
as root)

- add it ONLY to your personal .bashrc or .profile
  but do NOT add it to root's environment, nor to /etc/bash* etc

- if you want to update TL2011, use tlmgr: first su to root, 
  THEN add TL2011 to the path, then run tlmgr

I hope that fixes your system, and I guess this email should be
put up somewhereon a FAQ side,otherwise I have to type my fingers bloody 
every time ...


Norbert Preining            preining@{jaist.ac.jp, logic.at, debian.org}
JAIST, Japan                                 TeX Live & Debian Developer
DSA: 0x09C5B094   fp: 14DF 2E6C 0307 BE6D AD76  A9C0 D2BF 4AA3 09C5 B094
Nottage is the collective name for things which you find a use for
immediately after you've thrown them away. For instance, your
greenhouse has been cluttered up for years with a huge piece of
cardboard and great fronds of gardening string. You at last decide to
clear all this stuff out, and you burn it. Within twenty-four hours
you will urgently need to wrap a large parcel, and suddenly remember
that luckily in your greenhouse there is some cardb...
			--- Douglas Adams, The Meaning of Liff

More information about the tex-live mailing list