美文网首页IT🐶
安装和配置MSYS2

安装和配置MSYS2

作者: 爱折腾的大懒猪 | 来源:发表于2019-04-01 22:55 被阅读22次
    1. 到MSYS2官网 https://www.msys2.org/ 下载64位的MSYS2
    2. 安装.
    3. pacman -Syuu升级系统.最后卡住, 关闭掉重新打开
    4. 再次输入pacman -Syuu 升级其他软件.
    5. pacman -S gcc openssh vim dos2unix perl ruby winpty cmake tar make git 安装一堆软件
    6. 参考下面关于.bashrc不运行的问题.
    7. 参考下面关于解决MSYS2 Here 右键菜单的问题
    8. 参考下面设置Anaconda, VS Code的问题
    9. 参考下面解决Mintty python的问题
    10. 参考下面解决git 提示的问题.

    关于.bashrc不运行的问题

    很奇怪, 以前在Win7时没有遇到这个问题, 在Win10时运行MSYS2的时候就出现写在.bashrc内的配置无法起效. 包括.profile 也没有被正确加载.

    解决办法是在更优先级bash必定加载的/etc/bash.bashrc中运行 .profile (.profile 会自动运行.bashrc).

    notepad /etc/bash.bashrc 编辑 bash启动执行情况, 在最后加入 source ~/.profile

    Reference: #97 64-bit msys2 is not running my .bashrc or .bash_profile.

    解决MSYS2 Here 右键菜单的问题

    新建一个txt文件, 显示后缀名, 将后缀名变为.reg.确认更改后, 右键编辑, 写入以下内容 (我这里装在默认的c:/msys64, 根据自己的情况去变更位置). 运行后确定. 即可加入右键菜单 MSYS2 Here. (这里仅针对mingw64,mingw32类似处理, 没必要)

    Windows Registry Editor Version 5.00
    
    [HKEY_LOCAL_MACHINE\Software\Classes\Directory\Background\shell\MINGW64 here]
    "Icon"="C:\\msys64\\mingw64.exe"
    
    [HKEY_LOCAL_MACHINE\Software\Classes\Directory\Background\shell\MINGW64 here\command]
    @="C:\\msys64\\mingw64.exe bash"
    
    [HKEY_LOCAL_MACHINE\Software\Classes\Directory\shell\MINGW64 here]
    "Icon"="C:\\msys64\\mingw64.exe"
    
    [HKEY_LOCAL_MACHINE\Software\Classes\Directory\shell\MINGW64 here\command]
    @="C:\\msys64\\mingw64.exe bash"
    
    [HKEY_LOCAL_MACHINE\Software\Classes\LibraryFolder\Background\shell\MINGW64 here]
    "Icon"="C:\\msys64\\mingw64.exe"
    
    [HKEY_LOCAL_MACHINE\Software\Classes\LibraryFolder\Background\shell\MINGW64 here\command]
    @="C:\\msys64\\mingw64.exe bash"
    

    Reference

    1. Set up Windows dev environment with MSYS2

    相关文章

      网友评论

        本文标题:安装和配置MSYS2

        本文链接:https://www.haomeiwen.com/subject/exeapqtx.html