os:linux:apt
This is an old revision of the document!
Linux - APT
apt-key Deprecation
According to the DEPRECATION section of the apt-key man page:
Except for using apt-key del in maintainer scripts, the use of apt-key is deprecated. This section shows how to replace existing use of apt-key.
The man page contains some hints and an example how to convert command snippets with apt-key to a supported command.
Deprecated:
wget -qO- https://myrepo.example/myrepo.asc | sudo apt-key add -
Supported replacement:
wget -qO- https://myrepo.example/myrepo.asc | sudo tee /etc/apt/trusted.gpg.d/myrepo.asc
Recommended replacement:
wget -qO- https://myrepo.example/myrepo.asc | sudo tee /etc/apt/keyrings/myrepo.asc deb [signed-by=/etc/apt/keyrings/myrepo.asc arch=amd64] https://myrepo.example/debian main
root@raspi1:~# apt update Hit:1 http://raspbian.raspberrypi.org/raspbian bookworm InRelease Hit:2 http://archive.raspberrypi.org/debian bookworm InRelease Hit:3 https://apt.releases.teleport.dev/debian bookworm InRelease Hit:4 https://repo.zabbix.com/zabbix/7.0/raspbian bookworm InRelease Reading package lists... Done Building dependency tree... Done Reading state information... Done All packages are up to date. W: http://raspbian.raspberrypi.org/raspbian/dists/bookworm/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details. W: http://archive.raspberrypi.org/debian/dists/bookworm/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details. N: Skipping acquire of configured file 'main/binary-armhf/Packages' as repository 'https://repo.zabbix.com/zabbix/7.0/raspbian bookworm InRelease' doesn't support architecture 'armhf' wget -qO- http://raspbian.raspberrypi.org/raspbian.public.key | sudo tee /etc/apt/trusted.gpg.d/raspbian-raspberrypi.asc root@raspi1:~# apt update Hit:1 http://raspbian.raspberrypi.org/raspbian bookworm InRelease Hit:2 http://archive.raspberrypi.org/debian bookworm InRelease Hit:3 https://apt.releases.teleport.dev/debian bookworm InRelease Hit:4 https://repo.zabbix.com/zabbix/7.0/raspbian bookworm InRelease Reading package lists... Done Building dependency tree... Done Reading state information... Done All packages are up to date. W: http://archive.raspberrypi.org/debian/dists/bookworm/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details. N: Skipping acquire of configured file 'main/binary-armhf/Packages' as repository 'https://repo.zabbix.com/zabbix/7.0/raspbian bookworm InRelease' doesn't support architecture 'armhf' W: http://archive.raspberrypi.org/debian/dists/bookworm/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details. wget -qO- http://archive.raspberrypi.org/debian/raspberrypi.gpg.key | sudo tee /etc/apt/trusted.gpg.d/archive-raspberrypi.asc
os/linux/apt.1717585338.txt.gz · Last modified: 2024-06-05 13:02 by Manuel Frei