简体   繁体   English

如何永久更改 MSYS2 路径?

[英]How do I permanently change the MSYS2 PATH?

I want to permanently add /mingw64/bin to the MSYS2 PATH.我想将/mingw64/bin永久添加到 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.在我重新启动 MSYS2 之后,路径已重置为之前的状态。

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?我需要做什么才能将/mingw64/bin添加到 PATH,以便在我退出并重新启动 MSYS2 控制台后更改仍然存在?

You shouldn't manually add /??/bin to the PATH in the MSYS2 terminal.您不应该手动将/??/bin添加到 MSYS2 终端的 PATH 中。

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 .不同的环境应该有不同的快捷方式,您正在寻找的快捷方式应该按照... MinGW 64-bit的方式命名。

The shortcuts point to executables in C:\msys64 , which you can run directly (this one is mingw64.exe ).快捷方式指向C:\msys64中的可执行文件,您可以直接运行它(这个是mingw64.exe )。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM