What is a local packages repository and how to create a local package repository? I need to add some .sty and .cls files of my own, I follow the instructions from some users of this forum but whatever I did mikTeX did not accept any diretory that I create! I get messages like the following:

MiKTeX Problem Report
Message: C:\myextrapackages does not seem to be a local package repository.
Data: C:\myextrapackages
Source: Libraries\MiKTeX\UI\MFC\SiteWizLocal.cpp
Line: 206
MiKTeX: 2.9
OS: Microsoft Windows Vista Business Edition, 32-bit Service Pack 2 (build 6002)
Invokers: miktex-taskbar-icon
SystemAdmin: no
PowerUser: no
Root0: C:\Users\Alain\Documents\UsbTex_1.5_1.6\USBTeX-1.6\programs\MiKTeX_2.9
Root1: C:\myextrapackages
UserInstall: C:\Users\Alain\Documents\UsbTex_1.5_1.6\USBTeX-1.6\programs\MiKTeX_2.9
UserConfig: C:\Users\Alain\Documents\UsbTex_1.5_1.6\USBTeX-1.6\programs\MiKTeX_2.9
UserData: C:\Users\Alain\Documents\UsbTex_1.5_1.6\USBTeX-1.6\programs\MiKTeX_2.9
CommonInstall: C:\Users\Alain\Documents\UsbTex_1.5_1.6\USBTeX-1.6\programs\MiKTeX_2.9
CommonConfig: C:\Users\Alain\Documents\UsbTex_1.5_1.6\USBTeX-1.6\programs\MiKTeX_2.9
CommonData: C:\Users\Alain\Documents\UsbTex_1.5_1.6\USBTeX-1.6\programs\MiKTeX_2.9

Thanks for help!


  • 1
    Welcome to TeX.SE.
    – Mico
    Apr 2, 2019 at 15:55
  • 1
    I think you are mixing terms a Local package repository usually holds a master set of packages off-line rather than on-line. If you are trying to use a local set of personal .sty files the location is a Local Texmf tree that is normally located via use of TEXINPUTS. If the .sty is one from a Ctan package ONLY use the package manager If it is unsupported by Package manager look for the TDS version and install to a texmf location If it is a .sty without TDS structure then position it in the same way as TDS OR simplest still place it alongside the current tex file
    – user170109
    Apr 2, 2019 at 16:40

4 Answers 4


You asked,

how [does one] create a local package repository?

Here's a screenshot from the webpage https://miktex.org/howto/local-repository:

enter image description here


I finally found the answer that is identical to that of MICO.

There is a Miktex manual installed where I found that the C:\myextrapackages directory I created can only be a data directory
after I put a new environment variable TEXINPUTS=C:\myextrapackages

While the environment variable MIKTEX_REPOSITORY=C:\myextrapackages blocks Miktex Settings.

Thank you to all



You asked about the first option (Local package repository) in this guide by Ulrike https://tex.stackexchange.com/a/482238/170109 but note that is for master packages that should be downloaded and managed by MiKTeX i.e. usually done when downloading on the fly is not possible.

You have not identified if they are downloaded 3rd party TDS files that can be installed by the 2nd method. A slightly easy option as it then only requires the zip be decompressed correctly and the single directory added to the texmf paths.

However from your limited description (I need to add some .sty and .cls files of my own) what you NEED is the 3rd option to manually install personal files in a personal folder tree. Such a tree is called a Local texmf directory with structured subfolders. The master folder is usually pointed to by a system variable However MiKTeX has a marginally easier way to locate such a directory. So make a texmf directory under C:\myextrapackages e.g. C:\myextrapackages\texmf then place your files in the correct locations per this guide How can I manually install a package on MiKTeX (Windows) BUT IGNORE THE SECTION ABOUT LOCAL REPOSITORY that is only for Problems with useage 1 above and should be avoided in most cases. (Always use MiKTeX-console package manager for MiKTeX packages)

The is a fuller wiki description here https://en.wikibooks.org/wiki/LaTeX/Installing_Extra_Packages#Installing_a_package

Once the files are in place you use MiKTeX-console to add the texmf directory under Settings > Directories and then run the Tasks Update file name database etc. to maintain the folder locations any time they are added to.


Having experienced the misery of repeated errors with MikTeX on MS Windows, I felt compelled to say what eventually worked for me.

My problem: Firewall at work prevented full download. With minimal installation, intermittent & frustrating issues with missing packages. (I use LyX which of course depends on TeX).

Attempted solution: On home PC, while attempting to download full copy into directory, multiple issues with "MikTeX encountered an internal error", and bizarre failure to identify an 'appropriate' directory. Others appear to have had similar problems on the internet, with varying levels of frustration and a lot of vague/unhelpful advice. MikTeX console was actively hostile with messages like "MikTeX console is already running", or (when accessible) failing to update anything.


This is a command line solution to downloading and eventually installing MikTeX. Open up a DOS console in Administrator mode.

  1. First remove every vestige of MikTeX from home PC (Uninstall from Windows)

  2. Made C:\MikTeX directory, with sensible-looking subdirectory called C:\MikTeX\setup (for all the .lzma and other files downloaded)

  3. This is likely not vital, but also made potentially useful directories called common_config, common_data, common_install, common_link_target_directory

  4. Downloaded setup (.zip) file from https://miktex.org/download

  5. Extract executable from this zip: miktexsetup_standalone.exe. Put this in C:\MikTeX

  6. Run this as follows (Can all be on one line):

    miktexsetup_standalone --common-config=/MikTeX/common_config --common-data=/MikTeX/common_data --common-install=/MikTeX/common_install --common-link-target-directory=/MikTeX/common_link_target_directory --local-package-repository=/MikTeX/setup --verbose --modify-path=yes --package-set=complete --remote-package-repository=https://mirror.cse.unsw.edu.au/pub/CTAN/systems/win32/miktex/tm/packages/

    --use-registry=yes download

The key parts are the download instruction; the local package repository specification; the complete package set; and the repository. Some of the other statements are likely unneeded but I was too frustrated at this point to play!

This downloaded the full 4GB without a hiccough.

I used the unsw.edu.au repo because it's close, but you can obtain a list of repositories and write this list to a text file using:

miktexsetup_standalone --list-repositories > repositories.txt

Once download completes, can copy this monster, and install for local user by saying:

miktexsetup_standalone --modify-path=yes --verbose --use-registry=yes --local-package-repository=/MikTeX/setup install

For more fancy considerations, try the command-line help:

C:\MikTeX>miktexsetup_standalone --help

Hope this helps some poor sufferer.

You must log in to answer this question.

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