2

As the title describes, choco install openvpn returns the below error;

ERROR: Unable to import PGP key 'C:\ProgramData\chocolatey\lib\openvpn\tools\openvpn_public_key.asc' in the temporary keyring (C:\ProgramData\chocolatey\lib\openvpn\tools\e090a0df-7709-xxxx-xxxx-xxxxxxxxxxxx\pubring.gpg).
The install of openvpn was NOT successful.
Error while running 'C:\ProgramData\chocolatey\lib\openvpn\tools\chocolateyInstall.ps1'.
 See log for details.


Failures
 - openvpn (exited -1) - Error while running 'C:\ProgramData\chocolatey\lib\openvpn\tools\chocolateyInstall.ps1'.
 See log for details.

I am using a Windows 10, v1803 machine.

Below is the part of the log that shows the complete traced error;

[DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\.chocolatey\openvpn.2.4.7\.arguments".
[DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\.chocolatey\openvpn.2.4.7\.extra".
[DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\.chocolatey\openvpn.2.4.7\.version".
[DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\.chocolatey\openvpn.2.4.7\.sxs".
[DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\.chocolatey\openvpn.2.4.7\.pin".
[DEBUG] - Attempting to delete directory "C:\ProgramData\chocolatey\lib-bad\openvpn".
[DEBUG] - Sending message 'HandlePackageResultCompletedMessage' out if there are subscribers...
[ERROR] - The install of openvpn was NOT successful.
[ERROR] - Error while running 'C:\ProgramData\chocolatey\lib\openvpn\tools\chocolateyInstall.ps1'.
 See log for details.
[DEBUG] - Moving 'C:\ProgramData\chocolatey\lib\openvpn'
 to 'C:\ProgramData\chocolatey\lib-bad\openvpn'
[DEBUG] - Attempting to delete file "C:\Users\XXX\AppData\Local\NuGet\Cache\openvpn.2.4.7.nupkg".
[WARN ] - 
Chocolatey installed 0/1 packages. 1 packages failed.
 See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
[INFO ] - 
[ERROR] - Failures
[ERROR] -  - openvpn (exited -1) - Error while running 'C:\ProgramData\chocolatey\lib\openvpn\tools\chocolateyInstall.ps1'.
 See log for details.
[DEBUG] - Sending message 'PostRunMessage' out if there are subscribers...
[DEBUG] - Exiting with -1
Arduino_Sentinel
  • 819
  • 11
  • 21

1 Answers1

2

I found out the solution which is disabling the git PATH used where as it puts the version of gpg.exe shipped with git ahead of the one from openvpn package on my environment variables.

This could be done in two ways;

The first is editing the environment PATH variables and moving git PATH below the C:\Program Files (x86)\GNU\GnuPG\pub PATH, see the picture below. enter image description here

The second is removing/deleting the git PATH variables then start a new powershell session, run choco install openvpn then returning the git PATH back to the env variables.

In my case, the fist option worked just fine.

Arduino_Sentinel
  • 819
  • 11
  • 21