2

I first noticed this problem when my update manager kept failing to install updates sudo apt-get update runs without returning any errors, when i run:

sudo apt-get install upgrade

i get the following error:

dpkg: malloc.c:2372: sysmalloc: Assertion `(old_top == (((mbinptr) (((char *) &((av)->bins[((1) - 1) * 2])) - __builtin_offsetof (struct malloc_chunk, fd)))) && old_size == 0) || ((unsigned long) (old_size) >= (unsigned long)((((__builtin_offsetof (struct malloc_chunk, fd_nextsize))+((2 *(sizeof(size_t))) - 1)) & ~((2 *(sizeof(size_t))) - 1))) && ((old_top)->size & 0x1) && ((unsigned long) old_end & pagemask) == 0)' failed.

E: Sub-process /usr/bin/dpkg exited unexpectedly

And probably unrealated to this problem when i first boot up my computer (same laptop as above error) the 'T' and 'Y' keys and a few other keys do not work, originally thought it was a problem with the keyboard itself but all keys start working normally after a few mins my guess is a software problem?

I tried doing some searching around but could not find a solution to either problem, i am hoping someone will be able to help

1
  • The right commands, actually, are: sudo apt-get update && sudo apt-get upgrade
    – xangua
    May 14, 2015 at 1:59

3 Answers 3

0

Try putting the machine in recovery mode (basically yank power twice), then pick advanced options, recovery mode, and try the dpkg option. Worth a try.

1
  • Tried it, still receiving the same error May 29, 2015 at 17:54
0

The right command is

sudo apt-get upgrade

You should remove the install and it will work.

1
  • That was my mistake in typing the post it May 27, 2015 at 21:57
0

I was getting the very same error and I managed to find a solution.

As you can probably infer from the error message, this is an issue with dpkg. It turns out, in my case, there was a corrupted file in /var/lib/dpkg/info that caused dpkg to end in such a dramatical way. The easiest and less dangerous solution is to reinstall the system, but if this is too much pain you may try to remove the corrupted file by rebuilding the info.

First create a backup.

cd /var/lib/dpkg
mv info info.bak

Now you may regenerate the info by reinstalling every package in the system. (Warning: this is going to take a while!)

for i in $(dpkg -l|awk '/^ii/ {print $2}')
do
    apt-get --reinstall -y install $i
done

Hopefully you are all set!

(this last step is from https://serverfault.com/questions/484933/debian-removed-var-lib-dpkg-info-is-there-a-way-to-save-the-system)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .