2

I'm trying to install python-dev and I keep getting this error. What is going on?

ubuntu@ip-XX-XXX-XXX-XX:~$ sudo apt-get install python-dev Reading
package lists... Done Building dependency tree... Done python-dev is
already the newest version. The following packages will be REMOVED:  
linux-image-3.2.0-54-virtual 0 upgraded, 0 newly installed, 1 to
remove and 147 not upgraded. 2 not fully installed or removed. After
this operation, 36.2 MB disk space will be freed. Do you want to
continue [Y/n]? Y

(Reading database ...  dpkg: warning: files list file for package
`vim-tiny' missing, assuming package has no files currently installed.

dpkg: warning: files list file for package `libc6' missing, assuming
package has no files currently installed.

dpkg: warning: files list file for package `grub-legacy-ec2' missing,
assuming package has no files currently installed. (Reading database
... 182424 files and directories currently installed.) Removing
linux-image-3.2.0-54-virtual ... Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools
3.2.0-54-virtual /boot/vmlinuz-3.2.0-54-virtual update-initramfs: Deleting /boot/initrd.img-3.2.0-54-virtual run-parts: executing
/etc/kernel/postrm.d/x-grub-legacy-ec2 3.2.0-54-virtual
/boot/vmlinuz-3.2.0-54-virtual Searching for GRUB installation
directory ... found: /boot/grub Searching for default file ... found:
/boot/grub/default Testing for an existing GRUB menu.lst file ...
found: /boot/grub/menu.lst Searching for splash image ... none found,
skipping ... Found kernel: /boot/vmlinuz-3.2.0-54-virtual Found
kernel: /boot/memtest86+.bin run-parts:
/etc/kernel/postrm.d/x-grub-legacy-ec2 exited with return code 10
Failed to process /etc/kernel/postrm.d at
/var/lib/dpkg/info/linux-image-3.2.0-54-virtual.postrm line 328. dpkg:
error processing linux-image-3.2.0-54-virtual (--remove):  subprocess
installed post-removal script returned error exit status 1 Errors were
encountered while processing:  linux-image-3.2.0-54-virtual E:
Sub-process /usr/bin/dpkg returned an error code (1)

Any idea as to whats going on and how I can fix it?

2 Answers 2

1

For anyone who comes across this issue, use this resource http://www.khattam.info/solved-subprocess-pre-removal-script-returned-error-exit-status-2-error-2009-08-04.html#more-303

It fixed the problem for me. The packages: linux-image-2.3.0-54-virtual and linux-image were in the /var/lib/dpkg/status several times, there were doubles. Just use vim or nano, whichever your favorite editor is and remove the packages. Save it and then do sudo apt-get update. Then do sudo apt-get -f install.

Everything should work now.

1
  • It would be nice to know the output of apt-get -f install, looking at the output you provided, there's some problem with libc (big warning here, "bad things happening") among others. Would have the -f flag solved the problem without manually tweaking files? Just being curious :) Commented Oct 11, 2014 at 8:27
0

For my case, the same problem occured because of a bash script I wrote and named with the same name "sync". It took me a while to figure out what was going on.

apt was not able to install the update as my script was being used, but not /bin/sync.

You must log in to answer this question.

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