This morning, I wanted to apply latest updates on my Ubuntu desktop, but I wasn’t able to do the job, due to lake of disk space…

No sufficient space to update (112 MB required), how to fix this issue ?

Logon as “root” :

wou@ubuntu:~$ sudo bash

Purge unnecessary packages :

root@ubuntu:~# apt-get autoremove --purge
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  linux-headers-4.2.0-16* linux-headers-4.2.0-16-generic* linux-headers-4.2.0-34* linux-headers-4.2.0-34-generic* linux-headers-4.2.0-35*
  linux-headers-4.2.0-35-generic* linux-headers-4.2.0-36* linux-headers-4.2.0-36-generic* linux-headers-4.2.0-38* linux-headers-4.2.0-38-generic*
  linux-headers-4.2.0-41* linux-headers-4.2.0-41-generic* linux-headers-4.2.0-42* linux-headers-4.2.0-42-generic* linux-headers-4.4.0-38*
  linux-headers-4.4.0-38-generic* linux-headers-4.4.0-42* linux-headers-4.4.0-42-generic* linux-image-extra-4.4.0-43-generic* linux-signed-image-4.4.0-43-generic*
0 upgraded, 0 newly installed, 20 to remove and 92 not upgraded.
After this operation, 840 MB disk space will be freed.
Do you want to continue? [Y/n]  
(Reading database ... 499923 files and directories currently installed.)
Removing linux-headers-4.2.0-16-generic (4.2.0-16.19) ...
Removing linux-headers-4.2.0-16 (4.2.0-16.19) ...
Removing linux-headers-4.2.0-34-generic (4.2.0-34.39) ...
Removing linux-headers-4.2.0-34 (4.2.0-34.39) ...
Removing linux-headers-4.2.0-35-generic (4.2.0-35.40) ...
Removing linux-headers-4.2.0-35 (4.2.0-35.40) ...
Removing linux-headers-4.2.0-36-generic (4.2.0-36.42) ...
dpkg: warning: while removing linux-headers-4.2.0-36-generic, directory '/lib/modules/4.2.0-36-generic' not empty so not removed
Removing linux-headers-4.2.0-36 (4.2.0-36.42) ...
Removing linux-headers-4.2.0-38-generic (4.2.0-38.45) ...
Removing linux-headers-4.2.0-38 (4.2.0-38.45) ...
Removing linux-headers-4.2.0-41-generic (4.2.0-41.48) ...
Removing linux-headers-4.2.0-41 (4.2.0-41.48) ...
Removing linux-headers-4.2.0-42-generic (4.2.0-42.49) ...
Removing linux-headers-4.2.0-42 (4.2.0-42.49) ...
Removing linux-headers-4.4.0-38-generic (4.4.0-38.57) ...
Removing linux-headers-4.4.0-38 (4.4.0-38.57) ...
Removing linux-headers-4.4.0-42-generic (4.4.0-42.62) ...
Removing linux-headers-4.4.0-42 (4.4.0-42.62) ...
Removing linux-image-extra-4.4.0-43-generic (4.4.0-43.63) ...
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.4.0-43-generic /boot/vmlinuz-4.4.0-43-generic
run-parts: executing /etc/kernel/postinst.d/apt-dater-host_reboot 4.4.0-43-generic /boot/vmlinuz-4.4.0-43-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.4.0-43-generic /boot/vmlinuz-4.4.0-43-generic
update-initramfs: Generating /boot/initrd.img-4.4.0-43-generic
run-parts: executing /etc/kernel/postinst.d/pm-utils 4.4.0-43-generic /boot/vmlinuz-4.4.0-43-generic
run-parts: executing /etc/kernel/postinst.d/unattended-upgrades 4.4.0-43-generic /boot/vmlinuz-4.4.0-43-generic
run-parts: executing /etc/kernel/postinst.d/update-notifier 4.4.0-43-generic /boot/vmlinuz-4.4.0-43-generic
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 4.4.0-43-generic /boot/vmlinuz-4.4.0-43-generic
Generating grub configuration file ...
Warning: Setting GRUB_TIMEOUT to a non-zero value when GRUB_HIDDEN_TIMEOUT is set is no longer supported.
Found linux image: /boot/vmlinuz-4.4.0-47-generic
Found initrd image: /boot/initrd.img-4.4.0-47-generic
Found linux image: /boot/vmlinuz-4.4.0-45-generic
Found initrd image: /boot/initrd.img-4.4.0-45-generic
Found linux image: /boot/vmlinuz-4.4.0-43-generic
Found initrd image: /boot/initrd.img-4.4.0-43-generic
Adding boot menu entry for EFI firmware configuration
done
Purging configuration files for linux-image-extra-4.4.0-43-generic (4.4.0-43.63) ...
Removing linux-signed-image-4.4.0-43-generic (4.4.0-43.63) ...
Generating grub configuration file ...
Warning: Setting GRUB_TIMEOUT to a non-zero value when GRUB_HIDDEN_TIMEOUT is set is no longer supported.
Found linux image: /boot/vmlinuz-4.4.0-47-generic
Found initrd image: /boot/initrd.img-4.4.0-47-generic
Found linux image: /boot/vmlinuz-4.4.0-45-generic
Found initrd image: /boot/initrd.img-4.4.0-45-generic
Found linux image: /boot/vmlinuz-4.4.0-43-generic
Found initrd image: /boot/initrd.img-4.4.0-43-generic
Adding boot menu entry for EFI firmware configuration
done
Purging configuration files for linux-signed-image-4.4.0-43-generic (4.4.0-43.63) ...

