依赖项错误:在 Amazon Linux 上安装 MongoDB

依赖项错误:在 Amazon Linux 上安装 MongoDB

我需要在 Amazon Linux 计算机上安装 MongoDB 社区版。

我按照中描述的步骤进行操作MongoDB 文档非常简单:

  1. 在中创建 repo 文件/etc/yum.repos.d
  2. 安装通过sudo yum install -y mongodb-org

但是,我遇到了无法克服的依赖错误。这是输出:

sh-4.2$ sudo yum install -y mongodb-org
Loaded plugins: dkms-build-requires, priorities, update-motd, upgrade-helper, versionlock
amzn-main                                                                                     | 2.1 kB  00:00:00     
amzn-updates                                                                                  | 2.5 kB  00:00:00     
libnvidia-container/x86_64/signature                                                          |  455 B  00:00:00     
libnvidia-container/x86_64/signature                                                          | 2.0 kB  00:00:00 !!! 
mongodb-org-4.2                                                                               | 2.4 kB  00:00:00     
Not using downloaded repomd.xml because it is older than what we have:
  Current   : Mon Dec  9 22:52:43 2019
  Downloaded: Mon Dec  9 22:52:27 2019
nvidia-container-runtime/x86_64/signature                                                     |  455 B  00:00:00     
nvidia-container-runtime/x86_64/signature                                                     | 2.0 kB  00:00:00 !!! 
nvidia-docker/x86_64/signature                                                                |  455 B  00:00:00     
nvidia-docker/x86_64/signature                                                                | 2.0 kB  00:00:00 !!! 
Resolving Dependencies
--> Running transaction check
---> Package mongodb-org.x86_64 0:4.2.2-1.amzn2 will be installed
--> Processing Dependency: mongodb-org-tools = 4.2.2 for package: mongodb-org-4.2.2-1.amzn2.x86_64
--> Processing Dependency: mongodb-org-shell = 4.2.2 for package: mongodb-org-4.2.2-1.amzn2.x86_64
--> Processing Dependency: mongodb-org-server = 4.2.2 for package: mongodb-org-4.2.2-1.amzn2.x86_64
--> Processing Dependency: mongodb-org-mongos = 4.2.2 for package: mongodb-org-4.2.2-1.amzn2.x86_64
--> Running transaction check
---> Package mongodb-org-mongos.x86_64 0:4.2.2-1.amzn2 will be installed
--> Processing Dependency: libc.so.6(GLIBC_2.18)(64bit) for package: mongodb-org-mongos-4.2.2-1.amzn2.x86_64
---> Package mongodb-org-server.x86_64 0:4.2.2-1.amzn2 will be installed
--> Processing Dependency: libc.so.6(GLIBC_2.18)(64bit) for package: mongodb-org-server-4.2.2-1.amzn2.x86_64
---> Package mongodb-org-shell.x86_64 0:4.2.2-1.amzn2 will be installed
--> Processing Dependency: libc.so.6(GLIBC_2.18)(64bit) for package: mongodb-org-shell-4.2.2-1.amzn2.x86_64
---> Package mongodb-org-tools.x86_64 0:4.2.2-1.amzn2 will be installed
--> Finished Dependency Resolution
Error: Package: mongodb-org-shell-4.2.2-1.amzn2.x86_64 (mongodb-org-4.2)
           Requires: libc.so.6(GLIBC_2.18)(64bit)
Error: Package: mongodb-org-mongos-4.2.2-1.amzn2.x86_64 (mongodb-org-4.2)
           Requires: libc.so.6(GLIBC_2.18)(64bit)
Error: Package: mongodb-org-server-4.2.2-1.amzn2.x86_64 (mongodb-org-4.2)
           Requires: libc.so.6(GLIBC_2.18)(64bit)
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

此外,当我运行 时yum whatprovides */libc.so.6,我知道该文件已安装在计算机上:

Loaded plugins: dkms-build-requires, priorities, update-motd, upgrade-helper, versionlock
libnvidia-container                                                                                            40/40
nvidia-container-runtime                                                                                       18/18
nvidia-docker                                                                                                  14/14
mongodb-org-4.2/filelists_db                                                                  | 2.8 kB  00:00:00     
glibc-2.17-196.172.amzn1.i686 : The GNU libc libraries
Repo        : amzn-main
Matched from:
Filename    : /lib/i686/nosegneg/libc.so.6
Filename    : /lib/libc.so.6



glibc-2.17-196.172.amzn1.x86_64 : The GNU libc libraries
Repo        : amzn-main
Matched from:
Filename    : /lib64/libc.so.6



glibc-2.17-222.173.amzn1.i686 : The GNU libc libraries
Repo        : amzn-updates
Matched from:
Filename    : /lib/i686/nosegneg/libc.so.6
Filename    : /lib/libc.so.6



glibc-2.17-222.173.amzn1.x86_64 : The GNU libc libraries
Repo        : amzn-updates
Matched from:
Filename    : /lib64/libc.so.6



glibc-2.17-260.175.amzn1.i686 : The GNU libc libraries
Repo        : amzn-updates
Matched from:
Filename    : /lib/i686/nosegneg/libc.so.6
Filename    : /lib/libc.so.6



glibc-2.17-260.175.amzn1.x86_64 : The GNU libc libraries
Repo        : amzn-updates
Matched from:
Filename    : /lib64/libc.so.6



glibc-2.17-292.178.amzn1.i686 : The GNU libc libraries
Repo        : amzn-updates
Matched from:
Filename    : /lib/i686/nosegneg/libc.so.6
Filename    : /lib/libc.so.6



glibc-2.17-292.178.amzn1.x86_64 : The GNU libc libraries
Repo        : amzn-updates
Matched from:
Filename    : /lib64/libc.so.6



glibc-2.17-292.178.amzn1.x86_64 : The GNU libc libraries
Repo        : @amzn-updates
Matched from:
Filename    : /lib64/libc.so.6

那么,我应该怎样做才能克服这个障碍呢?

答案1

这是因为您使用的是 Amazon Linux 1,即 Amazon Linux (2013.03+),最高支持 GLIBC_2.17。对于 GLIBC_2.18,请使用 Amazon Linux 2 AMI 并配置用于安装 mongo 的存储库。配置正确的存储库并重新安装软件包。以下是两者的链接: https://docs.mongodb.com/v4.0/tutorial/install-mongodb-on-amazon/

相关内容