Enter the original password, but press enter 3 times instead of just once (original password, new password, then confirming new password).
The problem was pinentry itself, so loopback mode just removes it from the equation. This should work with all versions of gpg AFAIK.
With pinentry-0.8.1 (and gnupg2-2.0.22) on Centos 7 I was able to remove the passphrase from the secret key by not specifying a new password; pinentry did whine and warn about the blank password but both the console and GTK pinentry programs had a "Take this one anyway" prompt that resulted in a password-free secret key.
On the other hand, this attempt failed as the then imported secret key is marked as unusable:
gpg --export-options export-reset-subkey-passwd --export-secret-subkeys > x
I was able to do this using Kleopatra.
In the application right-click on the keypair you want to remove the passphrase from.
Click Change passphrase.... Enter the passphrase in the pop up window. In the next pop up window leave both
inputs empty and click Ok. click the option similar to Yes, protection is not needed. These last two pop ups may show up a couple times as confirmation. Just leave the inputs for new passphrase blank and click Ok. Then you will receive a confirmation that "The passphrase has been successfully reset".
default-cache-ttlto 31536000 (365 days). Then "seed" the agent with a command similar to
echo | gpg -sa -u <keyid> >/dev/null. A separate script could launch, source the environment file created when starting the agent, then sign a file. In the script, execute
--batchmode and it should return an error if a password is required. Send an alert if that happens. I do a few things like this utilizing ssh and gpg agents.