Files
Awin Huang 5d4e261181 vault backup: 2025-07-22 22:14:08
Affected files:
Too many files to list
2025-07-22 22:14:08 +08:00

40 lines
1.6 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
tags:
aliases:
date: 2025-05-05
time: 10:08:21
description:
---
# Install Msys2
根據[MSYS2](https://www.msys2.org/)官方頁面來下載並安裝最新的版本。
基本上都只要下一步即可。
## 設定 `MSYS2_HOME` 環境變數
把 Msys2 的 安裝路徑設為環境變數可以讓以後的設定更有彈性。如下:
![[20250505_101259_SystemPropertiesAdvanced_839x208.png]]
## 設定 `path` 環境變數
`path` 環境變數中新增 Msys2 的 bin 路徑,如下:
![[20250505_101427_SystemPropertiesAdvanced_677x633.png]]
# 用 Msys2 安裝開發工具
根據[Environments - MSYS2](https://www.msys2.org/docs/environments/#__tabbed_1_1)Msys2 提供多種開發環境。我們使用 UCRT64。
![[20250505_101709_chrome_844x478.png]]
## 安裝 UCRT64 開發環境
打開 UCRT64 terminal
![[20250505_101809_Obsidian_267x313.png]]
然後輸入`pacman -Syy --needed base-devel mingw-w64-ucrt-x86_64-toolchain`,之後都輸入`Y`來接受所有安裝。
# 用 Msys2 安裝工具
`pacman -Syy <TOOL_NAME>` 就可以安裝工具,例如:
```shell
pacman -Syy zsh git
```
# 參考來源
- [Windows 命令行相关配置之 msys2+zsh+zi](https://sansui233.github.io/posts/windows-zsh-conf)
- [在Windows上使用Fish替换cmd在日常开发过程中我们也需要常常和命令行打交道而Windows自带的cmd或者 - 掘金](https://juejin.cn/post/7362743871979749391)
- [Msys2+VSCode配置Windows下C或C++环境在使用Windows开发C或者C++项目时,大多数人通常会选择 - 掘金](https://juejin.cn/post/7369903157646229556)