Why am I getting permission denied with usr/share/keyrings even with sudo?

I am trying to install the most recent 3.0 version of OpenVPN.
(LINK)

Here is where I get stuck:

sudo curl -fsSL https://swupdate.openvpn.net/packages-repo.gpg >/etc/apt/keyrings/openvpn.asc
bash: /etc/apt/keyrings/openvpn.asc: Permission denied

Here is some relevant information about this, but its still over my head:
(LINK)

You are actually running two actions here. The curl command to download the GPG key, and the output redirection to a file. Only the first one is being run with sudo privileges. The correct sequence would be something like this. Note that this

curl -fsSL https://swupdate.openvpn.net/packages-repo.gpg | sudo tee /etc/apt/keyrings/openvpn.asc
3 Likes

Thank you, that solved the problem.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.