Cannot install or remove software

Asked by Stovan on 2012-03-14

Every time I try I get this error:

Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
  linux-image-3.0.0-16-generic
Suggested packages:
  fdutils linux-doc-3.0.0 linux-source-3.0.0 linux-tools
The following packages will be upgraded:
  linux-image-3.0.0-16-generic
1 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
17 not fully installed or removed.
Need to get 0 B/74.1 MB of archives.
After this operation, 12.3 kB of additional disk space will be used.
(Reading database ... 238156 files and directories currently installed.)
Preparing to replace linux-image-3.0.0-15-generic 3.0.0-15.26 (using .../linux-image-3.0.0-15-generic_3.0.0-15.26_amd64.deb) ...
Done.
Unpacking replacement linux-image-3.0.0-15-generic ...
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 3.0.0-15-generic /boot/vmlinuz-3.0.0-15-generic
run-parts: executing /etc/kernel/postrm.d/zz-extlinux 3.0.0-15-generic /boot/vmlinuz-3.0.0-15-generic
P: Checking for EXTLINUX directory... found.
P: Writing config for /boot/vmlinuz-3.0.0-16-generic...
P: Writing config for /boot/vmlinuz-3.0.0-15-generic...
P: Updating /boot/extlinux/linux.cfg...
P: Installing debian theme...cp: cannot stat `/usr/share/syslinux/themes/debian-squeeze/extlinux/memtest.bin': No such file or directory
run-parts: /etc/kernel/postrm.d/zz-extlinux exited with return code 1
Failed to process /etc/kernel/postrm.d at /var/lib/dpkg/info/linux-image-3.0.0-15-generic.postrm line 328.
dpkg: warning: subprocess old post-removal script returned error exit status 1
dpkg - trying script from the new package instead ...
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 3.0.0-15-generic /boot/vmlinuz-3.0.0-15-generic
run-parts: executing /etc/kernel/postrm.d/zz-extlinux 3.0.0-15-generic /boot/vmlinuz-3.0.0-15-generic
P: Checking for EXTLINUX directory... found.
P: Writing config for /boot/vmlinuz-3.0.0-16-generic...
P: Writing config for /boot/vmlinuz-3.0.0-15-generic...
P: Installing debian theme...cp: cannot stat `/usr/share/syslinux/themes/debian-squeeze/extlinux/memtest.bin': No such file or directory
run-parts: /etc/kernel/postrm.d/zz-extlinux exited with return code 1
Failed to process /etc/kernel/postrm.d at /var/lib/dpkg/tmp.ci/postrm line 328.
dpkg: error processing /var/cache/apt/archives/linux-image-3.0.0-15-generic_3.0.0-15.26_amd64.deb (--unpack):
 subprocess new post-removal script returned error exit status 1
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 3.0.0-15-generic /boot/vmlinuz-3.0.0-15-generic
run-parts: executing /etc/kernel/postrm.d/zz-extlinux 3.0.0-15-generic /boot/vmlinuz-3.0.0-15-generic
P: Checking for EXTLINUX directory... found.
P: Writing config for /boot/vmlinuz-3.0.0-16-generic...
P: Updating /boot/extlinux/linux.cfg...
P: Installing debian theme...cp: cannot stat `/usr/share/syslinux/themes/debian-squeeze/extlinux/memtest.bin': No such file or directory
run-parts: /etc/kernel/postrm.d/zz-extlinux exited with return code 1
Failed to process /etc/kernel/postrm.d at /var/lib/dpkg/tmp.ci/postrm line 328.
dpkg: error while cleaning up:
 subprocess new post-removal script returned error exit status 1
Preparing to replace linux-image-3.0.0-16-generic 3.0.0-16.28 (using .../linux-image-3.0.0-16-generic_3.0.0-16.29_amd64.deb) ...
Done.
Unpacking replacement linux-image-3.0.0-16-generic ...
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 3.0.0-16-generic /boot/vmlinuz-3.0.0-16-generic
run-parts: executing /etc/kernel/postrm.d/zz-extlinux 3.0.0-16-generic /boot/vmlinuz-3.0.0-16-generic
P: Checking for EXTLINUX directory... found.
P: Writing config for /boot/vmlinuz-3.0.0-16-generic.dpkg-tmp...
P: Writing config for /boot/vmlinuz-3.0.0-16-generic...
P: Updating /boot/extlinux/linux.cfg...
P: Installing debian theme...cp: cannot stat `/usr/share/syslinux/themes/debian-squeeze/extlinux/memtest.bin': No such file or directory
run-parts: /etc/kernel/postrm.d/zz-extlinux exited with return code 1
Failed to process /etc/kernel/postrm.d at /var/lib/dpkg/info/linux-image-3.0.0-16-generic.postrm line 328.
dpkg: warning: subprocess old post-removal script returned error exit status 1
dpkg - trying script from the new package instead ...
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 3.0.0-16-generic /boot/vmlinuz-3.0.0-16-generic
run-parts: executing /etc/kernel/postrm.d/zz-extlinux 3.0.0-16-generic /boot/vmlinuz-3.0.0-16-generic
P: Checking for EXTLINUX directory... found.
P: Writing config for /boot/vmlinuz-3.0.0-16-generic.dpkg-tmp...
P: Writing config for /boot/vmlinuz-3.0.0-16-generic...
P: Installing debian theme...cp: cannot stat `/usr/share/syslinux/themes/debian-squeeze/extlinux/memtest.bin': No such file or directory
run-parts: /etc/kernel/postrm.d/zz-extlinux exited with return code 1
Failed to process /etc/kernel/postrm.d at /var/lib/dpkg/tmp.ci/postrm line 328.
dpkg: error processing /var/cache/apt/archives/linux-image-3.0.0-16-generic_3.0.0-16.29_amd64.deb (--unpack):
 subprocess new post-removal script returned error exit status 1
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 3.0.0-16-generic /boot/vmlinuz-3.0.0-16-generic
run-parts: executing /etc/kernel/postrm.d/zz-extlinux 3.0.0-16-generic /boot/vmlinuz-3.0.0-16-generic
P: Checking for EXTLINUX directory... found.
P: Writing config for /boot/vmlinuz-3.0.0-16-generic...
P: Updating /boot/extlinux/linux.cfg...
P: Installing debian theme...cp: cannot stat `/usr/share/syslinux/themes/debian-squeeze/extlinux/memtest.bin': No such file or directory
run-parts: /etc/kernel/postrm.d/zz-extlinux exited with return code 1
Failed to process /etc/kernel/postrm.d at /var/lib/dpkg/tmp.ci/postrm line 328.
dpkg: error while cleaning up:
 subprocess new post-removal script returned error exit status 1
