@fredlackey/devutils 0.0.1 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (259) hide show
  1. package/README.md +5 -5
  2. package/package.json +1 -1
  3. package/src/commands/install.js +374 -36
  4. package/src/installs/adobe-creative-cloud.js +527 -25
  5. package/src/installs/adobe-creative-cloud.md +605 -0
  6. package/src/installs/appcleaner.js +303 -26
  7. package/src/installs/appcleaner.md +699 -0
  8. package/src/installs/apt-transport-https.js +390 -0
  9. package/src/installs/apt-transport-https.md +678 -0
  10. package/src/installs/atomicparsley.js +624 -26
  11. package/src/installs/atomicparsley.md +795 -0
  12. package/src/installs/aws-cli.js +779 -26
  13. package/src/installs/aws-cli.md +727 -0
  14. package/src/installs/balena-etcher.js +688 -26
  15. package/src/installs/balena-etcher.md +761 -0
  16. package/src/installs/bambu-studio.js +912 -26
  17. package/src/installs/bambu-studio.md +780 -0
  18. package/src/installs/bash-completion.js +554 -23
  19. package/src/installs/bash-completion.md +833 -0
  20. package/src/installs/bash.js +399 -26
  21. package/src/installs/bash.md +993 -0
  22. package/src/installs/beyond-compare.js +585 -26
  23. package/src/installs/beyond-compare.md +813 -0
  24. package/src/installs/build-essential.js +511 -26
  25. package/src/installs/build-essential.md +977 -0
  26. package/src/installs/ca-certificates.js +618 -0
  27. package/src/installs/ca-certificates.md +937 -0
  28. package/src/installs/caffeine.js +490 -26
  29. package/src/installs/caffeine.md +839 -0
  30. package/src/installs/camtasia.js +577 -25
  31. package/src/installs/camtasia.md +762 -0
  32. package/src/installs/chatgpt.js +458 -26
  33. package/src/installs/chatgpt.md +814 -0
  34. package/src/installs/chocolatey.js +447 -0
  35. package/src/installs/chocolatey.md +661 -0
  36. package/src/installs/chrome-canary.js +472 -26
  37. package/src/installs/chrome-canary.md +641 -0
  38. package/src/installs/chromium.js +645 -26
  39. package/src/installs/chromium.md +838 -0
  40. package/src/installs/claude-code.js +558 -26
  41. package/src/installs/claude-code.md +1173 -0
  42. package/src/installs/curl.js +361 -26
  43. package/src/installs/curl.md +714 -0
  44. package/src/installs/cursor.js +561 -26
  45. package/src/installs/cursor.md +970 -0
  46. package/src/installs/dbschema.js +674 -26
  47. package/src/installs/dbschema.md +925 -0
  48. package/src/installs/dependencies.md +435 -0
  49. package/src/installs/development-tools.js +600 -0
  50. package/src/installs/development-tools.md +977 -0
  51. package/src/installs/docker.js +1010 -25
  52. package/src/installs/docker.md +1109 -0
  53. package/src/installs/drawio.js +1001 -26
  54. package/src/installs/drawio.md +795 -0
  55. package/src/installs/elmedia-player.js +328 -25
  56. package/src/installs/elmedia-player.md +556 -0
  57. package/src/installs/ffmpeg.js +870 -25
  58. package/src/installs/ffmpeg.md +852 -0
  59. package/src/installs/file.js +464 -0
  60. package/src/installs/file.md +987 -0
  61. package/src/installs/gemini-cli.js +793 -26
  62. package/src/installs/gemini-cli.md +1153 -0
  63. package/src/installs/git.js +382 -26
  64. package/src/installs/git.md +907 -0
  65. package/src/installs/gitego.js +931 -26
  66. package/src/installs/gitego.md +1172 -0
  67. package/src/installs/go.js +913 -26
  68. package/src/installs/go.md +958 -0
  69. package/src/installs/google-chrome.js +801 -25
  70. package/src/installs/google-chrome.md +862 -0
  71. package/src/installs/gpg.js +412 -73
  72. package/src/installs/gpg.md +1056 -0
  73. package/src/installs/homebrew.js +1015 -26
  74. package/src/installs/homebrew.md +988 -0
  75. package/src/installs/imageoptim.js +950 -26
  76. package/src/installs/imageoptim.md +1119 -0
  77. package/src/installs/installers.json +2297 -0
  78. package/src/installs/jq.js +382 -26
  79. package/src/installs/jq.md +809 -0
  80. package/src/installs/keyboard-maestro.js +701 -26
  81. package/src/installs/keyboard-maestro.md +825 -0
  82. package/src/installs/latex.js +771 -26
  83. package/src/installs/latex.md +1095 -0
  84. package/src/installs/lftp.js +338 -26
  85. package/src/installs/lftp.md +907 -0
  86. package/src/installs/lsb-release.js +346 -0
  87. package/src/installs/lsb-release.md +814 -0
  88. package/src/installs/messenger.js +829 -26
  89. package/src/installs/messenger.md +900 -0
  90. package/src/installs/microsoft-office.js +550 -26
  91. package/src/installs/microsoft-office.md +760 -0
  92. package/src/installs/microsoft-teams.js +782 -25
  93. package/src/installs/microsoft-teams.md +886 -0
  94. package/src/installs/node.js +886 -26
  95. package/src/installs/node.md +1153 -0
  96. package/src/installs/nordpass.js +698 -26
  97. package/src/installs/nordpass.md +921 -0
  98. package/src/installs/nvm.js +977 -26
  99. package/src/installs/nvm.md +1057 -0
  100. package/src/installs/openssh.js +734 -64
  101. package/src/installs/openssh.md +1056 -0
  102. package/src/installs/pandoc.js +644 -26
  103. package/src/installs/pandoc.md +1036 -0
  104. package/src/installs/pinentry.js +492 -26
  105. package/src/installs/pinentry.md +1142 -0
  106. package/src/installs/pngyu.js +851 -26
  107. package/src/installs/pngyu.md +896 -0
  108. package/src/installs/postman.js +781 -26
  109. package/src/installs/postman.md +940 -0
  110. package/src/installs/procps.js +425 -0
  111. package/src/installs/procps.md +851 -0
  112. package/src/installs/safari-tech-preview.js +355 -25
  113. package/src/installs/safari-tech-preview.md +533 -0
  114. package/src/installs/sfnt2woff.js +640 -26
  115. package/src/installs/sfnt2woff.md +795 -0
  116. package/src/installs/shellcheck.js +463 -26
  117. package/src/installs/shellcheck.md +1005 -0
  118. package/src/installs/slack.js +722 -25
  119. package/src/installs/slack.md +865 -0
  120. package/src/installs/snagit.js +566 -25
  121. package/src/installs/snagit.md +844 -0
  122. package/src/installs/software-properties-common.js +372 -0
  123. package/src/installs/software-properties-common.md +805 -0
  124. package/src/installs/spotify.js +858 -25
  125. package/src/installs/spotify.md +901 -0
  126. package/src/installs/studio-3t.js +803 -26
  127. package/src/installs/studio-3t.md +918 -0
  128. package/src/installs/sublime-text.js +780 -25
  129. package/src/installs/sublime-text.md +914 -0
  130. package/src/installs/superwhisper.js +687 -25
  131. package/src/installs/superwhisper.md +630 -0
  132. package/src/installs/tailscale.js +727 -26
  133. package/src/installs/tailscale.md +1100 -0
  134. package/src/installs/tar.js +389 -0
  135. package/src/installs/tar.md +946 -0
  136. package/src/installs/termius.js +780 -26
  137. package/src/installs/termius.md +844 -0
  138. package/src/installs/terraform.js +761 -26
  139. package/src/installs/terraform.md +899 -0
  140. package/src/installs/tidal.js +752 -25
  141. package/src/installs/tidal.md +864 -0
  142. package/src/installs/tmux.js +328 -26
  143. package/src/installs/tmux.md +1030 -0
  144. package/src/installs/tree.js +393 -26
  145. package/src/installs/tree.md +833 -0
  146. package/src/installs/unzip.js +460 -0
  147. package/src/installs/unzip.md +879 -0
  148. package/src/installs/vim.js +403 -26
  149. package/src/installs/vim.md +1040 -0
  150. package/src/installs/vlc.js +803 -26
  151. package/src/installs/vlc.md +927 -0
  152. package/src/installs/vscode.js +825 -26
  153. package/src/installs/vscode.md +1002 -0
  154. package/src/installs/wget.js +415 -0
  155. package/src/installs/wget.md +791 -0
  156. package/src/installs/whatsapp.js +710 -25
  157. package/src/installs/whatsapp.md +854 -0
  158. package/src/installs/winpty.js +352 -0
  159. package/src/installs/winpty.md +620 -0
  160. package/src/installs/woff2.js +535 -26
  161. package/src/installs/woff2.md +977 -0
  162. package/src/installs/wsl.js +572 -0
  163. package/src/installs/wsl.md +699 -0
  164. package/src/installs/xcode-clt.js +520 -0
  165. package/src/installs/xcode-clt.md +351 -0
  166. package/src/installs/xcode.js +542 -26
  167. package/src/installs/xcode.md +573 -0
  168. package/src/installs/yarn.js +806 -26
  169. package/src/installs/yarn.md +1074 -0
  170. package/src/installs/yq.js +636 -26
  171. package/src/installs/yq.md +944 -0
  172. package/src/installs/yt-dlp.js +683 -26
  173. package/src/installs/yt-dlp.md +946 -0
  174. package/src/installs/yum-utils.js +297 -0
  175. package/src/installs/yum-utils.md +648 -0
  176. package/src/installs/zoom.js +740 -25
  177. package/src/installs/zoom.md +884 -0
  178. package/src/scripts/README.md +567 -45
  179. package/src/scripts/STATUS.md +208 -0
  180. package/src/scripts/afk.js +395 -7
  181. package/src/scripts/backup-all.js +731 -9
  182. package/src/scripts/backup-source.js +711 -8
  183. package/src/scripts/brewd.js +373 -7
  184. package/src/scripts/brewi.js +505 -9
  185. package/src/scripts/brewr.js +512 -9
  186. package/src/scripts/brews.js +462 -9
  187. package/src/scripts/brewu.js +488 -7
  188. package/src/scripts/c.js +185 -7
  189. package/src/scripts/ccurl.js +325 -8
  190. package/src/scripts/certbot-crontab-init.js +488 -8
  191. package/src/scripts/certbot-init.js +641 -9
  192. package/src/scripts/ch.js +339 -7
  193. package/src/scripts/claude-danger.js +253 -8
  194. package/src/scripts/clean-dev.js +419 -8
  195. package/src/scripts/clear-dns-cache.js +525 -7
  196. package/src/scripts/clone.js +417 -7
  197. package/src/scripts/code-all.js +420 -7
  198. package/src/scripts/count-files.js +195 -8
  199. package/src/scripts/count-folders.js +195 -8
  200. package/src/scripts/count.js +248 -8
  201. package/src/scripts/d.js +203 -7
  202. package/src/scripts/datauri.js +373 -8
  203. package/src/scripts/delete-files.js +363 -7
  204. package/src/scripts/docker-clean.js +410 -8
  205. package/src/scripts/dp.js +426 -7
  206. package/src/scripts/e.js +375 -9
  207. package/src/scripts/empty-trash.js +497 -7
  208. package/src/scripts/evm.js +428 -9
  209. package/src/scripts/fetch-github-repos.js +441 -10
  210. package/src/scripts/get-channel.js +329 -8
  211. package/src/scripts/get-course.js +384 -11
  212. package/src/scripts/get-dependencies.js +290 -9
  213. package/src/scripts/get-folder.js +783 -10
  214. package/src/scripts/get-tunes.js +411 -10
  215. package/src/scripts/get-video.js +352 -9
  216. package/src/scripts/git-backup.js +561 -9
  217. package/src/scripts/git-clone.js +477 -9
  218. package/src/scripts/git-pup.js +303 -7
  219. package/src/scripts/git-push.js +380 -8
  220. package/src/scripts/h.js +607 -9
  221. package/src/scripts/hide-desktop-icons.js +483 -7
  222. package/src/scripts/hide-hidden-files.js +522 -7
  223. package/src/scripts/install-dependencies-from.js +440 -9
  224. package/src/scripts/ips.js +647 -10
  225. package/src/scripts/iso.js +354 -8
  226. package/src/scripts/killni.js +561 -7
  227. package/src/scripts/ll.js +451 -8
  228. package/src/scripts/local-ip.js +310 -8
  229. package/src/scripts/m.js +508 -8
  230. package/src/scripts/map.js +293 -8
  231. package/src/scripts/mkd.js +287 -7
  232. package/src/scripts/ncu-update-all.js +441 -8
  233. package/src/scripts/nginx-init.js +702 -12
  234. package/src/scripts/npmi.js +366 -7
  235. package/src/scripts/o.js +495 -8
  236. package/src/scripts/org-by-date.js +321 -7
  237. package/src/scripts/p.js +208 -7
  238. package/src/scripts/packages.js +313 -8
  239. package/src/scripts/path.js +209 -7
  240. package/src/scripts/ports.js +582 -8
  241. package/src/scripts/q.js +290 -8
  242. package/src/scripts/refresh-files.js +378 -10
  243. package/src/scripts/remove-smaller-files.js +500 -8
  244. package/src/scripts/rename-files-with-date.js +517 -9
  245. package/src/scripts/resize-image.js +523 -9
  246. package/src/scripts/rm-safe.js +653 -8
  247. package/src/scripts/s.js +525 -9
  248. package/src/scripts/set-git-public.js +349 -7
  249. package/src/scripts/show-desktop-icons.js +459 -7
  250. package/src/scripts/show-hidden-files.js +456 -7
  251. package/src/scripts/tpa.js +265 -8
  252. package/src/scripts/tpo.js +264 -7
  253. package/src/scripts/u.js +489 -7
  254. package/src/scripts/vpush.js +422 -8
  255. package/src/scripts/y.js +267 -7
  256. package/src/utils/common/os.js +94 -2
  257. package/src/utils/ubuntu/apt.js +13 -7
  258. package/src/utils/windows/choco.js +82 -26
  259. package/src/utils/windows/winget.js +89 -27
