1

When i Install the OpenVPN repository key used by the OpenVPN 3 Linux packages

when i try running this command: curl -fsSL https://swupdate.openvpn.net/repos/openvpn-repo-pkg-key.pub | gpg --dearmor > /etc/apt/trusted.gpg.d/openvpn-repo-pkg-keyring.gpg

I get the following error: bash: /etc/apt/trusted.gpg.d/openvpn-repo-pkg-keyring.gpg: Permission denied (23) Failed writing body

Bob Fish
  • 11
  • 1
  • 1
    The redirect and not using sudo is breaking it. Use `curl -fsSL https://swupdate.openvpn.net/repos/openvpn-repo-pkg-key.pub | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/openvpn-repo-pkg-keyring.gpg` – Terrance Dec 23 '22 at 21:56

1 Answers1

0

"Permission denied (23) Failed writing body" is the computer's way of telling you that it can't write to that file because you did not give it permission with sudo. That file is part of the system and you need to use sudo. like this: sudo curl -fsSL https://swupdate.openvpn.net/repos/openvpn-repo-pkg-key.pub | gpg --dearmor > /etc/apt/trusted.gpg.d/openvpn-repo-pkg-keyring.gpg

Gerge
  • 59
  • 4
  • Right idea - but it's the user's shell that's trying to write the file, not the `curl` command. See for example [How to solve "permission denied" when using sudo with redirection in Bash?](https://askubuntu.com/questions/230476/how-to-solve-permission-denied-when-using-sudo-with-redirection-in-bash) – steeldriver Dec 23 '22 at 21:56