Search code examples
pathmsys2

How do I permanently change the MSYS2 PATH?


I want to permanently add /mingw64/bin to the MSYS2 PATH.

I have tried:

export PATH=$PATH:/mingw64/bin

It works until I exit.

After I restart MSYS2 the path has reset to what it was before.

What do I need to do to add /mingw64/bin to the PATH so the change persists after I quit and restart the MSYS2 console?


Solution

  • You shouldn't manually add /??/bin to the PATH in the MSYS2 terminal.

    It happens automatically (along with other changes to environment variables) when you open the terminal for the environment you want to use.

    There should be different shortcuts for different environments, the one you're looking for should be named along the lines of ... MinGW 64-bit.

    The shortcuts point to executables in C:\msys64, which you can run directly (this one is mingw64.exe).