Page 1 of 1

apt-key is deprecated

Posted: Mon Feb 15, 2021 7:07 pm
by algospark
Please can someone help? I'm looking to download openvpn for linux. Using Kali and know that it is preinstalled but learning from a site for a cert uses in-house labs with openvpn. The download link for the openvpn in this lab presents a file that only shows up as a text file and will not start as a form of working software so i come on this site to download and ensure i have the right tools to work the openvpn and find some instructions to enable as follows:

The first instruction given says to ensure that your apt supports the https transport by typing the command:
''apt install apt-transport-https''

but the terminal returns:
''E: Could not open lock file /var/lib/dpkg/lock-frontend - open (13: Permission denied)
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), are you root?''

The next instruction works and have managed to save the key with the following result:

wget ...
--2021-02-15 17:38:08-- ...
Resolving (,
Connecting to (||:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3165 (3.1K) [binary/octet-stream]
Saving to: ‘’

openvpn-repo-pkg-k 100%[===============>] 3.09K --.-KB/s in 0s

2021-02-15 17:38:09 (7.26 MB/s) - ‘’ saved [3165/3165]

However the next instruction which is:
apt-key add

gives the following result:
Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).
E: This command can only be used by root.

Can someone advise?