在 proxmox 容器中的 debian 11 上安装 mongodb 时出错

在 proxmox 容器中的 debian 11 上安装 mongodb 时出错

我尝试按照本教程中的说明在 Proxmox VE 7.1 容器中的 Debian 11 上安装 mongodbhttps://www.mongodb.com/docs/manual/tutorial/install-mongodb-on-debian/

但我收到以下错误:

error setting ownership of './usr/bin/bsondump': Invalid argument
uname -a
Linux chat 5.13.19-2-pve #1 SMP PVE 5.13.19-4 (Mon, 29 Nov 2021 12:10:09
+0100) x86_64 GNU/Linux

以下是完整日志:

root@chat:~# apt install mongodb-org
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  mongodb-database-tools mongodb-mongosh mongodb-org-database mongodb-org-database-tools-extra mongodb-org-mongos
  mongodb-org-server mongodb-org-shell mongodb-org-tools 
The following NEW packages will be installed:
  mongodb-database-tools mongodb-mongosh mongodb-org mongodb-org-database mongodb-org-database-tools-extra mongodb-org-mongos
  mongodb-org-server mongodb-org-shell mongodb-org-tools
0 upgraded, 9 newly installed, 0 to remove and 1 not upgraded.
Need to get 142 MB of archives.
After this operation, 455 MB of additional disk space will be used.
Do you want to continue? [Y/n]
Get:1 http://repo.mongodb.org/apt/debian buster/mongodb-org/5.0/main
amd64 mongodb-database-tools amd64 100.5.2 [46.4 MB]
Get:2 http://repo.mongodb.org/apt/debian buster/mongodb-org/5.0/main
amd64 mongodb-mongosh amd64 1.4.2 [36.0 MB]
Get:3 http://repo.mongodb.org/apt/debian buster/mongodb-org/5.0/main
amd64 mongodb-org-shell amd64 5.0.8 [14.4 MB]
Get:4 http://repo.mongodb.org/apt/debian buster/mongodb-org/5.0/main
amd64 mongodb-org-server amd64 5.0.8 [26.3 MB]
Get:5 http://repo.mongodb.org/apt/debian buster/mongodb-org/5.0/main
amd64 mongodb-org-mongos amd64 5.0.8 [18.5 MB]
Get:6 http://repo.mongodb.org/apt/debian buster/mongodb-org/5.0/main
amd64 mongodb-org-database-tools-extra amd64 5.0.8 [7752 B]
Get:7 http://repo.mongodb.org/apt/debian buster/mongodb-org/5.0/main
amd64 mongodb-org-database amd64 5.0.8 [3540 B]
Get:8 http://repo.mongodb.org/apt/debian buster/mongodb-org/5.0/main
amd64 mongodb-org-tools amd64 5.0.8 [2896 B]
Get:9 http://repo.mongodb.org/apt/debian buster/mongodb-org/5.0/main
amd64 mongodb-org amd64 5.0.8 [2932 B] Fetched 142 MB in 13s (10.6
MB/s)                                                                                                
 
(Reading database ... 28040 files and directories currently installed.) Preparing to unpack .../0-mongodb-database-tools_100.5.2_amd64.deb ...
Unpacking mongodb-database-tools (100.5.2) ...
dpkg: error processing archive
/tmp/apt-dpkg-install-qgvHOt/0-mongodb-database-tools_100.5.2_amd64.deb
(--unpack):
 error setting ownership of './usr/bin/bsondump': Invalid argument
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe) Selecting previously unselected package mongodb-mongosh.
Preparing to unpack .../1-mongodb-mongosh_1.4.2_amd64.deb ...
Unpacking mongodb-mongosh (1.4.2) ...
Selecting previously unselected package mongodb-org-shell.
Preparing to unpack .../2-mongodb-org-shell_5.0.8_amd64.deb ...
Unpacking mongodb-org-shell (5.0.8) ...
Selecting previously unselected package mongodb-org-server.
Preparing to unpack .../3-mongodb-org-server_5.0.8_amd64.deb ...
Unpacking mongodb-org-server (5.0.8) ...
Selecting previously unselected package mongodb-org-mongos.
Preparing to unpack .../4-mongodb-org-mongos_5.0.8_amd64.deb ...
Unpacking mongodb-org-mongos (5.0.8) ...
Selecting previously unselected package mongodb-org-database-tools-extra.
Preparing to unpack
.../5-mongodb-org-database-tools-extra_5.0.8_amd64.deb ...
Unpacking mongodb-org-database-tools-extra (5.0.8) ...
Selecting previously unselected package mongodb-org-database.
Preparing to unpack .../6-mongodb-org-database_5.0.8_amd64.deb ...
Unpacking mongodb-org-database (5.0.8) ...
Selecting previously unselected package mongodb-org-tools.
Preparing to unpack .../7-mongodb-org-tools_5.0.8_amd64.deb ...
Unpacking mongodb-org-tools (5.0.8) ...
Selecting previously unselected package mongodb-org.
Preparing to unpack .../8-mongodb-org_5.0.8_amd64.deb ...
Unpacking mongodb-org (5.0.8) ...
Errors were encountered while processing:
 /tmp/apt-dpkg-install-qgvHOt/0-mongodb-database-tools_100.5.2_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

导致此错误的原因是什么?

答案1

我将容器从非特权改为特权

  1. 对原始非特权容器 113 进行了备份
  2. 从备份中创建了一个新的特权容器 117

pct 恢复 117 /var/lib/vz/dump/vzdump-lxc-113-2022_05_30-10_13_11.tar.zst --storage local-lvm--无特权 0

现在我可以安装 mongodb 了,没有任何错误

相关内容