我已经搜索并尝试了针对收到的错误消息的解决方案,但似乎无法安装 nginx 作为在运行 Ubuntu 20.4 的 Pi 4 上构建 LEMP - Nextcloud 设置的第一步。
这就是我得到的
root@ubuntu:/home/ubuntu# apt update
Hit:1 http://ports.ubuntu.com/ubuntu-ports focal InRelease
Hit:2 http://ports.ubuntu.com/ubuntu-ports focal-updates InRelease
Hit:3 http://ports.ubuntu.com/ubuntu-ports focal-backports InRelease
Hit:4 http://ports.ubuntu.com/ubuntu-ports focal-security InRelease
Reading package lists... Done
Building dependency tree
Reading state information... Done
All packages are up to date.
root@ubuntu:/home/ubuntu# apt upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
root@ubuntu:/home/ubuntu# apt install nginx
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
fontconfig-config fonts-dejavu-core libfontconfig1 libfreetype6 libgd3
libjbig0 libjpeg-turbo8 libjpeg8 libnginx-mod-http-image-filter
libnginx-mod-http-xslt-filter libnginx-mod-mail libnginx-mod-stream libtiff5
libwebp6 libxpm4 libxslt1.1 nginx-common nginx-core
Suggested packages:
libgd-tools fcgiwrap nginx-doc ssl-cert
The following NEW packages will be installed:
fontconfig-config fonts-dejavu-core libfontconfig1 libfreetype6 libgd3
libjbig0 libjpeg-turbo8 libjpeg8 libnginx-mod-http-image-filter
libnginx-mod-http-xslt-filter libnginx-mod-mail libnginx-mod-stream libtiff5
libwebp6 libxpm4 libxslt1.1 nginx nginx-common nginx-core
0 upgraded, 19 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/2775 kB of archives.
After this operation, 8642 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Preconfiguring packages ...
Selecting previously unselected package fonts-dejavu-core.
dpkg: unrecoverable fatal error, aborting:
loading files list file for package 'libmpfr6:arm64': cannot open /var/lib/dpkg/info/libmpfr6:arm64.list (Structure needs cleaning)
E: Sub-process /usr/bin/dpkg returned an error code (2)
root@ubuntu:/home/ubuntu#
我好像也收到了很多这样的 dpkg:无法恢复的致命错误,中止:。我想我已经重新安装了操作系统几次,因为我遇到了一些总是导致错误消息的 apt 更新和升级。这是我第一次没有遇到这种情况,但现在在安装 nginx 时遇到问题。
答案1
“结构需要清理”意味着您的文件系统已损坏。
在该文件系统上运行
fsck
。由于这似乎是您的系统分区,因此您无法从中启动。必须在卸载分区时运行 fsck。将媒体移动到不同的 Ubuntu 系统,不要安装它,不要从它启动,然后使用其他正在运行的系统在其上运行 fsck。
或者,您可以启动 Live 映像,但这有时在 Pi 上会出现问题。
反复损坏可能表明介质有故障:
- 如果它是 HDD,请查找如何对其运行 SMART 测试。
- 如果是 SD 卡,请尝试使用其他卡...或其他读卡器。读卡器也会出问题。