13

I'd like to use the listings page to include code snippets in my master thesis. I used the \usepackage{listings} command but it failed with the following error message:

downloading http://piotrkosoft.net/pub/mirrors/CTAN/systems/win32/miktex/tm/packages/listings.tar.bz2...
pdflatex.EXE: Error response from server: 404

! LaTeX Error: File `listings.sty' not found.

Previously, other packages have been downloaded fine.

What am I doing wrong?

4
  • 4
    Probably the server is down. Try changing server. See this answer of mine. Commented Aug 2, 2013 at 18:49
  • it's an 404 error, means that it doesn't have the things you want . Maybe , you can change to another website.
    – Nax
    Commented Aug 3, 2013 at 6:27
  • I have exactly the same problem. Tried multiple different mirrors but i keep getting the 404 Error when trying to install listings package. Installing other packages from the same mirrors works flawless so the problem seems to be specific to the listing package. EDIT: I finally managed to download the package. It seems to be really a problem with some mirrors but it's not limited to a single one but seems to be quite widespread. I had to go through around 5 mirrors to finally find a working one.
    – user34641
    Commented Aug 5, 2013 at 9:34
  • If a Windows machine run your editor as an administrator. TeXnicCenter suffers continuously from this for some reason.
    – percusse
    Commented Aug 5, 2013 at 9:42

2 Answers 2

14

It appears that the package exists in all the repositories but has a .tar.lzma extension instead of a .tar.bz2 extension.

I updated the listings entry in the mpm.ini file (in the /config directory where MiKTex is installed) to specify type as TarLzma instead of TarBzip2 and the problem was solved.

[listings]
CabMD5=be447f957b3a78d730874669d7c432cd
Level=T
CabSize=848742
Type=TarLzma
MD5=85b36516d0596e96277cd3fd4d75d3bb
TimePackaged=1173819082

I don't know where this data initially comes from but I guess that someone needs to update this in the miktex distribution.

2
  • Would you mind giving a little more detail as to where mpm.ini can be found?
    – soandos
    Commented Oct 6, 2013 at 18:23
  • @soandos Under the miktec installation folder it can be found at miktec\config\mpm.ini. Hope this helps.
    – MikeD
    Commented Oct 7, 2013 at 12:20
4

I got the same issue. If it was a bug in the MiKTeX distribution, it is now solved.

As a Windows user, this issue can be solved by executing the

%miktex_installation_path%/miktex/bin/%system_type%/miktex-update_admin.exe

In my case I had to execute the update several times to get all newest distribution packages.

Afterwards, MiKTeX is able to address the right package extensions.

1
  • Or use the Start menu to find and run MiKTeX Update (Admin) Commented Aug 18, 2016 at 11:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .