我尝试过“sudo apt-get update”和“sudo apt-get install mongodb”,但都没有用。
我想要在 Ubuntu 上成功安装 mongodb。
环境:Ubuntu 版本 22.04.1
我已完成以下步骤:
sudo apt-get install mongodb
不工作,- 我用了
sudo apt-get update
还是没用
我已经删除了一些Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY F60F4B3D7FA2AF80
我按照网上的解决方案操作,但仍然无法在 Ubuntu 上下载 mongodb
E:软件包‘mongodb’没有安装候选项
sudo apt update 的结果
Hit:1 https://dl.google.com/linux/chrome/deb stable InRelease
Hit:2 http://packages.microsoft.com/repos/code stable InRelease
Hit:3 http://tw.archive.ubuntu.com/ubuntu jammy InRelease
Hit:4 http://tw.archive.ubuntu.com/ubuntu jammy-updates InRelease
Hit:5 http://tw.archive.ubuntu.com/ubuntu jammy-backports InRelease
Ign:6 http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 InRelease
Ign:7 https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 InRelease
Hit:8 http://security.ubuntu.com/ubuntu jammy-security InRelease
Ign:9 http://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.2 InRelease
Ign:10 https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.6 InRelease
Ign:11 https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.4 InRelease
Ign:12 https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/5.0 InRelease
Hit:13 http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 Release
Ign:14 http://security.ubuntu.com/ubuntu impish-security InRelease
Ign:15 https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/6.0 InRelease
Hit:17 http://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.2 Release
Hit:18 https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 Release
Err:19 http://security.ubuntu.com/ubuntu impish-security Release
404 Not Found [IP: 185.125.190.36 80]
Hit:22 https://ppa.launchpadcontent.net/deadsnakes/ppa/ubuntu jammy InRelease
Hit:23 https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.6 Release
Hit:25 https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.4 Release
Get:27 https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/5.0 Release [4412 B]
Hit:28 https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/6.0 Release
Get:30 https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/5.0 Release.gpg [801 B]
Get:31 https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/5.0/multiverse arm64 Packages [19.4 kB]
Err:31 https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/5.0/multiverse arm64 Packages
File has unexpected size (19137 != 19448). Mirror sync in progress? [IP: 13.35.7.3 443]
Hashes of expected file:
- Filesize:19448 [weak]
- SHA512:b0a2d095c3d35504017887747c391ef873c6e69cfd075c216a500899581a742527ea20896e75daa434c8e202d7d986b35614efc4e63691ddb4d8925c34c68476
- SHA256:bd21ce311d4047515a1a025f93b8d0eaea7a45696f681c5c18a3d8d5f82142a3
- SHA1:9f870bfdb9aeab6c27ab1ea47b7115d6cabf0250 [weak]
- MD5Sum:5d9a44e2363a54bfbb2bfba822bdfe0b [weak]
Release file created at: Thu, 13 Oct 2022 10:56:48 +0000
Reading package lists... Done
W: http://repo.mongodb.org/apt/ubuntu/dists/xenial/mongodb-org/3.4/Release.gpg: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
E: The repository 'http://security.ubuntu.com/ubuntu impish-security Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: http://repo.mongodb.org/apt/ubuntu/dists/bionic/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.
W: https://repo.mongodb.org/apt/ubuntu/dists/focal/mongodb-org/4.4/Release.gpg: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
W: https://repo.mongodb.org/apt/ubuntu/dists/xenial/mongodb-org/3.6/Release.gpg: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
W: https://repo.mongodb.org/apt/ubuntu/dists/bionic/mongodb-org/4.4/Release.gpg: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
W: https://repo.mongodb.org/apt/ubuntu/dists/jammy/mongodb-org/6.0/Release.gpg: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
W: https://repo.mongodb.org/apt/ubuntu/dists/focal/mongodb-org/5.0/Release.gpg: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package mongodb is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'mongodb' has no installation candidate
答案1
这是解决问题的一种方法。还有其他方法。
不要跳过步骤。如果遇到错误,请停止。
基本清理:从 ubuntu.com 删除所有非 Jammy 源。
非 Ubuntu 清理:从 repo.mongodb.org 中删除所有源。
添加 Universe 存储库:参见我如何启用“Universe”存储库?以获得易于遵循的说明。
运行,
sudo apt update
因为您更改了源代码。使用输出确认您已完成步骤 1-3。如果遇到错误或警告,请停止。修复它们后再继续。mongodb
从 Ubuntu 的存储库安装包universe
:sudo apt install mongodb