1

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.

Edit;

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

4
  • What reason is indicated in the log file?
    – Ramhound
    Commented Apr 26, 2019 at 21:08
  • I have edited the question Commented Apr 26, 2019 at 22:28
  • You are doing this as an Administrator, and have elevated the process, the errors indicate a permission issue.
    – Ramhound
    Commented Apr 26, 2019 at 22:29
  • I get the same error regardless if i am running the choco command on an elevated session or not. Commented Apr 26, 2019 at 22:41

1 Answer 1

1

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .