mathtools package - Package database exclusively locked

I’m having an issue concerning the mathtools package. I’m using MikTex 2.9 and TexMaker.

Whenever I attempt to run the following example code

\documentclass{article}

\usepackage{mathtools}

\begin{document}
This is a test.
\end{document}


I get the error message

Another MiKTeX program has exclusevily locked the package database.

This is the info I obtained from the consoles error log via the 'Copy Info' Button.

GENERAL MIKTEX INFORMATION ReportDate: 2021-04-12 06:04:57

CurrentVersion: 21.3 SetupDate: 2018-04-26 20:38:00

SetupVersion: 2.9

Configuration: Regular

GitInfo: ab8ebca / 2021-03-19 10:22:46

OS: Windows 10 Home, 64-bit, build 19042

SharedSetup: no

PathOkay: yes

RootPrivileges: no

Root2: C:\Program Files\MikTeX 2.9

Root3: C:\ProgramData\MiKTeX\2.9

UserInstall: C:\Program Files\MikTeX 2.9

CommonInstall: C:\Program Files\MikTeX 2.9

CommonConfig: C:\ProgramData\MiKTeX\2.9

CommonData: C:\ProgramData\MiKTeX\2.9

Invokers: .../explorer/A43/texmaker

ERROR DETAILS

Program: pdflatex

Source: Libraries\MiKTeX\PackageManager\PackageManagerImpl.cpp:119

Error: The package database is locked and cannot be accessed.

Description: Another MiKTeX program has exclusevily locked the package database.

Remedy: Close running MiKTeX programs and try again.

Moreover I got the notification that the file calc.sty could not be found and that the file in question is part of the latex-tools package.

In addition, the console of TexMaker produces the following error message.

C:\Program Files\MikTeX 2.9\tex/latex/mathtools\mathtools.sty

! LaTeX Error: File calc.sty' not found.Type X to quit or to proceed,or enter new name. (Default extension: sty)Enter file name:! Emergency stop. \RequirePackage

I checked both of the paths

C:\Program Files\MikTeX 2.9\tex/latex/mathtools\

C:\Program Files\MikTeX 2.9\tex/latex/latex-tools\

And indeed the folder mathtools does not contain the file calc.sty while the folder latex-tools does.

I attempted to uninstall both packages via MikTex console, then refreshed the file name database as well as the font map files and updated the package database. Then I reinstalled the packages and repeated the refreshment and updating process but to no avail. I have made sure that MikTex Console ran in Administrator mode during the procedure.

It seems that my MikTex installation is somehow unable to detect the two paths and the file calc.sty. Unfortunately my Google searches have only yielded results regarding missing mathtools.sty files which is a distinct issue. So I am not sure what else can be done.

\Edit: I was to able to resolve the issue by completely uninstalling and then reinstalling MikTex 2.9 .

• The error messages says that something locked the package database. Do you have some application open like Yap? Did you try to close everything (also texmaker) and compile once on a command line? Apr 12, 2021 at 6:21
• Please check if calc.sty is available in your MiKTeX database. Alternatively, reinstall mathtools` package using MiKTeX Package Manager. Apr 12, 2021 at 6:38
• @Ulrike Fischer I did try to close everything (including texmaker) and compile everything on a command line but I got the same error as described in the post above. Also, no other applications were active at the time I encountered this error. Apr 12, 2021 at 20:01
• then ask in the miktex github. Apr 12, 2021 at 20:04

First, remove Miktex completely, including registry information. Then reinstall Miktex, remembering not to install it in folders that require administrator access, such as Program Files.

• I always install MiKTeX in Program Files, and I never had any trouble with that choice. Jan 2 at 12:43