Cannot upgrade kernel on 12.04

Asked by Alfredo Todini

I am unable to upgrade the package linux-image on Ubuntu 12.04. When I type:

sudo apt-get upgrade

and get the following error:

Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be upgraded:
  linux-image-3.2.0-61-generic
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/38.7 MB of archives.
After this operation, 1,024 B of additional disk space will be used.
Do you want to continue [Y/n]? Y
(Reading database ... 549720 files and directories currently installed.)
Preparing to replace linux-image-3.2.0-61-generic 3.2.0-61.92 (using .../linux-image-3.2.0-61-generic_3.2.0-61.93_amd64.deb) ...
Done.
Unpacking replacement linux-image-3.2.0-61-generic ...
dpkg: error processing /var/cache/apt/archives/linux-image-3.2.0-61-generic_3.2.0-61.93_amd64.deb (--unpack):
 unable to make backup link of `./boot/System.map-3.2.0-61-generic' before installing new version: Operation not permitted
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 3.2.0-61-generic /boot/vmlinuz-3.2.0-61-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 3.2.0-61-generic /boot/vmlinuz-3.2.0-61-generic
Errors were encountered while processing:
 /var/cache/apt/archives/linux-image-3.2.0-61-generic_3.2.0-61.93_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

Thanks!

Best regards
Alfredo

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Manfred Hampl
Solved:
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :
#1

What is the output of :

lsb_release -a; uname -a; df -h

Thanks

Revision history for this message
Alfredo Todini (alfredo-todini) said :
#2

Hello,

here is the output:

alfredo@alfredo-CQ2903EG:~$ lsb_release -a; uname -a; df -h
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 12.04.4 LTS
Release: 12.04
Codename: precise
Linux alfredo-CQ2903EG 3.2.0-61-generic #92-Ubuntu SMP Mon Mar 31 23:47:59 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
Filesystem Size Used Avail Use% Mounted on
/dev/sda6 38G 8.0G 28G 23% /
udev 1.9G 4.0K 1.9G 1% /dev
tmpfs 383M 940K 382M 1% /run
none 5.0M 0 5.0M 0% /run/lock
none 1.9G 80K 1.9G 1% /run/shm
/dev/sda1 196M 93M 104M 48% /boot
/dev/sda5 412G 14G 377G 4% /home

Thanks!

Best regards,
Alfredo

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#3

Ok What is the output of:

uname -a; dpkg -l | grep linux-image

Thanks

Revision history for this message
Alfredo Todini (alfredo-todini) said :
#4

Hi,

the output is:

alfredo@alfredo-CQ2903EG:~$ uname -a; dpkg -l | grep linux-image
Linux alfredo-CQ2903EG 3.2.0-61-generic #92-Ubuntu SMP Mon Mar 31 23:47:59 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
ii linux-image 3.2.0.61.72 Generic Linux kernel image.
rc linux-image-3.2.0-54-generic 3.2.0-54.82 Linux kernel image for version 3.2.0 on 64 bit x86 SMP
rc linux-image-3.2.0-55-generic 3.2.0-55.85 Linux kernel image for version 3.2.0 on 64 bit x86 SMP
rc linux-image-3.2.0-56-generic 3.2.0-56.86 Linux kernel image for version 3.2.0 on 64 bit x86 SMP
ii linux-image-3.2.0-58-generic 3.2.0-58.88 Linux kernel image for version 3.2.0 on 64 bit x86 SMP
ii linux-image-3.2.0-59-generic 3.2.0-59.90 Linux kernel image for version 3.2.0 on 64 bit x86 SMP
ii linux-image-3.2.0-60-generic 3.2.0-60.91 Linux kernel image for version 3.2.0 on 64 bit x86 SMP
ii linux-image-3.2.0-61-generic 3.2.0-61.92 Linux kernel image for version 3.2.0 on 64 bit x86 SMP
ii linux-image-generic 3.2.0.61.72 Generic Linux kernel image

Thanks!

Best regards,
Alfredo

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#5

sudo dpkg -P linux-image-3.2.0-54-generic
sudo dpkg -P linux-image-3.2.0-55-generic
sudo dpkg -P linux-image-3.2.0-56-generic
sudo apt-get --purge remove linux-image-3.2.0-58-generic linux-image-3.2.0-59-generic
sudo apt-get --purge autoremove

Should help.

Revision history for this message
Alfredo Todini (alfredo-todini) said :
#6

Hi,

I ran the commands you suggested, but the problem is still there:

alfredo@alfredo-CQ2903EG:~$ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be upgraded:
  linux-image-3.2.0-61-generic
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/38.7 MB of archives.
After this operation, 1,024 B of additional disk space will be used.
Do you want to continue [Y/n]? Y
(Reading database ... 541444 files and directories currently installed.)
Preparing to replace linux-image-3.2.0-61-generic 3.2.0-61.92 (using .../linux-image-3.2.0-61-generic_3.2.0-61.93_amd64.deb) ...
Done.
Unpacking replacement linux-image-3.2.0-61-generic ...
dpkg: error processing /var/cache/apt/archives/linux-image-3.2.0-61-generic_3.2.0-61.93_amd64.deb (--unpack):
 unable to make backup link of `./boot/System.map-3.2.0-61-generic' before installing new version: Operation not permitted
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 3.2.0-61-generic /boot/vmlinuz-3.2.0-61-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 3.2.0-61-generic /boot/vmlinuz-3.2.0-61-generic
Errors were encountered while processing:
 /var/cache/apt/archives/linux-image-3.2.0-61-generic_3.2.0-61.93_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

The output of dpkg is now:

alfredo@alfredo-CQ2903EG:~$ uname -a; dpkg -l | grep linux-image
Linux alfredo-CQ2903EG 3.2.0-61-generic #92-Ubuntu SMP Mon Mar 31 23:47:59 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
ii linux-image 3.2.0.61.72 Generic Linux kernel image.
ii linux-image-3.2.0-60-generic 3.2.0-60.91 Linux kernel image for version 3.2.0 on 64 bit x86 SMP
ii linux-image-3.2.0-61-generic 3.2.0-61.92 Linux kernel image for version 3.2.0 on 64 bit x86 SMP
ii linux-image-generic 3.2.0.61.72 Generic Linux kernel image

Thanks!

Best regards,
Alfredo

Revision history for this message
Alfredo Todini (alfredo-todini) said :
#7

Hi,

I have added a link to a similar bug that was reported by another user. The reported bug affects a more recent version of Ubuntu, but the cause appears to be the same. The upgrade no longer works when /boot is on a FAT32 partition, because it is trying to create a link there. It is really frustrating that such a problem occurs on an LTS release, especially considering that I have had this system for more than a year, and never experienced it until now.

Best regards,
Alfredo

Revision history for this message
Best Manfred Hampl (m-hampl) said :
#8

It seems that during the upgrade of the kernel version (with the same kernel main version number but only a higher point version) the updater tries to create a link to the old kernel file, something that most probably is not done during installation of a kernel with a new main version number.

The following, maybe provides a workaround: Boot into a previous kernel version, uninstall the -61.92 kernel, and install -61.93 kernel from scratch.

Boot into the -60 kernel and issue the following commands:
sudo dpkg --purge linux-image-3.2.0-61-generic
sudo apt-get install linux-image-3.2.0-61-generic
sudo apt-get upgrade

Revision history for this message
Alfredo Todini (alfredo-todini) said :
#9

Hi,

I tried this and it worked, I was finally able to upgrade the kernel.
Thanks!

Best regards,
Alfredo