Looks better :

root@ubuntu:~# df -hT /boot
Filesystem     Type  Size  Used Avail Use% Mounted on
/dev/sda2      ext2  237M  147M   78M  66% /boot

We can remove old Linux packages :

root@ubuntu:~# dpkg -l | grep "^ii *linux-"
ii  linux-base                                 4.0ubuntu1                                    all          Linux image base package
ii  linux-firmware                             1.157.5                                       all          Firmware for Linux kernel drivers
ii  linux-generic                              4.4.0.47.50                                   amd64        Complete Generic Linux kernel and headers
ii  linux-headers-4.4.0-43                     4.4.0-43.63                                   all          Header files related to Linux kernel version 4.4.0
ii  linux-headers-4.4.0-43-generic             4.4.0-43.63                                   amd64        Linux kernel headers for version 4.4.0 on 64 bit x86 SMP
ii  linux-headers-4.4.0-45                     4.4.0-45.66                                   all          Header files related to Linux kernel version 4.4.0
ii  linux-headers-4.4.0-45-generic             4.4.0-45.66                                   amd64        Linux kernel headers for version 4.4.0 on 64 bit x86 SMP
ii  linux-headers-4.4.0-47                     4.4.0-47.68                                   all          Header files related to Linux kernel version 4.4.0
ii  linux-headers-4.4.0-47-generic             4.4.0-47.68                                   amd64        Linux kernel headers for version 4.4.0 on 64 bit x86 SMP
ii  linux-headers-generic                      4.4.0.47.50                                   amd64        Generic Linux kernel headers
ii  linux-image-4.4.0-43-generic               4.4.0-43.63                                   amd64        Linux kernel image for version 4.4.0 on 64 bit x86 SMP
ii  linux-image-4.4.0-45-generic               4.4.0-45.66                                   amd64        Linux kernel image for version 4.4.0 on 64 bit x86 SMP
ii  linux-image-4.4.0-47-generic               4.4.0-47.68                                   amd64        Linux kernel image for version 4.4.0 on 64 bit x86 SMP
ii  linux-image-extra-4.4.0-45-generic         4.4.0-45.66                                   amd64        Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
ii  linux-image-extra-4.4.0-47-generic         4.4.0-47.68                                   amd64        Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
ii  linux-image-generic                        4.4.0.47.50                                   amd64        Generic Linux kernel image
ii  linux-libc-dev:amd64                       4.4.0-47.68                                   amd64        Linux Kernel Headers for development
ii  linux-signed-generic                       4.4.0.47.50                                   amd64        Complete Signed Generic Linux kernel and headers
ii  linux-signed-image-4.4.0-45-generic        4.4.0-45.66                                   amd64        Signed kernel image generic
ii  linux-signed-image-4.4.0-47-generic        4.4.0-47.68                                   amd64        Signed kernel image generic
ii  linux-signed-image-generic                 4.4.0.47.50                                   amd64        Signed Generic Linux kernel image
ii  linux-sound-base                           1.0.25+dfsg-0ubuntu5                          all          base package for ALSA and OSS sound systems

We remove “4.4.0-43” released packages :

root@ubuntu:~# dpkg -l | grep "^ii *linux-" | awk '/4.4.0-43/ {print $2}' | xargs dpkg --purge
(Reading database ... 261605 files and directories currently installed.)
Removing linux-headers-4.4.0-43-generic (4.4.0-43.63) ...
Removing linux-image-4.4.0-43-generic (4.4.0-43.63) ...
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 4.4.0-43-generic /boot/vmlinuz-4.4.0-43-generic
update-initramfs: Deleting /boot/initrd.img-4.4.0-43-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 4.4.0-43-generic /boot/vmlinuz-4.4.0-43-generic
Generating grub configuration file ...
Warning: Setting GRUB_TIMEOUT to a non-zero value when GRUB_HIDDEN_TIMEOUT is set is no longer supported.
Found linux image: /boot/vmlinuz-4.4.0-47-generic
Found initrd image: /boot/initrd.img-4.4.0-47-generic
Found linux image: /boot/vmlinuz-4.4.0-45-generic
Found initrd image: /boot/initrd.img-4.4.0-45-generic
Adding boot menu entry for EFI firmware configuration
done
Purging configuration files for linux-image-4.4.0-43-generic (4.4.0-43.63) ...
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 4.4.0-43-generic /boot/vmlinuz-4.4.0-43-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 4.4.0-43-generic /boot/vmlinuz-4.4.0-43-generic
Removing linux-headers-4.4.0-43 (4.4.0-43.63) ...

We get more free space :

root@ubuntu:~# df -hT /boot
Filesystem Type Size Used Avail Use% Mounted on
/dev/sda2 ext2 237M 122M 103M 55% /boot

But not sufficient,we remove “4.4.0-45” released packages as well :

root@ubuntu:~# dpkg -l | grep "^ii *linux-" | awk '/4.4.0-45/ {print $2}' | xargs dpkg --purge
(Reading database ... 233897 files and directories currently installed.)
Removing linux-headers-4.4.0-45-generic (4.4.0-45.66) ...
Removing linux-image-extra-4.4.0-45-generic (4.4.0-45.66) ...
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.4.0-45-generic /boot/vmlinuz-4.4.0-45-generic
run-parts: executing /etc/kernel/postinst.d/apt-dater-host_reboot 4.4.0-45-generic /boot/vmlinuz-4.4.0-45-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.4.0-45-generic /boot/vmlinuz-4.4.0-45-generic
update-initramfs: Generating /boot/initrd.img-4.4.0-45-generic
run-parts: executing /etc/kernel/postinst.d/pm-utils 4.4.0-45-generic /boot/vmlinuz-4.4.0-45-generic
run-parts: executing /etc/kernel/postinst.d/unattended-upgrades 4.4.0-45-generic /boot/vmlinuz-4.4.0-45-generic
run-parts: executing /etc/kernel/postinst.d/update-notifier 4.4.0-45-generic /boot/vmlinuz-4.4.0-45-generic
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 4.4.0-45-generic /boot/vmlinuz-4.4.0-45-generic
Generating grub configuration file ...
Warning: Setting GRUB_TIMEOUT to a non-zero value when GRUB_HIDDEN_TIMEOUT is set is no longer supported.
Found linux image: /boot/vmlinuz-4.4.0-47-generic
Found initrd image: /boot/initrd.img-4.4.0-47-generic
Found linux image: /boot/vmlinuz-4.4.0-45-generic
Found initrd image: /boot/initrd.img-4.4.0-45-generic
Adding boot menu entry for EFI firmware configuration
done
Purging configuration files for linux-image-extra-4.4.0-45-generic (4.4.0-45.66) ...
Removing linux-signed-image-4.4.0-45-generic (4.4.0-45.66) ...
Generating grub configuration file ...
Warning: Setting GRUB_TIMEOUT to a non-zero value when GRUB_HIDDEN_TIMEOUT is set is no longer supported.
Found linux image: /boot/vmlinuz-4.4.0-47-generic
Found initrd image: /boot/initrd.img-4.4.0-47-generic
Found linux image: /boot/vmlinuz-4.4.0-45-generic
Found initrd image: /boot/initrd.img-4.4.0-45-generic
Adding boot menu entry for EFI firmware configuration
done
Purging configuration files for linux-signed-image-4.4.0-45-generic (4.4.0-45.66) ...
Removing linux-headers-4.4.0-45 (4.4.0-45.66) ...
Removing linux-image-4.4.0-45-generic (4.4.0-45.66) ...
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 4.4.0-45-generic /boot/vmlinuz-4.4.0-45-generic
update-initramfs: Deleting /boot/initrd.img-4.4.0-45-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 4.4.0-45-generic /boot/vmlinuz-4.4.0-45-generic
Generating grub configuration file ...
Warning: Setting GRUB_TIMEOUT to a non-zero value when GRUB_HIDDEN_TIMEOUT is set is no longer supported.
Found linux image: /boot/vmlinuz-4.4.0-47-generic
Found initrd image: /boot/initrd.img-4.4.0-47-generic
Adding boot menu entry for EFI firmware configuration
done
The link /vmlinuz.old is a damaged link
Removing symbolic link vmlinuz.old 
 you may need to re-run your boot loader[grub]
The link /initrd.img.old is a damaged link
Removing symbolic link initrd.img.old 
 you may need to re-run your boot loader[grub]
Purging configuration files for linux-image-4.4.0-45-generic (4.4.0-45.66) ...
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 4.4.0-45-generic /boot/vmlinuz-4.4.0-45-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 4.4.0-45-generic /boot/vmlinuz-4.4.0-45-generic

YES ! We have now 156 MB free space :

root@ubuntu:~# df -hT /boot
Filesystem     Type  Size  Used Avail Use% Mounted on
/dev/sda2      ext2  237M   66M  159M  30% /boot

 

en.pdf24.org    Send article as PDF   

Leave a Reply

Your email address will not be published. Required fields are marked *


*