下面是我遇到的错误。当我安装或升级时,我花了一段时间才解决。
sudo apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages have been kept back:
linux-generic linux-generic-pae linux-headers-generic linux-headers-generic-pae linux-image-generic linux-image-generic-pae
The following packages will be upgraded:
bamfdaemon dpkg dpkg-dev duplicity libbamf0 libbamf3-0 libdpkg-perl libgl1-mesa-dri libgl1-mesa-glx libglapi-mesa libglu1-mesa
libpulse-mainloop-glib0 libpulse0 libpulsedsp libxatracker1 linux-libc-dev pulseaudio pulseaudio-esound-compat
pulseaudio-module-bluetooth pulseaudio-module-gconf pulseaudio-module-x11 pulseaudio-utils x11-common xbase-clients xorg xserver-xorg
xserver-xorg-input-all xserver-xorg-video-all
28 upgraded, 0 newly installed, 0 to remove and 6 not upgraded.
Need to get 0 B/8,980 kB of archives.
After this operation, 6,144 B of additional disk space will be used.
Do you want to continue [Y/n]? Y
Preconfiguring packages ...
(Reading database ...
dpkg: warning: files list file for package `libservlet2.5-java' missing, assuming package has no files currently installed.
dpkg: warning: files list file for package `libnm-glib-vpn1' missing, assuming package has no files currently installed.
dpkg: warning: files list file for package `network-manager' missing, assuming package has no files currently installed.
dpkg: warning: files list file for package `libnm-glib4' missing, assuming package has no files currently installed.
dpkg: warning: files list file for package `activity-log-manager-control-center' missing, assuming package has no files currently installed.
dpkg: warning: files list file for package `libnm-util2' missing, assuming package has no files currently installed.
(Reading database ... 50%dpkg: unrecoverable fatal error, aborting:
files list file for package 'libnspr4' is missing final newline
E: Sub-process /usr/bin/dpkg returned an error code (2)
答案1
其中的元信息似乎/var/lib/dpkg/info
被扰乱了。
对于所有有问题的软件包,请尝试使用以下命令重新安装它们:apt-get install --reinstall
例如:
apt-get install --reinstall libservlet2.5-java libnm-glib-vpn1 \
network-manager libnm-glib4 activity-log-manager-control-center libnm-util2 \
libnspr4
如果libnm-util2
继续造成麻烦,请删除元信息:
rm /var/lib/dpkg/info/libnspr4{:,.}*