I am trying to install packages from the MiKTeX console. I keep getting an error that "Couldn't connect to server."

I then went to "Packages" and tried to change the repository from "a random package repository on the Internet," but it does not load and other repositories. It just says, "Couldn't connect to server."

However, my internet is working. Any idea what is going on?

  • Welcome to TeX SX! Did you try to install as administrator? – Bernard Oct 8 at 21:45
  • I am running MikTeX as administrator, do I need to uninstall MikTeX and reinstall as administrator? – Jackson Hart Oct 8 at 21:46
  • Firewall ? Antivirus ? proxy ? what platform are you on ? what user level are you using for install of which variant (full network all users?) I always try a basic portable version prior to a full install on any system since it by far the simplest to iron out any local wrinkle's about user rights etc. – KJO Oct 8 at 21:50
  • 1
    I don't know really. Personally, I installed MiKTeX as administrator (for all users) and never had such a problem. Downloading the files on your system and install ing from a loacal repository might be a solution. – Bernard Oct 8 at 21:50
  • I just uninstalled MiKTeX and reinstalled as administrator. When I check for updates, it just says, "Couldn't connect to server." – Jackson Hart Oct 8 at 21:53

If you want to install packages from a local repository, you can download the packages you're interested in from CTAN, more precisely from this directory:

https://ctan.org/tex-archive/systems/win32/miktex/tm/packages

add the four files: pr.ini, miktex-zzdb1-2.9.tar.lzma, miktex-zzdb2-2.9.tar.lzma and files.csv.lzma and install them in a directory on your system. Then, choose to install from a local repository, and declare the installation directory as your local repository.

  • Do I also need to individually add each package that I want to install? – Jackson Hart Oct 9 at 16:45
  • Do you mean downloading each of those which not part of the basic distribution to the local repository? – Bernard Oct 9 at 17:01
  • Yes, I just want MiKTeX to download them on the fly. Am I going to have to manually go online and download each package that I want? – Jackson Hart Oct 9 at 17:14
  • No. My suggestion was only in case something goes wrong for some reason. – Bernard Oct 9 at 17:24

I have just updated 4 packages (no problem) even though main repository is down so lets try to discount the other common causes

If you are a paid administrator of a LAN then you need to use the network install.
If you're household guru or a single user you are best to go for the simplest install.

If you use the admin install and are one user you will have twice the headaches. If you build and download your own repository you will have double the work maintaining it and the installed copy. If you have two or more users you may wish to install per user, however if they do their own updates you have twice or more times the headaches.

If you are the main user and can trust others on your home network to share a common updatable engine with separate personal data and roots then consider this approach.

If you have a previous bad install go to MiKTeX console and run clean-up (reset and or uninstall).

Download the MiKTeX 32 bit portable basic install to a single root directory, that one or all users can share. Make sure the directory has no spaces punctuation or accents, since these are common causes of older packages stumbling. I would suggest c:\MiKTeX since it short simple and descriptive. Before installing, add that directory to your antivirus exclusion list (win-defender etc. you can always scan it before first run). Ensure you set inheritable user rights to suit all users, then there will be no user rights issues later.

The only different requirement to a system install is building user shortcuts to MiKTeX-console.exe or the included MiKTeX-portable.cmd and adding the c:\miktex\texmfs\install\miktex\bin folder to the system environment path. Every basic function including TeXworks can be used from Console, if you don't want others to mess with that, then just give them a shortcut to TeXworks or their own choice of editor with auto download of packages set in the MiKTeX-console. If this causes any problems later you can easily switch to "always".

Thus no need to do anything twice (yolo) other than keep regular differential (or full) backups in case it gets disturbed.

IF you are having problems installing packages you can check here for latest issues

If you are using a different editor or viewer always test if you have the same problems with using TeXworks if you don't it indicates a problem with the other editor / viewer.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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