Last active
July 4, 2025 08:31
-
-
Save sunasaji/e9b327168240a328808d1628a0a56f23 to your computer and use it in GitHub Desktop.
Revisions
-
sunasaji revised this gist
Jun 8, 2025 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -10,7 +10,8 @@ curl -o /usr/local/bin/zstd.exe -L https://github.com/git-for-windows/git-sdk-64 ``` 3. pacman, pacman-mirrors, msys2-keyring パッケージをMSYS2のリポジトリからcurlで取得して展開する https://packages.msys2.org/queue ※注:下記の https://mirror.msys2.org は今は https://repo.msys2.org とする必要がありそうです (@ras0q さんのコメントより) ``` cd /tmp curl -O -L https://mirror.msys2.org/msys/x86_64/pacman-6.0.1-15-x86_64.pkg.tar.zst -
sunasaji revised this gist
May 31, 2022 . 1 changed file with 7 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -62,7 +62,7 @@ gpg: depth: 0 valid: 1 signed: 1 trust: 0-, 0q, 0n, 0m, 0f, 1u gpg: depth: 1 valid: 1 signed: 0 trust: 1-, 0q, 0n, 0m, 0f, 0u ``` 7. pacman実行。git-for-windowsとMSYS2の鍵が足りていないので対応する。 ``` $ pacman -Syu :: パッケージデータベースの同期中... @@ -109,7 +109,7 @@ gpg: depth: 2 valid: 4 signed: 2 trust: 4-, 0q, 0n, 0m, 0f, 0u gpg: next trustdb check due at 2022-11-18 ``` 9. 鍵の一覧を表示、[ unknown] と表示されている人の鍵を確認する ``` $ pacman-key --list-keys /etc/pacman.d/gnupg/pubring.gpg @@ -191,6 +191,11 @@ uid [ full ] Ray Donnelly (MSYS2 Developer) <[email protected] sub rsa4096 2014-09-28 [E] ``` Git for Windows公式のリポジトリのtrustedの鍵に76871B1Cの鍵も登録されている。 https://github.com/git-for-windows/build-extra/blob/main/git-for-windows-keyring/git-for-windows-trusted Johannes Schindelinさんの以前の鍵のようなので問題なさそう。 https://github.com/git-for-windows/build-extra/blob/main/git-for-windows-keyring/git-for-windows.gpg 10. さきほど確認した鍵が妥当そうならローカルで署名する ``` $ pacman-key --lsign-key 76871B1C -
sunasaji renamed this gist
May 30, 2022 . 1 changed file with 16 additions and 6 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,8 @@ # Git for Windowsにpacmanをインストールする Git for Windowsの環境にMSYS2で使えるパッケージマネージャpacmanをインストールする。 1. Git Bashを管理者権限で立ち上げる 2. MSYS2のzstパッケージを解凍するためzstd.exeを/usr/local/binに配置 ``` mkdir -p /usr/local/bin @@ -20,7 +24,9 @@ rm .BUILDINFO .INSTALL .MTREE .PKGINFO ``` 4. git-for-windowsのpacman.confを取得して/etc/pacman.confに上書き ``` curl -o /etc/pacman.conf -L https://github.com/git-for-windows/git-sdk-64/blob/main/etc/pacman.conf?raw=true ``` 5. pacmanのGPG鍵DBを作成 ``` @@ -56,7 +62,7 @@ gpg: depth: 0 valid: 1 signed: 1 trust: 0-, 0q, 0n, 0m, 0f, 1u gpg: depth: 1 valid: 1 signed: 0 trust: 1-, 0q, 0n, 0m, 0f, 0u ``` 7. pacman実行。git-for-windowsとMSYS2の鍵が信頼できていないので対応する。 ``` $ pacman -Syu :: パッケージデータベースの同期中... @@ -185,7 +191,7 @@ uid [ full ] Ray Donnelly (MSYS2 Developer) <[email protected] sub rsa4096 2014-09-28 [E] ``` 10. さきほど確認した鍵が妥当そうならローカルで署名する ``` $ pacman-key --lsign-key 76871B1C -> 1 キーにローカルで署名しました。 @@ -198,9 +204,13 @@ gpg: next trustdb check due at 2022-11-18 ``` 11. CAの証明書を更新する ``` curl -L http://curl.haxx.se/ca/cacert.pem -o /usr/ssl/certs/ca-bundle.crt ``` 12. これでpacmanが実行できるようになっているはず。 pacman.confのIgnorePkgにbashが指定されているが、これを消して下記を実行した。 ``` pacman -S pacman pacman-mirrors msys2-keyring --overwrite=* ``` いろいろエラーが出たが、git-bashを立ち上げ直したら更新できたようだった。 -
sunasaji created this gist
May 30, 2022 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,206 @@ 1. Git Bashを管理者権限で立ち上げる 2. MSYS2のzstパッケージを解凍するためzstd.exeを/usr/local/binに配置 ``` mkdir -p /usr/local/bin curl -o /usr/local/bin/zstd.exe -L https://github.com/git-for-windows/git-sdk-64/blob/main/usr/bin/zstd.exe?raw=true ``` 3. pacman, pacman-mirrors, msys2-keyring パッケージをMSYS2のリポジトリからcurlで取得して展開する https://packages.msys2.org/queue ``` cd /tmp curl -O -L https://mirror.msys2.org/msys/x86_64/pacman-6.0.1-15-x86_64.pkg.tar.zst curl -O -L https://mirror.msys2.org/msys/x86_64/pacman-mirrors-20220205-1-any.pkg.tar.zst curl -O -L https://mirror.msys2.org/msys/x86_64/msys2-keyring-1~20220522-1-any.pkg.tar.zst cd / tar xvf /tmp/pacman-6.0.1-15-x86_64.pkg.tar.zst tar xvf /tmp/pacman-mirrors-20220205-1-any.pkg.tar.zst tar xvf /tmp/msys2-keyring-1~20220522-1-any.pkg.tar.zst rm .BUILDINFO .INSTALL .MTREE .PKGINFO ``` 4. git-for-windowsのpacman.confを取得して/etc/pacman.confに上書き `curl -o /etc/pacman.conf -L https://github.com/git-for-windows/git-sdk-64/blob/main/etc/pacman.conf?raw=true` 5. pacmanのGPG鍵DBを作成 ``` $ pacman-key --init gpg: /etc/pacman.d/gnupg/trustdb.gpg: trustdb created gpg: no ultimately trusted keys found gpg: starting migration from earlier GnuPG versions gpg: porting secret keys from '/etc/pacman.d/gnupg/secring.gpg' to gpg-agent gpg: migration succeeded ==> pacman のマスターキーを生成しています。しばらくお待ちください。 gpg: Generating pacman keyring master key... gpg: key FC051FD2FE874B1A marked as ultimately trusted gpg: directory '/etc/pacman.d/gnupg/openpgp-revocs.d' created gpg: revocation certificate stored as '/etc/pacman.d/gnupg/openpgp-revocs.d/8378DF495FF723999A32126EFC051FD2FE874B1A.rev' gpg: Done ==> 信頼データベースを更新... gpg: marginals needed: 3 completes needed: 1 trust model: pgp gpg: depth: 0 valid: 1 signed: 0 trust: 0-, 0q, 0n, 0m, 0f, 1u ``` 6. git-for-windowsの鍵を追加 ``` $ curl --location https://raw.githubusercontent.com/git-for-windows/build-extra/master/git-for-windows-keyring/git-for-windows.gpg | pacman-key --add - && pacman-key --lsign-key 1A9F3986 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 10816 100 10816 0 0 155k 0 --:--:-- --:--:-- --:--:-- 160k ==> 信頼データベースを更新... gpg: no need for a trustdb check -> 1 キーにローカルで署名しました。 ==> 信頼データベースを更新... gpg: marginals needed: 3 completes needed: 1 trust model: pgp gpg: depth: 0 valid: 1 signed: 1 trust: 0-, 0q, 0n, 0m, 0f, 1u gpg: depth: 1 valid: 1 signed: 0 trust: 1-, 0q, 0n, 0m, 0f, 0u ``` 7. pacman実行。git-for-windowsとMSYS2の鍵が検証できていないのでこれらを更新していく。 ``` $ pacman -Syu :: パッケージデータベースの同期中... git-for-windows 46.9 KiB 67.6 KiB/s 00:01 [###########################################################################] 100% git-for-windows-mingw32 16.5 KiB 25.0 KiB/s 00:01 [###########################################################################] 100% mingw32 1611.5 KiB 215 KiB/s 00:07 [###########################################################################] 100% mingw64 1621.7 KiB 208 KiB/s 00:08 [###########################################################################] 100% ucrt64 1679.8 KiB 274 KiB/s 00:06 [###########################################################################] 100% clang32 1572.6 KiB 231 KiB/s 00:07 [###########################################################################] 100% clang64 1607.9 KiB 214 KiB/s 00:08 [###########################################################################] 100% msys 390.2 KiB 124 KiB/s 00:03 [###########################################################################] 100% エラー: git-for-windows: "Johannes Schindelin <[email protected]>" の署名は信頼されていません エラー: git-for-windows-mingw32: "Johannes Schindelin <[email protected]>" の署名は信頼されていません エラー: mingw32: キー "5F944B027F7FE2091985AA2EFA11531AA0AA7F57" は不明です :: PGP 鍵 5F944B027F7FE2091985AA2EFA11531AA0AA7F57 をインポートしますか? [Y/n] エラー: mingw32: "Christoph Reiter (MSYS2 development key) <[email protected]>" の署名は信頼されていません エラー: mingw64: "Christoph Reiter (MSYS2 development key) <[email protected]>" の署名は信頼されていません エラー: ucrt64: "Christoph Reiter (MSYS2 development key) <[email protected]>" の署名は信頼されていません エラー: clang32: "Christoph Reiter (MSYS2 development key) <[email protected]>" の署名は信頼されていません エラー: clang64: "Christoph Reiter (MSYS2 development key) <[email protected]>" の署名は信頼されていません エラー: msys: "Christoph Reiter (MSYS2 development key) <[email protected]>" の署名は信頼されていません エラー: 全てのデータベースの同期に失敗しました (無効または破損したデータベース (PGP 鍵)) ``` 8. MSYS2の鍵を更新 ``` $ pacman-key --populate msys2 ==> msys2.gpg からキーを追加... ==> キーリングの信頼されたキーに署名... -> 5 キーにローカルで署名しました。 ==> 所有者信頼値をインポート... gpg: setting ownertrust to 4 gpg: setting ownertrust to 4 gpg: setting ownertrust to 4 gpg: setting ownertrust to 4 gpg: inserting ownertrust of 4 ==> キーリングの破棄されたキーを無効化... -> 3 キーを無効化しました。 ==> 信頼データベースを更新... gpg: marginals needed: 3 completes needed: 1 trust model: pgp gpg: depth: 0 valid: 1 signed: 6 trust: 0-, 0q, 0n, 0m, 0f, 1u gpg: depth: 1 valid: 6 signed: 7 trust: 1-, 0q, 0n, 5m, 0f, 0u gpg: depth: 2 valid: 4 signed: 2 trust: 4-, 0q, 0n, 0m, 0f, 0u gpg: next trustdb check due at 2022-11-18 ``` 9. 鍵の一覧を表示、[ unknown] と表示されている人の鍵をメモする ``` $ pacman-key --list-keys /etc/pacman.d/gnupg/pubring.gpg ------------------------------- pub rsa4096 2022-05-30 [SC] 8378DF495FF723999A32126EFC051FD2FE874B1A uid [ultimate] Pacman Keyring Master Key <pacman@localhost> pub rsa4096 2021-03-23 [SC] [expires: 2026-03-22] E8325679DFFF09668AD8D7B67115A57376871B1C ★ uid [ unknown] Johannes Schindelin <[email protected]> ★ sub rsa4096 2021-03-23 [E] [expires: 2026-03-22] sub rsa4096 2021-03-23 [S] [expires: 2026-03-22] pub rsa4096 2013-09-13 [SC] 3B6D86A1BA7701CD0F23AED888138B9E1A9F3986 uid [ full ] Johannes Schindelin <[email protected]> sub rsa4096 2013-09-13 [E] sub rsa4096 2014-01-17 [S] pub rsa4096 2020-06-22 [SC] 5F944B027F7FE2091985AA2EFA11531AA0AA7F57 uid [ full ] Christoph Reiter (MSYS2 development key) <[email protected]> sub rsa4096 2020-06-22 [E] pub rsa2048 2014-09-28 [SC] D55E7A6D7CE9BA1587C0ACACF40D263ECA25678A uid [ full ] Alexey Pavlov (Alexpux) <[email protected]> sub rsa2048 2014-09-28 [E] pub rsa4096 2020-06-19 [SC] 6E8FEAFF9644F54EED90EEA0790AE56A1D3CFDDC uid [ full ] David Macek (MSYS2 master key) <[email protected]> pub rsa4096 2014-10-04 [SC] 9DD0D4217D75A33B896159E6DA7EF2ABAEEA755C uid [ full ] Martell Malone (martell) <[email protected]> sub rsa4096 2014-10-04 [E] pub rsa4096 2020-06-22 [SC] 69985C5EB351011C78DF7F6D755B8182ACD22879 uid [ full ] Christoph Reiter (MSYS2 master key) <[email protected]> sub rsa4096 2020-06-22 [E] pub rsa2048 2014-09-29 [SC] B91BCF3303284BF90CC043CA9F418C233E652008 uid [ full ] Ignacio Casal Quinteiro <[email protected]> sub rsa2048 2014-09-29 [E] pub rsa4096 2014-09-28 [SC] 123D4D51A1793859C2BE916BBBE514E53E0D0813 uid [marginal] Ray Donnelly (MSYS2 Developer - master key) <[email protected]> sub rsa4096 2014-09-28 [E] pub dsa2048 2013-11-11 [SC] AD351C50AE085775EB59333B5F92EFC1A47D45A1 uid [ full ] Alexey Pavlov (Alexpux) <[email protected]> sub elg2048 2013-11-11 [E] pub rsa4096 2018-01-14 [SC] [expires: 2022-11-18] 87771331B3F1FF5263856A6D974C8BE49078F532 uid [ full ] David Macek <[email protected]> sub rsa4096 2018-01-14 [E] [expires: 2022-11-18] sub rsa3072 2018-01-14 [S] [expires: 2022-11-18] pub rsa4096 2015-07-22 [SC] C65EC8966983541D52B97A16D595C9AB2C51581E uid [marginal] Martell Malone (MSYS2 Developer) <[email protected]> sub rsa4096 2015-07-22 [E] pub rsa4096 2014-11-05 [SC] B19514FB53EB3668471B296E794DCF97F93FC717 uid [marginal] Martell Malone (martell) <[email protected]> sub rsa4096 2014-11-05 [E] pub rsa4096 2014-09-28 [SC] 909F9599D1A2046B21FAEB3C4DF3B7664CA56930 uid [ full ] Ray Donnelly (MSYS2 Developer) <[email protected]> sub rsa4096 2014-09-28 [E] ``` 10. さきほど確認した鍵にローカルで署名する ``` $ pacman-key --lsign-key 76871B1C -> 1 キーにローカルで署名しました。 ==> 信頼データベースを更新... gpg: marginals needed: 3 completes needed: 1 trust model: pgp gpg: depth: 0 valid: 1 signed: 7 trust: 0-, 0q, 0n, 0m, 0f, 1u gpg: depth: 1 valid: 7 signed: 7 trust: 2-, 0q, 0n, 5m, 0f, 0u gpg: depth: 2 valid: 4 signed: 2 trust: 4-, 0q, 0n, 0m, 0f, 0u gpg: next trustdb check due at 2022-11-18 ``` 11. CAの証明書を更新する `curl -L http://curl.haxx.se/ca/cacert.pem -o /usr/ssl/certs/ca-bundle.crt` 12. これでpacmanが実行できるようになっているはず。 pacman.confのIgnorePkgにbashが指定されているが、これを消して下記を実行した。 `pacman -S pacman pacman-mirrors msys2-keyring --overwrite=*` いろいろエラーが出たが、git-bashを立ち上げ直したら更新できていたようだった。