Errors were encountered while processing:
 /var/cache/apt/archives/linux-image-3.0.0-15-generic_3.0.0-15.26_amd64.deb
 /var/cache/apt/archives/linux-image-3.0.0-16-generic_3.0.0-16.29_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

So I can't update, can't install new software, can't remove old software.

It's not a duplicate to this (https://answers.launchpad.net/ubuntu/+question/189569), because the solution that was provided there did not solve the problem for me.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu apt Edit question
Assignee:
No assignee Edit question
Solved by:
actionparsnip
Solved:
2012-03-16
Last query:
2012-03-16
Last reply:
2012-03-16
mfauzirahman (mfauzirahman) said : #1

please try below step

sudo apt-get clean
cd /var/lib/apt
sudo rm -rf lists.old
sudo mkdir -p lists/partial
sudo apt-get clean
sudo apt-get update

mfauzirahman (mfauzirahman) said : #2

or you can try to install kernel manually at http://kernel.ubuntu.com/~kernel-ppa/mainline/

Stovan (dusklykan) said : #3

I tried the steps and the result was the same as before.

Trying to use the .deb file resulted in this error from the Software Center:

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/aptdaemon/worker.py", line 968, in simulate
    trans.unauthenticated = self._simulate_helper(trans)
  File "/usr/lib/python2.7/dist-packages/aptdaemon/worker.py", line 1092, in _simulate_helper
    return depends, self._cache.required_download, \
  File "/usr/lib/python2.7/dist-packages/apt/cache.py", line 235, in required_download
    pm.get_archives(fetcher, self._list, self._records)
SystemError: E:I wasn't able to locate a file for the linux-image-3.0.0-16-generic package. This might mean you need to manually fix this package.

No matter if I tried 3.0.15 or 3.0.16.

Can you give the output of:

file /usr/share/syslinux/themes/debian-squeeze/extlinux/memtest.bin

Thanks

Stovan (dusklykan) said : #5

Here you go:

$ file /usr/share/syslinux/themes/debian-squeeze/extlinux/memtest.bin
/usr/share/syslinux/themes/debian-squeeze/extlinux/memtest.bin: broken symbolic link to `/boot/memtest86+.bin'

Try:

sudo apt-get --reinstall install memtest86+

Stovan (dusklykan) said : #7

Many thanks, this solved the problem!

Stovan (dusklykan) said : #8

Thanks actionparsnip, that solved my question.

All you have to do is read, when you get large outputs have a quick read and you can probably fix your own stuff sometimes :)

Luke Faraone (lfaraone) said : #10

I had to do #8 on upgrading from 12.04 to trusty, which resolved issues with my kernel being unable to be configured.