@@ -0,0 +1,1142 @@
1
+ # Installing Pinentry
2
+
3
+ ## Overview
4
+
5
+ Pinentry is a collection of small dialog programs that allow GnuPG (GPG) and other programs to read passphrases and PIN numbers in a secure manner. It is an essential companion to GPG, providing the graphical or text-based interface that prompts users to enter their passphrase when performing cryptographic operations such as signing Git commits, decrypting files, or managing GPG keys.
6
+
7
+ Pinentry ensures that entered information is:
8
+
9
+ - Not swapped to disk
10
+ - Not temporarily stored anywhere accessible to other processes
11
+ - Protected from screen capture and keystroke logging where possible
12
+ - Displayed in a trusted, secure dialog
13
+
14
+ Without a properly configured pinentry program, GPG operations that require a passphrase will fail with "No pinentry" errors. This guide documents pinentry installation procedures for all platforms supported by DevUtils CLI.
15
+
16
+ ## Dependencies
17
+
18
+ ### macOS (Homebrew)
19
+ - **Required:**
20
+ - `Homebrew` - Install via `/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"` or `dev install homebrew`
21
+ - `GnuPG` - Install via `brew install gnupg` or `dev install gpg`
22
+ - **Optional:** None
23
+ - **Auto-installed:** None
24
+
25
+ ### Ubuntu (APT/Snap)
26
+ - **Required:**
27
+ - `sudo privileges` - Required for APT operations
28
+ - `GnuPG` - Install via `sudo apt-get install -y gnupg` or `dev install gpg`
29
+ - **Optional:**
30
+ - `pinentry-gnome3` - Install via `sudo apt-get install -y pinentry-gnome3` (for GNOME desktop environments)
31
+ - `pinentry-qt` - Install via `sudo apt-get install -y pinentry-qt` (for KDE/Qt desktop environments)
32
+ - **Auto-installed:** None
33
+
34
+ ### Raspberry Pi OS (APT/Snap)
35
+ - **Required:**
36
+ - `sudo privileges` - Required for APT operations
37
+ - `GnuPG` - Install via `sudo apt-get install -y gnupg` or `dev install gpg`
38
+ - **Optional:**
39
+ - `pinentry-gnome3` - Install via `sudo apt-get install -y pinentry-gnome3` (for desktop environments)
40
+ - `pinentry-qt` - Install via `sudo apt-get install -y pinentry-qt` (for KDE/Qt desktop environments)
41
+ - **Auto-installed:** None
42
+
43
+ ### Amazon Linux (DNF/YUM)
44
+ - **Required:**
45
+ - `sudo privileges` - Required for DNF/YUM operations
46
+ - `GnuPG` - Install via `sudo dnf install -y gnupg` (AL2023) or `sudo yum install -y gnupg` (AL2), or `dev install gpg`
47
+ - **Optional:** None
48
+ - **Auto-installed:** None
49
+
50
+ ### Windows (Chocolatey/winget)
51
+ - **Required:**
52
+ - `GnuPG` - Pinentry is bundled with GnuPG on Windows. Install via `winget install --id GnuPG.GnuPG --silent` or `choco install gnupg -y`, or `dev install gpg`
53
+ - Either `winget` (built into Windows 10 1809+ and Windows 11) or `Chocolatey` - Install Chocolatey via `dev install chocolatey` if needed
54
+ - **Optional:**
55
+ - `Gpg4win` - Install via `choco install gpg4win -y` (provides pinentry-qt.exe for Qt-based GUI dialog)
56
+ - **Auto-installed:**
57
+ - `pinentry-basic.exe` - Automatically included with GnuPG installation
58
+
59
+ ### Git Bash (Manual/Portable)
60
+ - **Required:**
61
+ - `Windows GnuPG` - Install via `winget install --id GnuPG.GnuPG --silent` or `choco install gnupg -y` from PowerShell, or `dev install gpg`
62
+ - `Git for Windows` - Required to provide Git Bash environment (typically already installed). Download from https://git-scm.com/download/win
63
+ - **Optional:** None
64
+ - **Auto-installed:**
65
+ - `pinentry-basic.exe` - Automatically included with Windows GnuPG installation
66
+
67
+ ## Prerequisites
68
+
69
+ Before installing pinentry on any platform, ensure:
70
+
71
+ 1. **GnuPG is installed** - Pinentry works in conjunction with GPG; install GPG first
72
+ 2. **Internet connectivity** - Required to download pinentry packages
73
+ 3. **Administrative privileges** - Required for system-wide installation
74
+ 4. **Terminal access** - Required to run installation commands
75
+
76
+ ## Platform-Specific Installation
77
+
78
+ ### macOS (Homebrew)
79
+
80
+ #### Prerequisites
81
+
82
+ - macOS 10.15 (Catalina) or later (macOS 14 Sonoma or later recommended)
83
+ - Homebrew package manager installed
84
+ - GnuPG installed (the `gnupg` package)
85
+ - Command line access via Terminal.app or iTerm2
86
+
87
+ If Homebrew is not installed, install it first:
88
+
89
+ ```bash
90
+ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
91
+ ```
92
+
93
+ #### Installation Steps
94
+
95
+ Run the following command to install pinentry-mac:
96
+
97
+ ```bash
98
+ brew install --quiet pinentry-mac
99
+ ```
100
+
101
+ The `--quiet` flag suppresses non-essential output, making the installation suitable for automation and scripts.
102
+
103
+ **Configure GPG to use pinentry-mac:**
104
+
105
+ Create the GnuPG configuration directory (if it does not exist) and configure the GPG agent to use pinentry-mac:
106
+
107
+ ```bash
108
+ mkdir -p ~/.gnupg
109
+ chmod 700 ~/.gnupg
110
+ echo "pinentry-program $(brew --prefix)/bin/pinentry-mac" >> ~/.gnupg/gpg-agent.conf
111
+ gpgconf --kill gpg-agent
112
+ ```
113
+
114
+ This configuration enables a native macOS dialog for entering GPG passphrases, which integrates with macOS Keychain for optional passphrase storage.
115
+
116
+ #### Verification
117
+
118
+ Confirm the installation succeeded:
119
+
120
+ ```bash
121
+ pinentry-mac --version
122
+ ```
123
+
124
+ Expected output (version numbers may vary):
125
+
126
+ ```
127
+ pinentry-mac (pinentry) 1.3.1.1
128
+ ```
129
+
130
+ Verify pinentry-mac is configured in GPG:
131
+
132
+ ```bash
133
+ cat ~/.gnupg/gpg-agent.conf | grep pinentry
134
+ ```
135
+
136
+ Expected output (path varies by architecture):
137
+
138
+ ```
139
+ pinentry-program /opt/homebrew/bin/pinentry-mac
140
+ ```
141
+
142
+ On Intel Macs, the path will be `/usr/local/bin/pinentry-mac`.
143
+
144
+ Test the pinentry dialog by requesting a GPG passphrase:
145
+
146
+ ```bash
147
+ echo "test" | gpg --clearsign
148
+ ```
149
+
150
+ A native macOS dialog should appear requesting your GPG passphrase.
151
+
152
+ #### Troubleshooting
153
+
154
+ **Problem**: `pinentry-mac --version` shows "command not found"
155
+
156
+ **Solution**: Ensure Homebrew's bin directory is in your PATH:
157
+
158
+ ```bash
159
+ echo 'export PATH="$(brew --prefix)/bin:$PATH"' >> ~/.zshrc
160
+ source ~/.zshrc
161
+ ```
162
+
163
+ **Problem**: `brew: command not found`
164
+
165
+ **Solution**: Homebrew is not installed or not in PATH. Install Homebrew first:
166
+
167
+ ```bash
168
+ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
169
+ ```
170
+
171
+ **Problem**: Passphrase dialog does not appear when signing commits
172
+
173
+ **Solution**: The GPG agent may not be using pinentry-mac. Verify the configuration and restart the agent:
174
+
175
+ ```bash
176
+ echo "pinentry-program $(brew --prefix)/bin/pinentry-mac" > ~/.gnupg/gpg-agent.conf
177
+ gpgconf --kill gpg-agent
178
+ ```
179
+
180
+ **Problem**: "No pinentry" error when generating keys
181
+
182
+ **Solution**: Ensure pinentry-mac is installed and configured, then restart the GPG agent:
183
+
184
+ ```bash
185
+ brew install --quiet pinentry-mac
186
+ mkdir -p ~/.gnupg
187
+ echo "pinentry-program $(brew --prefix)/bin/pinentry-mac" > ~/.gnupg/gpg-agent.conf
188
+ gpgconf --kill gpg-agent
189
+ ```
190
+
191
+ **Problem**: Permission errors on `~/.gnupg`
192
+
193
+ **Solution**: Fix permissions on the GnuPG directory:
194
+
195
+ ```bash
196
+ chmod 700 ~/.gnupg
197
+ chmod 600 ~/.gnupg/*
198
+ ```
199
+
200
+ ---
201
+
202
+ ### Ubuntu/Debian (APT)
203
+
204
+ #### Prerequisites
205
+
206
+ - Ubuntu 20.04 LTS or later, or Debian 11 (Bullseye) or later
207
+ - sudo privileges
208
+ - Internet connectivity
209
+ - GnuPG installed
210
+
211
+ Ubuntu and Debian provide multiple pinentry variants. Choose the appropriate one based on your environment.
212
+
213
+ #### Installation Steps
214
+
215
+ **For desktop environments (GNOME):**
216
+
217
+ Run the following commands to install pinentry-gnome3:
218
+
219
+ ```bash
220
+ sudo DEBIAN_FRONTEND=noninteractive apt-get update -y
221
+ sudo DEBIAN_FRONTEND=noninteractive apt-get install -y pinentry-gnome3
222
+ ```
223
+
224
+ **For terminal/server environments (recommended for headless systems):**
225
+
226
+ ```bash
227
+ sudo DEBIAN_FRONTEND=noninteractive apt-get update -y
228
+ sudo DEBIAN_FRONTEND=noninteractive apt-get install -y pinentry-curses
229
+ ```
230
+
231
+ The `DEBIAN_FRONTEND=noninteractive` environment variable ensures no interactive prompts appear during installation, making this suitable for scripts and automation.
232
+
233
+ **Available pinentry packages:**
234
+
235
+ | Package | Description | Use Case |
236
+ |---------|-------------|----------|
237
+ | `pinentry-curses` | Text-based curses dialog | Servers, SSH sessions, terminals |
238
+ | `pinentry-tty` | Minimal TTY-only dialog | Minimal systems |
239
+ | `pinentry-gnome3` | GNOME 3 native dialog | GNOME desktop environments |
240
+ | `pinentry-gtk2` | GTK+ 2 dialog | GTK-based desktop environments |
241
+ | `pinentry-qt` | Qt-based dialog | KDE/Qt desktop environments |
242
+ | `pinentry-fltk` | FLTK-based dialog | Lightweight desktops |
243
+
244
+ **Configure GPG to use a specific pinentry (optional):**
245
+
246
+ If you have multiple pinentry programs installed and want to specify which one to use:
247
+
248
+ ```bash
249
+ mkdir -p ~/.gnupg
250
+ chmod 700 ~/.gnupg
251
+ echo "pinentry-program /usr/bin/pinentry-curses" > ~/.gnupg/gpg-agent.conf
252
+ gpgconf --kill gpg-agent
253
+ ```
254
+
255
+ Replace `/usr/bin/pinentry-curses` with the path to your preferred pinentry program.
256
+
257
+ #### Verification
258
+
259
+ Confirm the installation succeeded:
260
+
261
+ ```bash
262
+ pinentry --version
263
+ ```
264
+
265
+ Expected output (version numbers may vary):
266
+
267
+ ```
268
+ pinentry-curses (pinentry) 1.3.1
269
+ ```
270
+
271
+ Verify the installation location:
272
+
273
+ ```bash
274
+ which pinentry
275
+ ```
276
+
277
+ Expected output:
278
+
279
+ ```
280
+ /usr/bin/pinentry
281
+ ```
282
+
283
+ List all installed pinentry variants:
284
+
285
+ ```bash
286
+ update-alternatives --list pinentry 2>/dev/null || ls /usr/bin/pinentry*
287
+ ```
288
+
289
+ #### Troubleshooting
290
+
291
+ **Problem**: `E: Unable to locate package pinentry-gnome3`
292
+
293
+ **Solution**: Update your package lists:
294
+
295
+ ```bash
296
+ sudo DEBIAN_FRONTEND=noninteractive apt-get update -y
297
+ ```
298
+
299
+ **Problem**: "No pinentry" error when generating keys or signing
300
+
301
+ **Solution**: Install a pinentry package and restart the GPG agent:
302
+
303
+ ```bash
304
+ sudo DEBIAN_FRONTEND=noninteractive apt-get install -y pinentry-curses
305
+ gpgconf --kill gpg-agent
306
+ ```
307
+
308
+ **Problem**: GUI pinentry does not appear in desktop environment
309
+
310
+ **Solution**: Install the appropriate GUI pinentry for your desktop:
311
+
312
+ ```bash
313
+ # For GNOME
314
+ sudo DEBIAN_FRONTEND=noninteractive apt-get install -y pinentry-gnome3
315
+
316
+ # For KDE/Qt
317
+ sudo DEBIAN_FRONTEND=noninteractive apt-get install -y pinentry-qt
318
+ ```
319
+
320
+ **Problem**: Pinentry hangs or times out over SSH
321
+
322
+ **Solution**: Ensure `GPG_TTY` is set in your shell profile:
323
+
324
+ ```bash
325
+ echo 'export GPG_TTY=$(tty)' >> ~/.bashrc
326
+ source ~/.bashrc
327
+ ```
328
+
329
+ ---
330
+
331
+ ### Raspberry Pi OS (APT)
332
+
333
+ #### Prerequisites
334
+
335
+ - Raspberry Pi OS (Bookworm or Bullseye recommended)
336
+ - Raspberry Pi 3B+ or later (any model supported by Raspberry Pi OS)
337
+ - sudo privileges
338
+ - Internet connectivity
339
+ - GnuPG installed
340
+
341
+ Raspberry Pi OS is based on Debian, so pinentry installation follows the Debian/APT method. Pinentry works on both 32-bit (armhf) and 64-bit (arm64) architectures.
342
+
343
+ #### Installation Steps
344
+
345
+ First, verify your architecture:
346
+
347
+ ```bash
348
+ uname -m
349
+ ```
350
+
351
+ - `aarch64` = 64-bit ARM
352
+ - `armv7l` = 32-bit ARM
353
+
354
+ **For headless/server Raspberry Pi systems (most common):**
355
+
356
+ ```bash
357
+ sudo DEBIAN_FRONTEND=noninteractive apt-get update -y
358
+ sudo DEBIAN_FRONTEND=noninteractive apt-get install -y pinentry-curses
359
+ ```
360
+
361
+ **For Raspberry Pi with desktop environment:**
362
+
363
+ ```bash
364
+ sudo DEBIAN_FRONTEND=noninteractive apt-get update -y
365
+ sudo DEBIAN_FRONTEND=noninteractive apt-get install -y pinentry-gnome3
366
+ ```
367
+
368
+ The installation command is identical for both 32-bit and 64-bit Raspberry Pi OS.
369
+
370
+ **Configure pinentry for headless use:**
371
+
372
+ For headless Raspberry Pi systems, configure GPG to use pinentry-curses:
373
+
374
+ ```bash
375
+ mkdir -p ~/.gnupg
376
+ chmod 700 ~/.gnupg
377
+ echo "pinentry-program /usr/bin/pinentry-curses" > ~/.gnupg/gpg-agent.conf
378
+ gpgconf --kill gpg-agent
379
+ ```
380
+
381
+ #### Verification
382
+
383
+ Confirm the installation succeeded:
384
+
385
+ ```bash
386
+ pinentry --version
387
+ ```
388
+
389
+ Expected output (version numbers may vary):
390
+
391
+ ```
392
+ pinentry-curses (pinentry) 1.3.1
393
+ ```
394
+
395
+ Verify the installation location:
396
+
397
+ ```bash
398
+ which pinentry
399
+ ```
400
+
401
+ Expected output:
402
+
403
+ ```
404
+ /usr/bin/pinentry
405
+ ```
406
+
407
+ #### Troubleshooting
408
+
409
+ **Problem**: Installation is slow
410
+
411
+ **Solution**: Raspberry Pi SD cards can be slow. Use a high-quality SD card (Class 10 or A1/A2 rated) or boot from USB/SSD for better performance.
412
+
413
+ **Problem**: "No pinentry" error when generating keys on headless Pi
414
+
415
+ **Solution**: Install and configure pinentry-curses:
416
+
417
+ ```bash
418
+ sudo DEBIAN_FRONTEND=noninteractive apt-get install -y pinentry-curses
419
+ mkdir -p ~/.gnupg
420
+ echo "pinentry-program /usr/bin/pinentry-curses" > ~/.gnupg/gpg-agent.conf
421
+ gpgconf --kill gpg-agent
422
+ ```
423
+
424
+ **Problem**: `E: Unable to fetch some archives`
425
+
426
+ **Solution**: Network connectivity issues. Check your internet connection and retry:
427
+
428
+ ```bash
429
+ sudo DEBIAN_FRONTEND=noninteractive apt-get update -y
430
+ sudo DEBIAN_FRONTEND=noninteractive apt-get install -y pinentry-curses
431
+ ```
432
+
433
+ **Problem**: Pinentry prompt does not appear over SSH
434
+
435
+ **Solution**: Ensure `GPG_TTY` is set:
436
+
437
+ ```bash
438
+ export GPG_TTY=$(tty)
439
+ ```
440
+
441
+ Add to your `~/.bashrc` for persistence:
442
+
443
+ ```bash
444
+ echo 'export GPG_TTY=$(tty)' >> ~/.bashrc
445
+ ```
446
+
447
+ ---
448
+
449
+ ### Amazon Linux (DNF/YUM)
450
+
451
+ #### Prerequisites
452
+
453
+ - Amazon Linux 2023 (AL2023) or Amazon Linux 2 (AL2)
454
+ - sudo privileges
455
+ - EC2 instance or compatible environment
456
+ - GnuPG installed
457
+
458
+ Amazon Linux 2023 uses DNF as the default package manager. Amazon Linux 2 uses YUM.
459
+
460
+ #### Installation Steps
461
+
462
+ **For Amazon Linux 2023 (AL2023):**
463
+
464
+ ```bash
465
+ sudo dnf install -y pinentry
466
+ ```
467
+
468
+ **For Amazon Linux 2 (AL2):**
469
+
470
+ ```bash
471
+ sudo yum install -y pinentry
472
+ ```
473
+
474
+ The `-y` flag automatically confirms installation, enabling non-interactive execution.
475
+
476
+ **Configure pinentry for terminal use:**
477
+
478
+ On server environments like EC2, configure GPG to use pinentry-curses:
479
+
480
+ ```bash
481
+ mkdir -p ~/.gnupg
482
+ chmod 700 ~/.gnupg
483
+ echo "pinentry-program /usr/bin/pinentry-curses" > ~/.gnupg/gpg-agent.conf
484
+ gpgconf --kill gpg-agent
485
+ ```
486
+
487
+ #### Verification
488
+
489
+ Confirm the installation succeeded:
490
+
491
+ ```bash
492
+ pinentry --version
493
+ ```
494
+
495
+ Expected output (version numbers may vary):
496
+
497
+ ```
498
+ pinentry-curses (pinentry) 1.2.1
499
+ ```
500
+
501
+ Verify the installation location:
502
+
503
+ ```bash
504
+ which pinentry
505
+ ```
506
+
507
+ Expected output:
508
+
509
+ ```
510
+ /usr/bin/pinentry
511
+ ```
512
+
513
+ List available pinentry programs:
514
+
515
+ ```bash
516
+ rpm -ql pinentry | grep bin
517
+ ```
518
+
519
+ #### Troubleshooting
520
+
521
+ **Problem**: `No match for argument: pinentry` on Amazon Linux 2
522
+
523
+ **Solution**: Update the yum cache and retry:
524
+
525
+ ```bash
526
+ sudo yum makecache
527
+ sudo yum install -y pinentry
528
+ ```
529
+
530
+ **Problem**: "No pinentry" error when using GPG
531
+
532
+ **Solution**: Verify pinentry is installed and restart the GPG agent:
533
+
534
+ ```bash
535
+ sudo dnf install -y pinentry
536
+ gpgconf --kill gpg-agent
537
+ ```
538
+
539
+ **Problem**: Permission denied errors
540
+
541
+ **Solution**: Ensure you are using sudo:
542
+
543
+ ```bash
544
+ sudo dnf install -y pinentry
545
+ ```
546
+
547
+ **Problem**: Pinentry hangs waiting for input over SSH
548
+
549
+ **Solution**: Set the `GPG_TTY` environment variable:
550
+
551
+ ```bash
552
+ export GPG_TTY=$(tty)
553
+ ```
554
+
555
+ Add to your shell profile for persistence:
556
+
557
+ ```bash
558
+ echo 'export GPG_TTY=$(tty)' >> ~/.bashrc
559
+ ```
560
+
561
+ ---
562
+
563
+ ### Windows (Chocolatey/winget)
564
+
565
+ #### Prerequisites
566
+
567
+ - Windows 10 version 1903 or higher (64-bit), or Windows 11
568
+ - Administrator PowerShell or Command Prompt
569
+ - Chocolatey or winget package manager installed
570
+
571
+ **Note**: On Windows, pinentry is bundled with GnuPG. You do not install pinentry separately. Installing GnuPG via Chocolatey or winget automatically includes pinentry-basic.exe.
572
+
573
+ If Chocolatey is not installed and you prefer to use it, install it first by running this command in an Administrator PowerShell:
574
+
575
+ ```powershell
576
+ Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
577
+ ```
578
+
579
+ #### Installation Steps
580
+
581
+ **Using winget (recommended):**
582
+
583
+ Run the following command in an Administrator PowerShell or Command Prompt:
584
+
585
+ ```powershell
586
+ winget install --id GnuPG.GnuPG --silent --accept-package-agreements --accept-source-agreements
587
+ ```
588
+
589
+ **Using Chocolatey:**
590
+
591
+ ```powershell
592
+ choco install gnupg -y
593
+ ```
594
+
595
+ The `--silent` flag (winget) and `-y` flag (Chocolatey) ensure non-interactive installation suitable for automation and scripts.
596
+
597
+ After installation, close and reopen your terminal to ensure PATH changes take effect.
598
+
599
+ **Pinentry executables included:**
600
+
601
+ The GnuPG installation includes:
602
+
603
+ - `pinentry-basic.exe` - Simple Windows dialog (always included)
604
+ - `pinentry-qt.exe` - Qt-based GUI dialog (included with Gpg4win full installation)
605
+
606
+ The default installation uses pinentry-basic.exe, which displays a simple Windows dialog for passphrase entry.
607
+
608
+ #### Verification
609
+
610
+ Open a new Command Prompt or PowerShell window, then run:
611
+
612
+ ```powershell
613
+ where pinentry-basic
614
+ ```
615
+
616
+ Expected output:
617
+
618
+ ```
619
+ C:\Program Files (x86)\GnuPG\bin\pinentry-basic.exe
620
+ ```
621
+
622
+ Verify GPG is configured to use pinentry:
623
+
624
+ ```powershell
625
+ gpg-connect-agent "getinfo pid" /bye
626
+ ```
627
+
628
+ This should return a process ID, confirming the GPG agent is running with pinentry support.
629
+
630
+ #### Troubleshooting
631
+
632
+ **Problem**: `pinentry-basic: command not found` or `'pinentry-basic' is not recognized`
633
+
634
+ **Solution**: Close and reopen your terminal window. If the problem persists, add GPG to your PATH manually:
635
+
636
+ ```powershell
637
+ $env:PATH += ";C:\Program Files (x86)\GnuPG\bin"
638
+ ```
639
+
640
+ To make this permanent, run in Administrator PowerShell:
641
+
642
+ ```powershell
643
+ [Environment]::SetEnvironmentVariable("PATH", $env:PATH + ";C:\Program Files (x86)\GnuPG\bin", [EnvironmentVariableTarget]::Machine)
644
+ ```
645
+
646
+ **Problem**: Passphrase dialog does not appear
647
+
648
+ **Solution**: Ensure the GPG agent is running:
649
+
650
+ ```powershell
651
+ gpg-connect-agent /bye
652
+ ```
653
+
654
+ **Problem**: Want to use Qt-based pinentry instead of basic
655
+
656
+ **Solution**: Install Gpg4win for the full suite including pinentry-qt:
657
+
658
+ ```powershell
659
+ choco install gpg4win -y
660
+ ```
661
+
662
+ Then configure GPG to use pinentry-qt:
663
+
664
+ ```powershell
665
+ echo pinentry-program "C:\Program Files (x86)\Gpg4win\bin\pinentry-qt.exe" >> %APPDATA%\gnupg\gpg-agent.conf
666
+ gpg-connect-agent reloadagent /bye
667
+ ```
668
+
669
+ **Problem**: Chocolatey or winget installation fails
670
+
671
+ **Solution**: Ensure you are running PowerShell as Administrator. Right-click PowerShell and select "Run as administrator".
672
+
673
+ ---
674
+
675
+ ### WSL (Ubuntu)
676
+
677
+ #### Prerequisites
678
+
679
+ - Windows 10 version 2004 or higher, or Windows 11
680
+ - WSL 2 enabled with Ubuntu distribution installed
681
+ - sudo privileges within WSL
682
+ - GnuPG installed within WSL
683
+
684
+ WSL runs Ubuntu (or another Linux distribution) within Windows. Pinentry must be installed separately within WSL, as it does not share binaries with Windows.
685
+
686
+ #### Installation Steps
687
+
688
+ Open your WSL Ubuntu terminal and run:
689
+
690
+ **For terminal-only WSL usage (most common):**
691
+
692
+ ```bash
693
+ sudo DEBIAN_FRONTEND=noninteractive apt-get update -y
694
+ sudo DEBIAN_FRONTEND=noninteractive apt-get install -y pinentry-curses
695
+ ```
696
+
697
+ **For WSL with GUI support (WSLg):**
698
+
699
+ ```bash
700
+ sudo DEBIAN_FRONTEND=noninteractive apt-get update -y
701
+ sudo DEBIAN_FRONTEND=noninteractive apt-get install -y pinentry-gnome3
702
+ ```
703
+
704
+ **Configure GPG to use pinentry-curses:**
705
+
706
+ ```bash
707
+ mkdir -p ~/.gnupg
708
+ chmod 700 ~/.gnupg
709
+ echo "pinentry-program /usr/bin/pinentry-curses" > ~/.gnupg/gpg-agent.conf
710
+ gpgconf --kill gpg-agent
711
+ ```
712
+
713
+ **Set GPG_TTY for proper terminal detection:**
714
+
715
+ ```bash
716
+ echo 'export GPG_TTY=$(tty)' >> ~/.bashrc
717
+ source ~/.bashrc
718
+ ```
719
+
720
+ #### Verification
721
+
722
+ Confirm the installation succeeded:
723
+
724
+ ```bash
725
+ pinentry --version
726
+ ```
727
+
728
+ Expected output (version numbers may vary):
729
+
730
+ ```
731
+ pinentry-curses (pinentry) 1.3.1
732
+ ```
733
+
734
+ Verify the installation location:
735
+
736
+ ```bash
737
+ which pinentry
738
+ ```
739
+
740
+ Expected output:
741
+
742
+ ```
743
+ /usr/bin/pinentry
744
+ ```
745
+
746
+ Test pinentry by signing a test message:
747
+
748
+ ```bash
749
+ echo "test" | gpg --clearsign
750
+ ```
751
+
752
+ A pinentry dialog should appear in your terminal.
753
+
754
+ #### Troubleshooting
755
+
756
+ **Problem**: "No pinentry" error in WSL
757
+
758
+ **Solution**: Ensure pinentry is installed and configured:
759
+
760
+ ```bash
761
+ sudo DEBIAN_FRONTEND=noninteractive apt-get install -y pinentry-curses
762
+ mkdir -p ~/.gnupg
763
+ echo "pinentry-program /usr/bin/pinentry-curses" > ~/.gnupg/gpg-agent.conf
764
+ gpgconf --kill gpg-agent
765
+ ```
766
+
767
+ **Problem**: "Inappropriate ioctl for device" error
768
+
769
+ **Solution**: Set the GPG_TTY environment variable:
770
+
771
+ ```bash
772
+ export GPG_TTY=$(tty)
773
+ ```
774
+
775
+ Add to your shell profile for persistence:
776
+
777
+ ```bash
778
+ echo 'export GPG_TTY=$(tty)' >> ~/.bashrc
779
+ ```
780
+
781
+ **Problem**: Pinentry hangs in VS Code terminal
782
+
783
+ **Solution**: VS Code's integrated terminal may not properly allocate a TTY. Use pinentry-curses and ensure GPG_TTY is set. Alternatively, use an external terminal for GPG operations.
784
+
785
+ **Problem**: Want to use Windows pinentry from WSL
786
+
787
+ **Solution**: You can configure WSL GPG to use the Windows pinentry. Edit `~/.gnupg/gpg-agent.conf`:
788
+
789
+ ```bash
790
+ mkdir -p ~/.gnupg
791
+ echo 'pinentry-program "/mnt/c/Program Files (x86)/GnuPG/bin/pinentry-basic.exe"' > ~/.gnupg/gpg-agent.conf
792
+ gpgconf --kill gpg-agent
793
+ ```
794
+
795
+ **Problem**: Permission errors in WSL
796
+
797
+ **Solution**: Ensure you are using sudo for installation:
798
+
799
+ ```bash
800
+ sudo DEBIAN_FRONTEND=noninteractive apt-get install -y pinentry-curses
801
+ ```
802
+
803
+ ---
804
+
805
+ ### Git Bash (Windows Installation)
806
+
807
+ #### Prerequisites
808
+
809
+ - Windows 10 or Windows 11 (64-bit)
810
+ - Git Bash installed (comes with Git for Windows)
811
+ - GnuPG installed on Windows (see Windows section)
812
+
813
+ **Note**: Git Bash on Windows does not include a usable pinentry installation. Git for Windows ships with an older GPG 1.4.x in the MinGW environment, which is insufficient for modern use cases. You must install GnuPG on Windows separately, which includes pinentry.
814
+
815
+ #### Installation Steps
816
+
817
+ **Step 1: Install GnuPG on Windows**
818
+
819
+ First, install GnuPG on Windows using winget (run in Administrator PowerShell):
820
+
821
+ ```powershell
822
+ winget install --id GnuPG.GnuPG --silent --accept-package-agreements --accept-source-agreements
823
+ ```
824
+
825
+ Or using Chocolatey:
826
+
827
+ ```powershell
828
+ choco install gnupg -y
829
+ ```
830
+
831
+ **Step 2: Configure Git to use Windows GPG**
832
+
833
+ Open Git Bash and configure Git to use the Windows GPG installation (which includes pinentry):
834
+
835
+ ```bash
836
+ git config --global gpg.program "/c/Program Files (x86)/GnuPG/bin/gpg.exe"
837
+ ```
838
+
839
+ **Step 3: Set GPG_TTY for terminal operations**
840
+
841
+ Add to your `~/.bashrc`:
842
+
843
+ ```bash
844
+ echo 'export GPG_TTY=$(tty)' >> ~/.bashrc
845
+ source ~/.bashrc
846
+ ```
847
+
848
+ **Step 4: Close and reopen Git Bash**
849
+
850
+ Close all Git Bash windows and open a new one to ensure environment changes take effect.
851
+
852
+ #### Verification
853
+
854
+ In Git Bash, verify the Windows pinentry is accessible:
855
+
856
+ ```bash
857
+ "/c/Program Files (x86)/GnuPG/bin/pinentry-basic.exe" --version
858
+ ```
859
+
860
+ Expected output (version numbers may vary):
861
+
862
+ ```
863
+ pinentry-basic (pinentry) 1.3.1
864
+ ```
865
+
866
+ Verify Git is configured to use Windows GPG:
867
+
868
+ ```bash
869
+ git config --global gpg.program
870
+ ```
871
+
872
+ Expected output:
873
+
874
+ ```
875
+ /c/Program Files (x86)/GnuPG/bin/gpg.exe
876
+ ```
877
+
878
+ Test GPG signing (pinentry dialog should appear):
879
+
880
+ ```bash
881
+ echo "test" | "/c/Program Files (x86)/GnuPG/bin/gpg.exe" --clearsign
882
+ ```
883
+
884
+ #### Troubleshooting
885
+
886
+ **Problem**: `pinentry` command in Git Bash uses old version or not found
887
+
888
+ **Solution**: Git Bash's MinGW environment does not include modern pinentry. Use the Windows installation directly:
889
+
890
+ ```bash
891
+ "/c/Program Files (x86)/GnuPG/bin/pinentry-basic.exe" --version
892
+ ```
893
+
894
+ **Problem**: Git commit signing fails with "no pinentry"
895
+
896
+ **Solution**: Ensure Git is configured to use Windows GPG:
897
+
898
+ ```bash
899
+ git config --global gpg.program "/c/Program Files (x86)/GnuPG/bin/gpg.exe"
900
+ ```
901
+
902
+ **Problem**: Pinentry window appears behind other windows
903
+
904
+ **Solution**: This is a known Windows issue. The pinentry window may appear in the taskbar. Click on it to bring it to the foreground.
905
+
906
+ **Problem**: "gpg: signing failed: Inappropriate ioctl for device"
907
+
908
+ **Solution**: Set the GPG_TTY environment variable:
909
+
910
+ ```bash
911
+ echo 'export GPG_TTY=$(tty)' >> ~/.bashrc
912
+ source ~/.bashrc
913
+ ```
914
+
915
+ **Problem**: Path issues with spaces in "Program Files (x86)"
916
+
917
+ **Solution**: Always quote paths or escape spaces when referencing the pinentry executable:
918
+
919
+ ```bash
920
+ # Using quotes
921
+ "/c/Program Files (x86)/GnuPG/bin/pinentry-basic.exe" --version
922
+
923
+ # Or escaping spaces
924
+ /c/Program\ Files\ \(x86\)/GnuPG/bin/pinentry-basic.exe --version
925
+ ```
926
+
927
+ ---
928
+
929
+ ## Post-Installation Configuration
930
+
931
+ After installing pinentry on any platform, perform these configuration steps to ensure proper integration with GPG.
932
+
933
+ ### Configure GPG Agent to Use Pinentry
934
+
935
+ Create or edit the GPG agent configuration file to specify your pinentry program:
936
+
937
+ **macOS:**
938
+
939
+ ```bash
940
+ mkdir -p ~/.gnupg
941
+ echo "pinentry-program $(brew --prefix)/bin/pinentry-mac" > ~/.gnupg/gpg-agent.conf
942
+ ```
943
+
944
+ **Linux (Ubuntu/Debian/Raspberry Pi/Amazon Linux):**
945
+
946
+ ```bash
947
+ mkdir -p ~/.gnupg
948
+ echo "pinentry-program /usr/bin/pinentry-curses" > ~/.gnupg/gpg-agent.conf
949
+ ```
950
+
951
+ For GUI environments, replace `pinentry-curses` with `pinentry-gnome3` or `pinentry-qt`.
952
+
953
+ **Windows:**
954
+
955
+ ```powershell
956
+ echo pinentry-program "C:\Program Files (x86)\GnuPG\bin\pinentry-basic.exe" >> %APPDATA%\gnupg\gpg-agent.conf
957
+ ```
958
+
959
+ ### Restart GPG Agent
960
+
961
+ After changing the configuration, restart the GPG agent:
962
+
963
+ ```bash
964
+ gpgconf --kill gpg-agent
965
+ ```
966
+
967
+ The agent will automatically restart when needed.
968
+
969
+ ### Set GPG_TTY Environment Variable
970
+
971
+ For terminal-based pinentry programs to work correctly, especially over SSH, set the `GPG_TTY` variable:
972
+
973
+ **Bash (Linux/macOS/Git Bash):**
974
+
975
+ ```bash
976
+ echo 'export GPG_TTY=$(tty)' >> ~/.bashrc
977
+ source ~/.bashrc
978
+ ```
979
+
980
+ **Zsh (macOS default):**
981
+
982
+ ```bash
983
+ echo 'export GPG_TTY=$(tty)' >> ~/.zshrc
984
+ source ~/.zshrc
985
+ ```
986
+
987
+ ### Configure Passphrase Caching
988
+
989
+ To reduce the frequency of passphrase prompts, configure the GPG agent cache timeout:
990
+
991
+ ```bash
992
+ cat >> ~/.gnupg/gpg-agent.conf << 'EOF'
993
+ default-cache-ttl 3600
994
+ max-cache-ttl 86400
995
+ EOF
996
+ gpgconf --kill gpg-agent
997
+ ```
998
+
999
+ This caches your passphrase for 1 hour (3600 seconds), with a maximum of 24 hours (86400 seconds).
1000
+
1001
+ ### Enable Keychain Integration (macOS)
1002
+
1003
+ On macOS, pinentry-mac can store passphrases in the macOS Keychain. To enable this feature, check "Save in Keychain" when the pinentry dialog appears, or add to `~/.gnupg/gpg-agent.conf`:
1004
+
1005
+ ```bash
1006
+ allow-preset-passphrase
1007
+ ```
1008
+
1009
+ ---
1010
+
1011
+ ## Common Issues
1012
+
1013
+ ### Issue: "No pinentry" Error
1014
+
1015
+ **Symptoms**: `gpg: problem with the agent: No pinentry`
1016
+
1017
+ **Solutions**:
1018
+
1019
+ - Install pinentry for your platform:
1020
+
1021
+ ```bash
1022
+ # macOS
1023
+ brew install --quiet pinentry-mac
1024
+
1025
+ # Ubuntu/Debian/Raspberry Pi
1026
+ sudo DEBIAN_FRONTEND=noninteractive apt-get install -y pinentry-curses
1027
+
1028
+ # Amazon Linux 2023
1029
+ sudo dnf install -y pinentry
1030
+
1031
+ # Amazon Linux 2
1032
+ sudo yum install -y pinentry
1033
+ ```
1034
+
1035
+ - Configure GPG agent to use the correct pinentry:
1036
+
1037
+ ```bash
1038
+ mkdir -p ~/.gnupg
1039
+ echo "pinentry-program /path/to/pinentry" > ~/.gnupg/gpg-agent.conf
1040
+ gpgconf --kill gpg-agent
1041
+ ```
1042
+
1043
+ ### Issue: "Inappropriate ioctl for device"
1044
+
1045
+ **Symptoms**: `gpg: signing failed: Inappropriate ioctl for device`
1046
+
1047
+ **Solutions**:
1048
+
1049
+ - Set the GPG_TTY environment variable:
1050
+
1051
+ ```bash
1052
+ export GPG_TTY=$(tty)
1053
+ ```
1054
+
1055
+ - Add to your shell profile (`~/.bashrc`, `~/.zshrc`):
1056
+
1057
+ ```bash
1058
+ echo 'export GPG_TTY=$(tty)' >> ~/.bashrc
1059
+ ```
1060
+
1061
+ ### Issue: Passphrase Dialog Not Appearing
1062
+
1063
+ **Symptoms**: GPG hangs waiting for passphrase, or fails immediately
1064
+
1065
+ **Solutions**:
1066
+
1067
+ - **macOS**: Ensure pinentry-mac is installed and configured:
1068
+
1069
+ ```bash
1070
+ brew install --quiet pinentry-mac
1071
+ echo "pinentry-program $(brew --prefix)/bin/pinentry-mac" > ~/.gnupg/gpg-agent.conf
1072
+ gpgconf --kill gpg-agent
1073
+ ```
1074
+
1075
+ - **Linux**: Ensure appropriate pinentry is installed:
1076
+
1077
+ ```bash
1078
+ sudo DEBIAN_FRONTEND=noninteractive apt-get install -y pinentry-curses
1079
+ ```
1080
+
1081
+ - Restart the GPG agent:
1082
+
1083
+ ```bash
1084
+ gpgconf --kill gpg-agent
1085
+ ```
1086
+
1087
+ ### Issue: Pinentry Dialog Appears Behind Other Windows
1088
+
1089
+ **Symptoms**: Pinentry prompt is hidden behind other application windows
1090
+
1091
+ **Solutions**:
1092
+
1093
+ - **Windows**: Check the taskbar for the pinentry window and click to bring it forward
1094
+ - **Linux (GNOME)**: Use pinentry-gnome3 which integrates better with the window manager
1095
+ - **macOS**: pinentry-mac should raise to the foreground; restart the GPG agent if this fails
1096
+
1097
+ ### Issue: Pinentry Hangs Over SSH
1098
+
1099
+ **Symptoms**: GPG operations hang when connected via SSH
1100
+
1101
+ **Solutions**:
1102
+
1103
+ - Use `pinentry-curses` or `pinentry-tty` (not GUI versions)
1104
+ - Ensure `GPG_TTY` is set:
1105
+
1106
+ ```bash
1107
+ export GPG_TTY=$(tty)
1108
+ ```
1109
+
1110
+ - Verify SSH is allocating a TTY (use `ssh -t` if needed)
1111
+
1112
+ ### Issue: Multiple Pinentry Programs Installed
1113
+
1114
+ **Symptoms**: Wrong pinentry program is used, or inconsistent behavior
1115
+
1116
+ **Solutions**:
1117
+
1118
+ - **Debian/Ubuntu**: Use `update-alternatives` to set the default:
1119
+
1120
+ ```bash
1121
+ sudo update-alternatives --config pinentry
1122
+ ```
1123
+
1124
+ - Explicitly configure pinentry in `~/.gnupg/gpg-agent.conf`:
1125
+
1126
+ ```bash
1127
+ pinentry-program /usr/bin/pinentry-curses
1128
+ ```
1129
+
1130
+ ---
1131
+
1132
+ ## References
1133
+
1134
+ - [GnuPG Pinentry Official Page](https://www.gnupg.org/related_software/pinentry/index.html)
1135
+ - [GnuPG Official Documentation](https://gnupg.org/documentation/)
1136
+ - [Homebrew pinentry-mac Formula](https://formulae.brew.sh/formula/pinentry-mac)
1137
+ - [Debian Pinentry Package Information](https://packages.debian.org/source/stable/pinentry)
1138
+ - [Ubuntu Pinentry Package](https://launchpad.net/ubuntu/+source/pinentry)
1139
+ - [Chocolatey GnuPG Package](https://community.chocolatey.org/packages/gnupg)
1140
+ - [winget GnuPG Package](https://winget.run/pkg/GnuPG/GnuPG)
1141
+ - [GitHub: Signing Git Commits](https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits)
1142
+ - [GPG Pinentry GitHub Repository](https://github.com/gpg/pinentry)