Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Similar to how-to-get-dpkg-working-again

my daily apt-get has had this error, completely failing to update anything:

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

Have experienced this horrific show-stopper across three servers on and off for two years, using Ubuntu 10.04, 10.10, and 11.04 32bit systems.

All manner of troubleshooting with launchpad.net has only gone in circles. I do not use ntfs but ext4. apt-get purge fails, dpkg --configure -a exits instantly with no output, blaming python-twisted-core seemed to go nowhere.

I may be on to something. The next wave of auto-updates break it again though.

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 &**
share|improve this question
    
    
Manual edit of /var/lib/dpkg/status file seems to have been key to help move things along, see bugs.launchpad.net/ubuntu/+source/twisted/+bug/997024/comments/… –  Marcos Jun 19 '12 at 15:07

1 Answer 1

Did you try doing apt-get clean and then apt-get install again?

The error message suggests there's a problem uncompressing the package:

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

I'd also do a full disk and memory check to be sure, but apt-get clean can hopefully help.

share|improve this answer
    
Yes I tried those. It re-downloaded and end up with the same assert failure and E: Sub-process /usr/bin/dpkg exited unexpectedly Checksum verified, deleted, manually replaced the -rw-r--r-- 1 root root 1128666 2011-02-24 13:05 /var/cache/apt/archives/python-twisted-core_10.2.0-1_all.deb file many times. –  Marcos Feb 1 '12 at 16:26
1  
can you install anything at all? I'd next try installing debsums and debsumming all the packages to ensure they're not corrupted. But if you can't install anything that'll be a problem... –  roadmr Feb 1 '12 at 20:29
    
Nothing installs. The packaging mechanism itself is broken. This method once helped me manually clean out HandBrake version svn-### (and therefore un-stuck ever being able to install or update any package at all) when Ubuntu suddenly made numeric version # prefixes mandatory one day. Nice move. –  Marcos Feb 1 '12 at 21:19
    
Based on your comment that you "Have experienced this horrific show-stopper across three servers on and off for two years, using Ubuntu 10.04, 10.10, and 11.04 32bit systems.", and also the fact that this is not a common problem, I have to think the problem lies elsewhere, and that it's something either on the custom configurations or packages you have installed and used on all those systems, or on the hardware itself. Are you using any third-party package repositories? do you have some apt configurations that may be influencing this? –  roadmr Feb 1 '12 at 21:39
1  
This thread (look at the last comment) points to an instance where a borked Package stanza was causing problems, in the file /var/lib/dpkg/status. Maybe you have something similar, due to some third-party package whose information is faulty? worth a try. ubuntuforums.org/showthread.php?t=1580470 –  roadmr Feb 1 '12 at 21:40

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.