7

I have this document that used to compile fine until a couple of weeks ago, but now I'm getting:

! Package caption Error: For a successful cooperation we need at least     version
(caption)                `2004/02/13 v1.2' of package listings,
(caption)                but only version
(caption)                `2002/04/01 1.0 (Carsten Heinz)'
(caption)                is available.

See the caption package documentation for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.6 \begin{document}

? 
! Undefined control sequence.
<argument> ...t@title \endgroup }\newcaptionstyle 
                                                  {lsttitle}    {\caption@make {...
l.6 \begin{document}

us problem, so I'm exiting ...
***? 

So I guess I have to install a newer version of listings? How can I?

Raphael
  • 564
  • Better to update your TeX installation as a whole. Things do depend on each other and you can't generally expect a newer version of a package to work with an older version of another package. Often it does work, but it is much better to update everything altogether. – cfr Oct 20 '16 at 23:45
  • How can I do that? I tried this and this and this and still get the same error. – Raphael Oct 21 '16 at 01:12
  • As noted above, it is a bad idea to upgrade one package alone. But if you must: Go to the CTAN.org web site, and locate the listings package. Download its files. As superuser (sudo) use those files to replace the ones already in your installation. If that fails, then use Ubuntu's package manager to re-install the original. –  Oct 21 '16 at 01:36
  • Never mind, I did get to reinstall Latex now by doing sudo apt-get remove texlive, sudo apt-get autoremove, sudo apt-get remove tex-common and then sudo apt-get install texlive texlive-latex-extra texlive-lang-portuguese, but now I get ! LaTeX Error: File 'abntex2.cls' not found. This is from a package that was supposed to be installed automatically with TeX Live. – Raphael Oct 21 '16 at 01:51
  • Okay, I got this last error solved by installing texlive-full, but the listings error is still here. – Raphael Oct 21 '16 at 02:10
  • @RobtA That is extremely bad advice. You should never replace files managed by the system's package manager! If you install the files instead into the local or personal TEXMF tree, they will be found first. – cfr Oct 21 '16 at 02:32
  • @Raphael Check which files are being found using kpsewhich. If all the files are from Ubuntu and your system if fully updated, then report the problem to the package managers. If you were using standard TeX Live we could be of more help, but if you use distro packages, it is always somewhat piecemeal and never entirely straightforward. Personally, I'd remove the Debian packages completely and install from upstream, but I realise others prefer to stick with their distros packages. – cfr Oct 21 '16 at 02:35
  • @cfr You are right! Upgraded package should go in local tree, not TeX system. My own TeXlive is installed as ordinary user to home folder (and is Portable on Windows). –  Oct 21 '16 at 14:46
  • @cfr kpsewhich listings.sty gives /usr/share/texmf/tex/latex/fpc-3.0.0/listings.sty. – Raphael Oct 21 '16 at 14:51
  • @Raphael If caption.sty is also from Ubuntu's package, then you should report the problem. – cfr Oct 21 '16 at 16:05
  • @cfr caption.sty is in /usr/share/texlive/texmf-dist/tex/latex/caption/caption.sty. (I'm not sure how to figure if it is from Ubuntu's package or not). – Raphael Oct 21 '16 at 18:31
  • Both of those files should be from Ubuntu's packages unless you have been installing files manually in places you shouldn't i.e. under /usr/share. Probably apt can tell if it recognises the file or not but I don't have a Debian-flavoured system to investigate right now. (At least, nothing like a current one.) – cfr Oct 21 '16 at 20:56

1 Answers1

10

Finally solved. I came across this bug report, which gave me the idea on what to do: I unistalled the package fp-utils-3.0.0 and Latex is working just fine again.

Raphael
  • 564