root@VM-4-9-debian:~# wget -qO - https://www.mongodb.org/static/pgp/server-4.2.asc | sudo apt -key add - E: gnupg, gnupg2 and gnupg1 do not seem to be installed, but one of them is required for this operation
gnupg
提示gnupg没安装,
root@VM-4-9-debian:~# sudo apt-get install gnupg
创建列表文件
root@VM-4-9-debian:~# echo "deb http://repo.mongodb.org/apt/debian buster/mongodb-org/4.2 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.2.list deb http://repo.mongodb.org/apt/debian buster/mongodb-org/4.2 main root@VM-4-9-debian:~# sudo apt-get update Hit:1 http://mirrors.tencentyun.com/debian bookworm InRelease Get:2 http://mirrors.tencentyun.com/debian bookworm-updates InRelease [52.1 kB] Get:3 http://mirrors.tencentyun.com/debian-security bookworm-security InRelease [48.0 kB] Get:4 http://mirrors.tencentyun.com/debian-security bookworm-security/main amd64 Packages [135 kB] Get:5 http://mirrors.tencentyun.com/debian-security bookworm-security/main Translation-en [80.3 kB] Ign:6 http://repo.mongodb.org/apt/debian buster/mongodb-org/4.2 InRelease Get:7 http://repo.mongodb.org/apt/debian buster/mongodb-org/4.2 Release [1,118 B] Get:8 http://repo.mongodb.org/apt/debian buster/mongodb-org/4.2 Release.gpg [866 B] Get:9 http://repo.mongodb.org/apt/debian buster/mongodb-org/4.2/main amd64 Packages [24.1 kB] Fetched 341 kB in 4s (97.1 kB/s) Reading package lists... Done W: http://repo.mongodb.org/apt/debian/dists/buster/mongodb-org/4.2/Release.gpg: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.