0

I'm trying to create a local package repository to be used during installing miktex on a system not connected to the internet. I want to install miktex and load the packages I need in one command (or at least, do it completely unattended by user).

As a start I have a directory, C:\MyRepo\ containing these 3 files:

  1. miktex-zzdb1-2.9.tar.lzma
  2. miktex-zzdbb-2.9.tar.lzma
  3. floatrow.zip ( package file)

I go to run my installer as follows:

basic-miktex-2.9.6643-x64.exe --auto-install=yes --unattended --install-from-local-repository --local-package-repository=C:\MyRepo

When I run this, I get "The specified local repository does not exist". However, if I fully install miktex, and then in the package manager specify my local repo, it seems to accept it as a local repository.

Is there something I'm doing wrong on the command line args to specify the package repo, or perhaps something not quite right with my local repo directory contents?

6
  • Why do you want to specifiy it during installation of the basic installer? It doesn't look for an repository, it contains the packages. Mar 30, 2018 at 17:49
  • I assumed I needed to a local repository during installation, considering it seems to provide that as a flag. Is there a post-installation command line option for adding packages offline? I don't understand "It doesn't look for an repository, it contains the packages. " Mar 31, 2018 at 20:23
  • the basic installer is a self-contained installer. You can after the installation set the repository for following package installations. Mar 31, 2018 at 20:29
  • 1
    Is there a way to set the local repository after installation, from command line? Apr 2, 2018 at 1:36
  • Try mpm -help. I'm not quite sure if it still works. Apr 2, 2018 at 7:17

1 Answer 1

0

These steps outline installing miktex itself, and then installing packages from a local repo. The local repo contains .tar.lzma files, as well as miktex-zzdb1-2.9.tar.lzma and miktex-zzdb2-2.9.tar.lzma. Packages to install are described as a comma separated list.

$appInstaller points to the basic-miktex-2.9.6643-x64.exe. $miktexPackageInstaller points to mpm.exe, which is located in hte miktex program file directory after install.

# install miktex unattended, for all users (requires admin). uses cmd args shown from -h option
Start-Process -Wait "$appInstaller" -ArgumentList "--auto-install=yes --unattended --shared"

Start-Process -Wait "$miktexPackageInstaller" -argumentList "--admin --repository=$localPackageRepo --install=package1,package2,package3"

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.