I often run into problems in LaTeX with packages. I did a reinstall (MiKTeX) and it seemed to fix some issues with knowing where packages coming from or going. In general, I am not sure what should or does happen when using \usepackage command.

Is it standard that these packages are automatically pulled from the internet? Where do they go (by default)? Is there a better place to put them?

If I am troubleshooting, and if we can say packages are usually installed automatically, when, and should I ever, install packages manually? If so, where would I put them?

For instance, I believe the package easylist is installed on my computer. I was able, with some difficulty, to get into the roaming folder, looked around, and really the only package I saw, was several easylist files, such as .sty, and an associated readme file. I did a windows search for easylist, and only found one, with suffix .tpm and in the Program Files (x86)\MiKTeX 2.9\tpm folder.

My problem currently, is that I am trying to use the todonotes package. It seems to require the xcolor package. But this "can not be found". It asks to choose a place to get it. I think default was "choose random", but I just switched it to internet, and some random mirror site in country (USA). That didn't work, and I'm afraid I've now fiddled with the default settings for getting packages, which will create problems later.

Here are some other threads I have been fishing through:

In lieu of picture, I have this:

miktex-pdftex.exe: No connection could be made because the target
machine actively refused it.

miktex-pdftex.exe: Data: connect failed in tcp_connect()

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

Type X to quit or <RETURN> to proceed, or enter new name. (Default
extension: sty)

Enter file name:

and from clipboard:

MiKTeX Problem Report Message: No connection could be made because the
target machine actively refused it.

Data: connect failed in tcp_connect()
Source: Libraries\MiKTeX\PackageManager\PackageManager.cpp
Line: 2461
MiKTeX: 2.9
OS: Microsoft Windows 7 Home Premium Edition, 64-bit Service Pack 1 (build 7601)
Invokers: explorer
SystemAdmin: no
PowerUser: no
Root0: C:\Users\aUserName\AppData\Roaming\MiKTeX\2.9
Root1: C:\Users\aUserName\AppData\Local\MiKTeX\2.9
Root2: C:\ProgramData\MiKTeX\2.9
Root3: C:\Program Files (x86)\MiKTeX 2.9
UserInstall: C:\Users\aUserName\AppData\Roaming\MiKTeX\2.9
UserConfig: C:\Users\aUserName\AppData\Roaming\MiKTeX\2.9
UserData: C:\Users\aUserName\AppData\Local\MiKTeX\2.9
CommonInstall: C:\Program Files (x86)\MiKTeX 2.9
CommonConfig: C:\ProgramData\MiKTeX\2.9
CommonData: C:\ProgramData\MiKTeX\2.9

(from "Package Installation" window below)

The required file 


is missing. It is part of the following package: 


The package will be installed from:  ftp://... [Change...] The package
will be installed for...

  • 1
    With Miktex on Windows, you can go to your programs list and find Miktex in the start menu (I use Linux sorry for the wrong terminology). There you should see admin package manager or something like that. You can install packages that way. They are stored on your computer and when you call it with usepackage miktex retrieves it for compiling.
    – dustin
    Commented Apr 28, 2013 at 2:33
  • Yes I've been there, and xcolor is there, but I can't seem to do anything about it. That just means that my PM acknowledges that it exists, correct? The install button does not seem available. Commented Apr 28, 2013 at 2:35
  • 1
    Can you take a screen shot of the package manager and post it? I don't use miktex but I have before so with a visual I could walk you through it.
    – dustin
    Commented Apr 28, 2013 at 2:36
  • I was partly wrong, once I highlighted the row, the install button became available, but then the download seems to not be successful. Maybe now the issue is the change in default I mention above. Where should I put the picture/image? Commented Apr 28, 2013 at 2:40
  • Put the picture in the post
    – dustin
    Commented Apr 28, 2013 at 2:41

2 Answers 2


Yes, it is default behaviour of MiKTeX to install missing packages “on-the-fly”, but this can be changed in the Options dialogue. All in this way installed packages go into %APPDATA%\MiKTeX\<version>\ (<version> is 2.9 at time of writing), the MiKTeX variable is UserInstall. Since Windows Vista %APPDATA% resolves to C:\Users\<username>\AppData\Roaming, therefore your observation.

But this needs an active connection and a responding download mirror. At least one of these two things did not work in your case. If it was the mirror you can take a look on the CTAN mirror monitor Status of CTAN Mirrors, and if necessary in MiKTeX settings change the active mirror (MiKTeX Options, in tab “Packages” the first line shows the active MiKTeX repository and on the right you can change it).

I prefer to install all packages with the Package Manager, but this needs to be done on a regular basis, about once a week, and of course one needs enough disk space. In the rare cases, when I was asked for installation, I stopped this and ran the installation with the package manager. (Note, that this is different from, what is usually meant with “manual installation”! You already linked to the according question.)

All with the package manager installed packages go into the main MiKTeX tree (see Root 3 in your question), if you made the update in admin mode or in single user installation with writing rights in this folder. If you did a user mode installation packages will always be installed in UserInstall.

One would expect, that installation in admin mode goes into CommonInstall, what is the same folder in your case. But on my system this is not used, the folder, to whome CommonInstall points, does not exist!

Other related questions, at least partially:

  • Your presentation of the subject matter lead me to the solution. I will expand in the post. Thank you so much. And I have been skipping through links of your links, and they are very enlightening in regards to my confusion expressed above. Thank you for that as well. Commented Apr 28, 2013 at 5:13

(This answer shall be Windows-7-and-MiKTeX-centric, and for on-the-fly installing. I work under the assumed belief/model that packages are in one of 3 states, not on the computer, on the computer and not installed, and installed. )

Here are steps that contributed to a solution to my problem:

  • Check that mirror site that I was having problem with is in fact working, at: http://www.ctan.org/mirrors/mirmon

  • Make sure Proxy Server is toggled off (in case you inadvertently toggled it on during previous troubleshooting). In the "Change Package Repository" form, click "Connection Settings..." button, hit space and return.

  • You could conceivably check things from command prompt, for instance I typed mpm --list-repositories, whereupon I decided I didn't need to be in command prompt to find the problem (that's when I discovered the Proxy Server problem (was still getting ftp connect problem)).

  • The problem may have begun with a false problem, I likely thought there was a problem when compiling takes a little longer when installing new packages (on-the-fly). I probably started clicking all over the place, including "Proxy Server". I wish compile gave a load bar when installing from the internet, but that doesn't make that much sense.

One may have other issues that I did not encounter here.

Here's items from the big picture that distracted me somewhat (though they ended up not being my problem, false candidates).

You can choose to download packages manually. This should be done to a folder separate from installation, since as I understand, this will avoid issues with updating the installation removing the packages. (1. Create folder as suggested in other threads. 2. Add it to root directory. 3. Refresh FNDB.) I suppose then you could download packages manually, or while working in a TeX document. As you compile a document, it must decide on where to look for that package. I expect there is more than one way to do this.

(Another issue that mislead me, was how usually Random Repository is default, so I wondered if the fact that I could not go back to that was an issue. Had even reinstalled on a similar issue days before. Also, Update Wizard does not seem to function, so I thought that was a candidate for the problem.)

Here are some links that helped me get my bearings:


You must log in to answer this question.

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