This is an old revision of the document!


В Ubuntu 22.04 и свежих Debian теперь считается устаревшей (deprecated) утилита apt-key и скоро она будет выпилена.
Чтобы не получать сообщения вида:

The following signatures couldn't be verified because the public key is not available: NO_PUBKEY C6ABDC...
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: .....

и

Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead

Еужно добавлять ключи в /etc/apt/trusted.gpg.d/, при этом сделав над ними

gpg --dearmor

примерно так:

sudo apt-get update
sudo apt install gnupg2 wget ca-certificates lsb-release software-properties-common
gpg_key_url="https://packagecloud.io/slacktechnologies/slack/gpgkey"
gpg_keyring_path="/etc/apt/trusted.gpg.d/slack-keyring.gpg"
curl -fsSL "${gpg_key_url}" | gpg --dearmor | sudo tee -a ${gpg_keyring_path}
sudo apt-get clean
sudo apt-get update

При этом, в Ubuntu 22.04 добавление pgp-файла в /usr/share/keyrings/ не решало проблему. Добавлять файл нужно в /etc/apt/trusted.gpg.d/

Либо, пока не свосем выпилили apt-key:

wget -q -O - http://deb.opera.com/archive.key | sudo apt-key --keyring /etc/apt/trusted.gpg.d/Opera.gpg add -
Enter your comment. Wiki syntax is allowed:
 
  • linux_faq/apt-key_is_deprecated_how_to_add.1649411992.txt
  • Last modified: 2022/04/08 09:59
  • by admin