看似无法解决的软件包安装失败

看似无法解决的软件包安装失败

如同如何让 dpkg 再次工作

我每天使用 apt-get 都会出现这个错误,完全无法更新任何内容:

root@chopin~ Wed Feb 01,16:23:56# (5473) apt-get -y install  Reading package lists... 
Done 
Building dependency tree... 50% 
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
python-twisted-core 
Suggested packages:
python-qt3 python-profiler 
The following packages will be upgraded:
python-twisted-core 
1 upgraded, 0 newly installed, 0 to remove and 82 not upgraded. 1 not fully installed  or removed. 
Need to get 0 B/1,129 kB of archives. 
After this operation, 8,360 kB of additional disk space will be used. (Reading database ...  
dpkg: warning: files list file for package `python-twisted-core' missing, assuming package has no files currently installed. 
(Reading database... 277181 files and directories currently installed.) 
Preparing to replace python-twisted-core 10.2.0-1 (using .../python-twisted-core_10.2.0-1_all.deb) ... 
Unpacking replacement python-twisted-core ... 
dpkg: ../../src/archives.c:968: tarobject:
Assertion `r == stab.st_size' failed. 
localepurge: Disk space freed in /usr/share/locale: 0 KiB 
localepurge: Disk space freed in /usr/share/man: 0 KiB

localepurge: Disk space freed in /usr/share/gnome/help: 0 KiB
localepurge: Disk space freed in /usr/share/omf: 0 KiB 
localepurge: Disk space freed in /usr/share/doc/kde/HTML: 0 KiB

Total disk space freed by localepurge: 0 KiB

N: Ignoring file 'apt-build' in directory '/etc/apt/sources.list.d/' as it has no filename extension 
E: Sub-process /usr/bin/dpkg exited unexpectedly

在使用 Ubuntu 10.04、10.10 和 11.04 32 位系统的三台服务器上,我断断续续地经历了这种可怕的故障,已经两年了。

使用 launchpad.net 进行的所有故障排除都只是在兜圈子。我不使用 ntfs,而是使用 ext4。 apt-get purge失败, dpkg --configure -a立即退出,没有任何输出,指责python-twisted-core似乎毫无用处。

我可能发现了一些问题。不过下一波自动更新又会破坏它。

root@chopin/var/lib/dpkg/info Thu Feb 02,15:03:39# (5743) **dpkg --remove --force-remove-reinstreq python-twisted-core**
dpkg: warning: overriding problem because --force enabled:
 Package is in a very bad inconsistent state - you should
 reinstall it before attempting a removal.
(Reading database ... 
dpkg: warning: files list file for package `python-twisted-core' missing, assuming package has no files currently installed.
(Reading database ... 277171 files and directories currently installed.)
Removing python-twisted-core ...


root@chopin/var/lib/dpkg/info Thu Feb 02,15:03:54# (5744) **apt-get install geany debsums -y** 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Suggested packages:
  geany-plugins
The following NEW packages will be installed:
  debsums geany
0 upgraded, 2 newly installed, 0 to remove and 86 not upgraded.
Need to get 0 B/2,756 kB of archives.
After this operation, 8,016 kB of additional disk space will be used.
Preconfiguring packages ...
Selecting previously deselected package debsums.
(Reading database ... 277175 files and directories currently installed.)
Unpacking debsums (from .../debsums_2.0.48+nmu3_all.deb) ...
Selecting previously deselected package geany.
Unpacking geany (from .../geany_0.20-0ubuntu2_i386.deb) ...
Processing triggers for man-db ...
Processing triggers for desktop-file-utils ...
Processing triggers for python-gmenu ...
Rebuilding /usr/share/applications/desktop.en_US.utf8.cache...
Processing triggers for bamfdaemon ...
Rebuilding /usr/share/applications/bamf.index...
Processing triggers for hicolor-icon-theme ...
Processing triggers for doc-base ...
Processing 1 added doc-base file(s)...
Registering documents with scrollkeeper...
Processing triggers for menu ...
Processing triggers for python-support ...
Setting up debsums (2.0.48+nmu3) ...

Creating config file /etc/apt/apt.conf.d/90debsums with new version
Setting up geany (0.20-0ubuntu2) ...
Processing triggers for menu ...
localepurge: Disk space freed in /usr/share/locale: 2660 KiB
localepurge: Disk space freed in /usr/share/man: 72 KiB
localepurge: Disk space freed in /usr/share/gnome/help: 0 KiB
localepurge: Disk space freed in /usr/share/omf: 0 KiB
localepurge: Disk space freed in /usr/share/doc/kde/HTML: 0 KiB

Total disk space freed by localepurge: 2732 KiB

N: Ignoring file 'apt-build' in directory '/etc/apt/sources.list.d/' as it has no filename extension
root@chopin/var/lib/dpkg/info Thu Feb 02,15:04:55# (5744) **time debsums_init &**

答案1

你有没有尝试过apt-get clean然后apt-get install再做一次?

错误消息表明解压缩包时出现问题:

unpacking replacement python-twisted-core ... 
dpkg: ../../src/archives.c:968: tarobject:
Assertion `r == stab.st_size' failed. 

我还会进行完整的磁盘和内存检查以确保无误,但希望 apt-get clean 能够有所帮助。

相关内容