GNU Privacy Guard starts a gpg-agent that may very well access the keys in its home directory. Therefore, when we try to clean them up, that agent may still be running and the files cannot be deleted. This is exactly what happened yesterday when deploying libfido2:
▸Run rm -rf "$HOME"
rm: cannot remove '/d/a/_temp/home/.gnupg/public-keys.d/pubring.db': Device or resource busy
Error: Process completed with exit code 1.
Let's specifically stop the gpg-agent before removing the home directory to work around this issue.
GNU Privacy Guard starts a
gpg-agent
that may very well access the keys in its home directory. Therefore, when we try to clean them up, that agent may still be running and the files cannot be deleted. This is exactly what happened yesterday when deploying libfido2:Let's specifically stop the
gpg-agent
before removing the home directory to work around this issue.