操作系统:Linux Mint 20.3
每当我执行 sudo apt update 时,我通常会收到此错误。
dpkg: warning: files list file for package 'libecryptfs1' missing; assuming package has no files currently installed
但它从未引起任何问题。
现在我正在将 Linux mint 升级到 21,升级因抛出以下错误而停止。
dpkg: warning: files list file for package 'libecryptfs1' missing; assuming package has no files currently installed
(Reading database ... 409767 files and directories currently installed.)
Preparing to unpack .../libecryptfs1_111-5ubuntu1_amd64.deb ...
dpkg: error processing archive /var/cache/apt/archives/libecryptfs1_111-5ubuntu1_amd64.deb (--unpack):
too-long line or missing newline in '/var/lib/dpkg/info/libecryptfs1.triggers'
Errors were encountered while processing:
/var/cache/apt/archives/libecryptfs1_111-5ubuntu1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
Error - Return code: 100
当我尝试重新安装它时,发生以下错误
encrypted32@anonymous24:~$ sudo apt-get autoclean
[sudo] password for encrypted32:
Reading package lists... Done
Building dependency tree
Reading state information... Done
encrypted32@anonymous24:~$ sudo apt-get install --reinstall libecryptfs1
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
libqt5networkauth5 python3-simplejson stunnel4 x11proto-input-dev
x11proto-randr-dev
Use 'sudo apt autoremove' to remove them.
The following packages will be upgraded:
libecryptfs1
1 upgraded, 0 newly installed, 0 to remove and 1492 not upgraded.
Need to get 36.0 kB of archives.
After this operation, 21.5 kB disk space will be freed.
Get:1 http://archive.ubuntu.com/ubuntu jammy/universe amd64 libecryptfs1 amd64 111-5ubuntu1 [36.0 kB]
Fetched 36.0 kB in 2s (17.6 kB/s)
dpkg: warning: files list file for package 'libecryptfs1' missing; assuming package has no files currently installed
(Reading database ... 409767 files and directories currently installed.)
Preparing to unpack .../libecryptfs1_111-5ubuntu1_amd64.deb ...
dpkg: error processing archive /var/cache/apt/archives/libecryptfs1_111-5ubuntu1_amd64.deb (--unpack):
too-long line or missing newline in '/var/lib/dpkg/info/libecryptfs1.triggers'
Errors were encountered while processing:
/var/cache/apt/archives/libecryptfs1_111-5ubuntu1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
输出如下cat /var/lib/dpkg/info/libecryptfs1.triggers
:
$���m��mo�L�D��;�%g�?w��ŷ���ovH0��a�5��*�ؒ��l͛�S�iy�r�O7����%L]�
不确定该输出意味着什么
注意:我apt update
在开始升级之前做了任何有关修复此问题的帮助。
根据 @ab 的建议,我运行了所有命令
粘贴下面最后一个命令的输出
encrypted32@anonymous24:~$ sudo apt-get -f reinstall libecryptfs1
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
libqt5networkauth5 python3-simplejson stunnel4 x11proto-input-dev
x11proto-randr-dev
Use 'sudo apt autoremove' to remove them.
The following packages will be upgraded:
libecryptfs1
1 upgraded, 0 newly installed, 0 to remove and 1492 not upgraded.
Need to get 36.0 kB of archives.
After this operation, 21.5 kB disk space will be freed.
Get:1 http://archive.ubuntu.com/ubuntu jammy/universe amd64 libecryptfs1 amd64 111-5ubuntu1 [36.0 kB]
Fetched 36.0 kB in 1s (30.9 kB/s)
dpkg: warning: files list file for package 'libecryptfs1' missing; assuming package has no files currently installed
(Reading database ... 409767 files and directories currently installed.)
Preparing to unpack .../libecryptfs1_111-5ubuntu1_amd64.deb ...
Unpacking libecryptfs1 (111-5ubuntu1) over (111-0ubuntu7) ...
Setting up libecryptfs1 (111-5ubuntu1) ...
Processing triggers for libc-bin (2.31-0ubuntu9.9) ...
现在,我该如何恢复升级?通过 Mintupgrade 工具还是有任何命令?
答案1
免责声明:我假设系统过去曾发生过文件系统损坏。如果这仅限于一个包的元数据,那很好。如果其他损坏仍然存在或仍在发生(例如:硬件问题),情况可能会更糟。所以重要的数据应该先备份。
目标是重新安装此软件包,同时忽略其以前的元数据部分,这使得它可以卸载。有问题的文件将被移走。通常这个触发文件只是触发运行ldconfig
:这是安装提供共享对象库的库包后必须要做的事情。因为我不信任当前的 .deb 文件,所以/var/cache/apt/archives
首先清空整个缓存,以便重新下载并重新验证它。触发器文件应替换为升级后的新版本。
首先验证文件系统是否已满或接近满 ( df -h
),并在需要时腾出空间。
以下所有命令必须以 root 身份运行(sudo
如果需要,请使用)。
mv /var/lib/dpkg/info/libecryptfs1.triggers /root/libecryptfs1.triggers.badfile
apt clean
apt update
apt-get -f reinstall libecryptfs1
然后就可以像往常一样取出包裹了。如果加密依赖于它,则不应将其删除。