I'm new with latex and I just installed Miktex (2.9) and Texstudio (2.12.6) both in C:\Latex. Texstudio found the Miktex installation alright and now I tried to built the template that I wanted to use. It first says The required file tex\latex\nag\nag.sty is missing and when trying to install it, it will fail with Unknown MiKTeX exception. in the log file. Any idea how I can solve this?

It is very annoying to install every package via the package manager. It also will not just give me a list of all packages I need, no I need to rerun the build every time, say two times yes to the user control before I can copy the package name from the error message and install it via package manager. And I already did that 10 times and no end in sight.

Full error log:

2017-10-27 23:45:52,564+0200 INFO  miktex-pdftex - starting with command line: C:\Latex\Miktex\miktex\bin\x64\miktex-pdftex.exe -synctex=1 -undump=pdflatex main.tex
2017-10-27 23:45:54,771+0200 INFO  miktex-pdftex - installing package url triggered by tex\latex\url\url.sty
2017-10-27 23:45:55,814+0200 FATAL miktex-pdftex - Unknown MiKTeX exception.
2017-10-27 23:45:55,814+0200 FATAL miktex-pdftex - Info: =""
2017-10-27 23:45:55,814+0200 FATAL miktex-pdftex - Source: 
2017-10-27 23:45:55,814+0200 FATAL miktex-pdftex - Line: 0
  • 1
    Welcome to TeX.SX! You could install missing packages on-the-fly->What is the preferable setup for MiKTeX to keep all packages up-to-date easily?, General update: How should one maintain and update a MiKTeX installation? – Bobyandbob Oct 27 '17 at 22:11
  • @Bobyandbob I already have told miktex that it should not ask me about installing packages, that did not solve the problem. How will the updating help me with the packages that are not yet installed? – findusl Oct 27 '17 at 22:21
  • @finusl "You could choose whether missing packages are to be on-the-fly." -> You could choose between yes/no/ask me first. Admin User?Sometimes not to be admin could make problems. – Bobyandbob Oct 27 '17 at 22:30
  • @Bobyandbob sorry I was not clear. I currently have it set to Yes and before it was ask me first. I am admin user. And every time it wants to install it first pops up the user control, where i need to click yes and then it fails. – findusl Oct 27 '17 at 22:33
  • Maybe try to synchronize the package repository from the package manager before trying the on-the-fly installation in TeXstudio? – Troy Oct 28 '17 at 1:08

Questions about problems with MikTeX often appear here. There are two possible "general purpose" solutions:

(1) Instead of ordinary MikTeX, install MikTeX portable version, and put the files in a new subfolder of your user home directory. This does not requires administrative privilege. So, if the underlying problem has something to do with access rights, this solves the problem. Downside: Not suitable for a multi-user installation.

(2) If you cannot install a package via the usual MikTeX package manager, then you can get it from CTAN. However, MikTeX is very particular about how packages are installed. If you get the package without using MikTeX internal package manager, then place the downloaded files within your texmf-local directory, using proper folder tree. So, a package such as "dribble" probably should have its *.sty and related filed in (texmf-local)/tex/latex/dribble. Usually, but not always! Then update FNDB.

If neither of the above works for you, then something about your MikTeX installation is borked. Can't help there.


So in the end it turns out I needed to run the update manager in admin mode.

The first time I would run it, it would install a single update. Only after that, other updates and package installations would work. On the Miktex download page they actually recommend running update manager after installation, I missed that.

Thanks everyone for helping :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.