apt-get disables latex

Asked by Peter Cameron

I recently upgraded to ubuntu 14.04. During the installation, the package tex-common failed to install, and as a result the entire TeX system would not work ("Fatal format error"). Attempts to install this package, or the entire tex-live distribution, using apt-get failed. Since I really nead TeX, I installed it directly from CTAN; everything worked fine.

This morning I was notified of a security upgrade, and invited to install it. When I clicked on OK, I got an error message about tex-common, and then found that the TeX system had been again disabled. So I re-installed it from CTAN.

At the moment it seems that using either apt-get or the automatic package installer will disable TeX; I have to choose between using TeX and installing new packages.

Is there a way of re-setting apt-get so that it doesn't think that tex-common is missing?

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Peter Cameron
Solved:
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :
#1

I suggest you report a bug

Revision history for this message
Manfred Hampl (m-hampl) said :
#2

What is the full error message from am attempt to install tex-common or texlive with apt-get (you might use --simulate to avoid overwriting your working CTAN installation)

Revision history for this message
Peter Cameron (p-j-cameron) said :
#3

Well, the plot thickens. I typed
apt-get -s install tex-common

and got

NOTE: This is only a simulation!
      apt-get needs root privileges for real execution.
      Keep also in mind that locking is deactivated,
      so don't depend on the relevance to the real current situation!
Reading package lists... Done
Building dependency tree
Reading state information... Done
tex-common is already the newest version.
The following packages were automatically installed and are no longer required:
  libgsm1 libschroedinger-1.0-0 libva1
Use 'apt-get autoremove' to remove them.
0 to upgrade, 0 to newly install, 0 to remove and 11 not to upgrade.
77 not fully installed or removed.
Conf tex-common (4.04 Ubuntu:14.04/trusty [all])

and many more lines beginning Conf.

Despite its claim about tex-common, I am reluctant to use it in earnest. Why should installing
a small security update disable the entire TeX installation?? This is far worse than anything
Windows ever inflicted on me!

Revision history for this message
Manfred Hampl (m-hampl) said :
#4

It seems that there are other problems in the package management system of you computer, and the problems with text could be just a consequence.

I see:
"tex-common is already the newest version"
and
"0 to upgrade, 0 to newly install, 0 to remove and 11 not to upgrade. 77 not fully installed or removed."
It says that you have tex-common already installed, but there are several packages in an half-installed state.

Please provide the output of

uname -a
lsb_release -a
df -h
df -i
sudo dpkg --audit

This should give some details about your system and the packages that are in an unhealthy state (with doing any change).

Revision history for this message
Manfred Hampl (m-hampl) said :
#6

I can understand that you are happy to have a working TeX installation on your system, and that you do not want to lose that.

I just want to raise a warning that your package management system currently has some half-installed packages. As long as that is not cured, you might run into problems whenever you try installing additional software or want to update your system with an modified version of any other package (including security patches).

I see several options to proceed:
1. leave the system as it is with broken package management - maybe with problems whenever you try installing updates
2. try getting the Ubuntu TeX versions correctly installed - eventually with the need to re-install the CTAN version of texlive afterwards again
3. try removing all half-installed Ubuntu TeX packages and stick to the CTAN version.

Revision history for this message
Peter Cameron (p-j-cameron) said :
#7

Thank you. I would prefer your option 3 or 2. But I don't know how to do that. When the problem first arose I tried re-installing with apt-get which simply failed.

Revision history for this message
Manfred Hampl (m-hampl) said :
#8

2. For trying to get the half-installed packages installed the command to try is

sudo dpkg --configure -a

(eventually try a simulation first with "dpkg --simulate --configure -a")

3. For removing the half-installed TeX packages you could try the command

sudo dpkg --purge '*latex*' '*texlive*' 'cm-super*' context context-modules feynmf fragmaster lmodern luatex m-tx musixtex pmx purifyeps tex-common tex-gyre tipa

(also eventually try simulating first with "dpkg --simulate --purge ...packagenames...")

Revision history for this message
Peter Cameron (p-j-cameron) said :
#9

No success.

Option 3 gave:
dpkg: error: --purge needs a valid package name but '*latex*' is not: illegal package name in specifier '*latex*': must start with an alphanumeric character

Option 2: the simulation worked fine but the real thing gave me the same old problem: it couldn't do its job and ended with
Processing was halted because there were too many errors.
This after having once again disabled TeX.

Revision history for this message
Manfred Hampl (m-hampl) said :
#10

It seems that the dpkg purge command does not allow the wildcards in the form I suggested.

How do you want to proceed? Get the packages installed or get them removed?

For removing them, there should be the possibility to construct commands for doing that:
dpkg -l | grep ^iU | awk '{print $2}' | xargs sudo dpkg --purge
dpkg -l | grep ^iH | awk '{print $2}' | xargs sudo dpkg --purge
check with "sudo dpkg --audit" afterwards.

Or if you want to try getting the half-installed packages fully installed, please provide the full output of the command
sudo dpkg --configure -a

Revision history for this message
Peter Cameron (p-j-cameron) said :
#11

I got your message after I had already tried a different strategy. I went through the output of the --audit command and tried to --purge all the files one by one. Some of them reported dependencies and I had to delete the dependent files first, but in the end it was all done (except for one curiosity: I couldn't purge libjson0 or libjson0:amd64 since they claimed each to depend on the other!).

Then I decided to use apt-get to install texlive-full. It reported a couple of errors along the way, but in the end pdflatex worked on a couple of relatively complicated files, and --audit reported no problems apart from libjson0:amd64.

So I think the problem is solved, though I can't help thinking it was more complicated than it should have been. I am just thankful that I have been using a unix system for rather a long time now.

Once again, thank you for your patient help.

Revision history for this message
Manfred Hampl (m-hampl) said :
#12

Congratulations for succeeding in getting you problem solved.

For libjson0:amd64 and libjson0 you might try removing them with one command ("sudp dpkg --purge libjson0 libjson0:amd64"), or eventually add the --force-depends option to ignore the unmet dependency for that command execution.

Revision history for this message
Peter Cameron (p-j-cameron) said :
#13

Thanks -- all fine now. Peter.