1

Im having trouble with free space in the boot partition and have followed the instructions in several other questions but still dont get good results. I keep having the same error when I try to remove old packages and stuff. If someone could helpme, find my outputs posted:

ornendil@Galla:~$ ls /boot
abi-4.4.0-51-generic     config-4.4.0-66-generic      memtest86+.elf                       vmlinuz-4.4.0-57-generic
abi-4.4.0-53-generic     config-4.4.0-70-generic      memtest86+_multiboot.bin             vmlinuz-4.4.0-57-generic.efi.signed
abi-4.4.0-57-generic     efi                          System.map-4.4.0-51-generic          vmlinuz-4.4.0-59-generic
abi-4.4.0-59-generic     grub                         System.map-4.4.0-53-generic          vmlinuz-4.4.0-59-generic.efi.signed
abi-4.4.0-63-generic     initrd.img-4.4.0-51-generic  System.map-4.4.0-57-generic          vmlinuz-4.4.0-63-generic
abi-4.4.0-64-generic     initrd.img-4.4.0-53-generic  System.map-4.4.0-59-generic          vmlinuz-4.4.0-63-generic.efi.signed
abi-4.4.0-66-generic     initrd.img-4.4.0-57-generic  System.map-4.4.0-63-generic          vmlinuz-4.4.0-64-generic
abi-4.4.0-70-generic     initrd.img-4.4.0-59-generic  System.map-4.4.0-64-generic          vmlinuz-4.4.0-64-generic.efi.signed
config-4.4.0-51-generic  initrd.img-4.4.0-63-generic  System.map-4.4.0-66-generic          vmlinuz-4.4.0-66-generic
config-4.4.0-53-generic  initrd.img-4.4.0-64-generic  System.map-4.4.0-70-generic          vmlinuz-4.4.0-66-generic.efi.signed
config-4.4.0-57-generic  initrd.img-4.4.0-66-generic  vmlinuz-4.4.0-51-generic             vmlinuz-4.4.0-70-generic
config-4.4.0-59-generic  initrd.img-4.4.0-70-generic  vmlinuz-4.4.0-51-generic.efi.signed  vmlinuz-4.4.0-70-generic.efi.signed
config-4.4.0-63-generic  lost+found                   vmlinuz-4.4.0-53-generic
config-4.4.0-64-generic  memtest86+.bin               vmlinuz-4.4.0-53-generic.efi.signed
ornendil@Galla:~$ dpkg -l | grep linux-image
rc  linux-image-4.4.0-21-generic                4.4.0-21.37                                   amd64        Linux kernel image for version 4.4.0 on 64 bit x86 SMP
rc  linux-image-4.4.0-28-generic                4.4.0-28.47                                   amd64        Linux kernel image for version 4.4.0 on 64 bit x86 SMP
rc  linux-image-4.4.0-31-generic                4.4.0-31.50                                   amd64        Linux kernel image for version 4.4.0 on 64 bit x86 SMP
rc  linux-image-4.4.0-36-generic                4.4.0-36.55                                   amd64        Linux kernel image for version 4.4.0 on 64 bit x86 SMP
rc  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
rc  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-4.4.0-51-generic                4.4.0-51.72                                   amd64        Linux kernel image for version 4.4.0 on 64 bit x86 SMP
ii  linux-image-4.4.0-53-generic                4.4.0-53.74                                   amd64        Linux kernel image for version 4.4.0 on 64 bit x86 SMP
ii  linux-image-4.4.0-57-generic                4.4.0-57.78                                   amd64        Linux kernel image for version 4.4.0 on 64 bit x86 SMP
ii  linux-image-4.4.0-59-generic                4.4.0-59.80                                   amd64        Linux kernel image for version 4.4.0 on 64 bit x86 SMP
ii  linux-image-4.4.0-63-generic                4.4.0-63.84                                   amd64        Linux kernel image for version 4.4.0 on 64 bit x86 SMP
ii  linux-image-4.4.0-64-generic                4.4.0-64.85                                   amd64        Linux kernel image for version 4.4.0 on 64 bit x86 SMP
ii  linux-image-4.4.0-66-generic                4.4.0-66.87                                   amd64        Linux kernel image for version 4.4.0 on 64 bit x86 SMP
ii  linux-image-4.4.0-70-generic                4.4.0-70.91                                   amd64        Linux kernel image for version 4.4.0 on 64 bit x86 SMP
rc  linux-image-extra-4.4.0-21-generic          4.4.0-21.37                                   amd64        Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
rc  linux-image-extra-4.4.0-28-generic          4.4.0-28.47                                   amd64        Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
rc  linux-image-extra-4.4.0-31-generic          4.4.0-31.50                                   amd64        Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
rc  linux-image-extra-4.4.0-36-generic          4.4.0-36.55                                   amd64        Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
rc  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-extra-4.4.0-51-generic          4.4.0-51.72                                   amd64        Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
ii  linux-image-extra-4.4.0-53-generic          4.4.0-53.74                                   amd64        Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
ii  linux-image-extra-4.4.0-57-generic          4.4.0-57.78                                   amd64        Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
ii  linux-image-extra-4.4.0-59-generic          4.4.0-59.80                                   amd64        Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
ii  linux-image-extra-4.4.0-63-generic          4.4.0-63.84                                   amd64        Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
ii  linux-image-extra-4.4.0-64-generic          4.4.0-64.85                                   amd64        Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
ii  linux-image-extra-4.4.0-66-generic          4.4.0-66.87                                   amd64        Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
iF  linux-image-extra-4.4.0-70-generic          4.4.0-70.91                                   amd64        Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
rH  linux-image-extra-4.4.0-72-generic          4.4.0-72.93                                   amd64        Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
pH  linux-image-extra-4.4.0-75-generic          4.4.0-75.96                                   amd64        Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
pU  linux-image-extra-4.4.0-77-generic          4.4.0-77.98                                   amd64        Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
pU  linux-image-generic                         4.4.0.77.83                                   amd64        Generic Linux kernel image

ornendil@Galla:~$ sudo apt-get purge linux-image-4.4.0-28-generic
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
 linux-image-extra-4.4.0-77-generic : Depends: linux-image-4.4.0-77-generic but it is not going to be installed
 linux-image-generic : Depends: linux-image-4.4.0-77-generic but it is not going to be installed
 linux-signed-image-4.4.0-77-generic : Depends: linux-image-4.4.0-77-generic (= 4.4.0-77.98) but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

And it happens to every package I try to remove. Im on the 4.4.0.70

ornendil@Galla:~$ uname -r
4.4.0-70-generic

As requested:

ornendil@Galla:~$ sudo apt install -f
[sudo] password for ornendil: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
  linux-headers-4.4.0-75 linux-headers-4.4.0-75-generic linux-image-4.4.0-75-generic linux-image-extra-4.4.0-75-generic
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  linux-image-4.4.0-72-generic linux-image-4.4.0-75-generic linux-image-4.4.0-77-generic
Suggested packages:
  fdutils linux-doc-4.4.0 | linux-source-4.4.0 linux-tools
The following NEW packages will be installed:
  linux-image-4.4.0-72-generic linux-image-4.4.0-75-generic linux-image-4.4.0-77-generic
0 upgraded, 3 newly installed, 0 to remove and 107 not upgraded.
9 not fully installed or removed.
Need to get 0 B/137 MB of archives.
After this operation, 200 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
(Reading database ... 640358 files and directories currently installed.)
Preparing to unpack .../linux-image-4.4.0-77-generic_4.4.0-77.98_amd64.deb ...
Examining /etc/kernel/preinst.d/
run-parts: executing /etc/kernel/preinst.d/intel-microcode 4.4.0-77-generic /boot/vmlinuz-4.4.0-77-generic
Done.
Unpacking linux-image-4.4.0-77-generic (4.4.0-77.98) ...
dpkg: error processing archive /var/cache/apt/archives/linux-image-4.4.0-77-generic_4.4.0-77.98_amd64.deb (--unpack):
 cannot copy extracted data for './boot/vmlinuz-4.4.0-77-generic' to '/boot/vmlinuz-4.4.0-77-generic.dpkg-new': failed to write (No space left on device)
No apport report written because the error message indicates a disk full error
                                                                              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 4.4.0-77-generic /boot/vmlinuz-4.4.0-77-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 4.4.0-77-generic /boot/vmlinuz-4.4.0-77-generic
Preparing to unpack .../linux-image-4.4.0-72-generic_4.4.0-72.93_amd64.deb ...
Examining /etc/kernel/preinst.d/
run-parts: executing /etc/kernel/preinst.d/intel-microcode 4.4.0-72-generic /boot/vmlinuz-4.4.0-72-generic
Done.
Unpacking linux-image-4.4.0-72-generic (4.4.0-72.93) ...
dpkg: error processing archive /var/cache/apt/archives/linux-image-4.4.0-72-generic_4.4.0-72.93_amd64.deb (--unpack):
 cannot copy extracted data for './boot/vmlinuz-4.4.0-72-generic' to '/boot/vmlinuz-4.4.0-72-generic.dpkg-new': failed to write (No space left on device)
No apport report written because the error message indicates a disk full error
                                                                              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 4.4.0-72-generic /boot/vmlinuz-4.4.0-72-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 4.4.0-72-generic /boot/vmlinuz-4.4.0-72-generic
Preparing to unpack .../linux-image-4.4.0-75-generic_4.4.0-75.96_amd64.deb ...
Examining /etc/kernel/preinst.d/
run-parts: executing /etc/kernel/preinst.d/intel-microcode 4.4.0-75-generic /boot/vmlinuz-4.4.0-75-generic
Done.
Unpacking linux-image-4.4.0-75-generic (4.4.0-75.96) ...
dpkg: error processing archive /var/cache/apt/archives/linux-image-4.4.0-75-generic_4.4.0-75.96_amd64.deb (--unpack):
 cannot copy extracted data for './boot/vmlinuz-4.4.0-75-generic' to '/boot/vmlinuz-4.4.0-75-generic.dpkg-new': failed to write (No space left on device)
No apport report written because the error message indicates a disk full error
                                                                              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 4.4.0-75-generic /boot/vmlinuz-4.4.0-75-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 4.4.0-75-generic /boot/vmlinuz-4.4.0-75-generic
Errors were encountered while processing:
 /var/cache/apt/archives/linux-image-4.4.0-77-generic_4.4.0-77.98_amd64.deb
 /var/cache/apt/archives/linux-image-4.4.0-72-generic_4.4.0-72.93_amd64.deb
 /var/cache/apt/archives/linux-image-4.4.0-75-generic_4.4.0-75.96_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
ornendil@Galla:~$ sudo apt autoremove
[sudo] password for ornendil: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt-get -f install' to correct these.
The following packages have unmet dependencies:
 linux-image-extra-4.4.0-72-generic : Depends: linux-image-4.4.0-72-generic but it is not installed
 linux-image-extra-4.4.0-75-generic : Depends: linux-image-4.4.0-75-generic but it is not installed
 linux-image-extra-4.4.0-77-generic : Depends: linux-image-4.4.0-77-generic but it is not installed
 linux-image-generic : Depends: linux-image-4.4.0-77-generic but it is not installed
 linux-signed-image-4.4.0-77-generic : Depends: linux-image-4.4.0-77-generic (= 4.4.0-77.98) but it is not installed
E: Unmet dependencies. Try using -f.
ornendil@Galla:~$ sudo apt update
Hit:1 http://cr.archive.ubuntu.com/ubuntu xenial InRelease
Get:2 http://cr.archive.ubuntu.com/ubuntu xenial-updates InRelease [102 kB]                              
Get:3 http://cr.archive.ubuntu.com/ubuntu xenial-backports InRelease [102 kB]                                                                 
Get:4 http://security.ubuntu.com/ubuntu xenial-security InRelease [102 kB]                                                         
Hit:5 http://archive.ubuntu.com/ubuntu xenial InRelease                           
Get:6 http://cr.archive.ubuntu.com/ubuntu xenial-updates/main amd64 DEP-11 Metadata [288 kB]
Get:7 http://cr.archive.ubuntu.com/ubuntu xenial-updates/main DEP-11 64x64 Icons [192 kB]           
Get:8 http://cr.archive.ubuntu.com/ubuntu xenial-updates/universe amd64 DEP-11 Metadata [160 kB]
Get:9 http://security.ubuntu.com/ubuntu xenial-security/main amd64 DEP-11 Metadata [54,6 kB]
Get:10 http://cr.archive.ubuntu.com/ubuntu xenial-updates/universe DEP-11 64x64 Icons [188 kB]              
Get:11 http://cr.archive.ubuntu.com/ubuntu xenial-updates/multiverse amd64 DEP-11 Metadata [2 516 B]         
Get:12 http://cr.archive.ubuntu.com/ubuntu xenial-backports/main amd64 DEP-11 Metadata [3 324 B]
Get:13 http://security.ubuntu.com/ubuntu xenial-security/main DEP-11 64x64 Icons [50,7 kB]                      
Get:14 http://security.ubuntu.com/ubuntu xenial-security/universe amd64 DEP-11 Metadata [32,2 kB]
Get:15 http://security.ubuntu.com/ubuntu xenial-security/universe DEP-11 64x64 Icons [36,9 kB]
Fetched 1 315 kB in 4s (279 kB/s)                                  
Reading package lists... Done
Building dependency tree       
Reading state information... Done
107 packages can be upgraded. Run 'apt list --upgradable' to see them.
ornendil@Galla:~$ sudo apt autoremove
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt-get -f install' to correct these.
The following packages have unmet dependencies:
 linux-image-extra-4.4.0-72-generic : Depends: linux-image-4.4.0-72-generic but it is not installed
 linux-image-extra-4.4.0-75-generic : Depends: linux-image-4.4.0-75-generic but it is not installed
 linux-image-extra-4.4.0-77-generic : Depends: linux-image-4.4.0-77-generic but it is not installed
 linux-image-generic : Depends: linux-image-4.4.0-77-generic but it is not installed
 linux-signed-image-4.4.0-77-generic : Depends: linux-image-4.4.0-77-generic (= 4.4.0-77.98) but it is not installed
E: Unmet dependencies. Try using -f.

and the did:

ornendil@Galla:~$ sudo dpkg --remove linux-image-4.4.0-21-generic
dpkg: warning: ignoring request to remove linux-image-4.4.0-21-generic, only the config
 files of which are on the system; use --purge to remove them too
ornendil@Galla:~$ sudo dpkg --remove --purge linux-image-4.4.0-51-generic
dpkg: error: conflicting actions -P (--purge) and -r (--remove)

Type dpkg --help for help about installing and deinstalling packages [*];
Use 'apt' or 'aptitude' for user-friendly package management;
Type dpkg -Dhelp for a list of dpkg debug flag values;
Type dpkg --force-help for a list of forcing options;
Type dpkg-deb --help for help about manipulating *.deb files;

Options marked [*] produce a lot of output - pipe it through 'less' or 'more' !
ornendil@Galla:~$ sudo dpkg --remove --force-remove-reinstreq linux-image-4.4.0-51-generic
dpkg: dependency problems prevent removal of linux-image-4.4.0-51-generic:
 linux-image-extra-4.4.0-51-generic depends on linux-image-4.4.0-51-generic.
 linux-signed-image-4.4.0-51-generic depends on linux-image-4.4.0-51-generic (= 4.4.0-51.72).

dpkg: error processing package linux-image-4.4.0-51-generic (--remove):
 dependency problems - not removing
Errors were encountered while processing:
 linux-image-4.4.0-51-generic
ornendil@Galla:~$ sudo dpkg --configure -a
Setting up linux-image-extra-4.4.0-70-generic (4.4.0-70.91) ...
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.4.0-70-generic /boot/vmlinuz-4.4.0-70-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.4.0-70-generic /boot/vmlinuz-4.4.0-70-generic
update-initramfs: Generating /boot/initrd.img-4.4.0-70-generic

gzip: stdout: No space left on device
E: mkinitramfs failure find 141 cpio 141 gzip 1
update-initramfs: failed for /boot/initrd.img-4.4.0-70-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
dpkg: error processing package linux-image-extra-4.4.0-70-generic (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of linux-signed-image-generic:
 linux-signed-image-generic depends on linux-signed-image-4.4.0-77-generic; however:
  Package linux-signed-image-4.4.0-77-generic is not configured yet.
 linux-signed-image-generic depends on linux-image-extra-4.4.0-77-generic; however:
  Package linux-image-extra-4.4.0-77-generic is not configured yet.

dpkg: error processing package linux-signed-image-generic (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-generic:
 linux-generic depends on linux-image-generic (= 4.4.0.77.83); however:
  Package linux-image-generic is not configured yet.

dpkg: error processing package linux-generic (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-signed-generic:
 linux-signed-generic depends on linux-signed-image-generic (= 4.4.0.77.83); however:
  Package linux-signed-image-generic is not configured yet.

dpkg: error processing package linux-signed-generic (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 linux-image-extra-4.4.0-70-generic
 linux-signed-image-generic
 linux-generic
 linux-signed-generic
ornendil@Galla:~$ sudo dpkg-reconfigure -a
Unknown option: a
Usage: dpkg-reconfigure [options] packages
  -u,  --unseen-only        Show only not yet seen questions.
       --default-priority   Use default priority instead of low.
       --force          Force reconfiguration of broken packages.
       --no-reload      Do not reload templates. (Use with caution.)
  -f,  --frontend       Specify debconf frontend to use.
  -p,  --priority       Specify minimum priority question to show.
       --terse          Enable terse mode.
15
  • Please first do sudo apt install -f, then sudo apt autoremove, after sudo apt update then sudo apt autoremove again and test to see ... May 3, 2017 at 20:12
  • Hi @ornendil - try sudo dpkg --remove linux-image-4.4.0-21-generic - if that works, follow it with sudo dpkg --remove linux-image-4.4.0-28-generic. Hopefully, if you remove those it will free enough space to run sudo apt-get install -f, and then I would encourage the sudo apt-get autoremove May 3, 2017 at 20:16
  • @CharlesGreen, the first command didnt work. See it up.
    – DrewHdz
    May 3, 2017 at 20:51
  • K - try modifying the command with the purge option: sudo dpkg --remove --purge linux-image-4.4.0-21-generic, and also try this for more recent kernel versions. Once you get to about 50 to 100 MB free, you should be able to get apt-get to function properly. May 3, 2017 at 22:27
  • 1
    run sudo apt clean, this app has the ability to remove old kernels: github.com/gaining/Resetter but you have to use custom reset to not lose other stuff. May 5, 2017 at 23:27

3 Answers 3

3

Give the package manager some working room by zeroing some old initrd..., vmlinuz..., and System.map... file. Assuming you are running on vmlinuz-4.4.0-70, keep all the ...70 files and the previous kernel, the ...66 files. If ...70 is not the kernel you are running, then keep the one you are running too. Now you can use an echo command to zero the files you don't want e.g.:

sudo echo >/boot/initrd.img-4.4.0-51-generic
sudo echo >/boot/vmlinuz-4.4.0-51-generic
sudo echo >/boot/vmlinuz-4.4.0-51-generic.efi.signed  
sudo echo >/boot/System.map-4.4.0-51-generic
sudo echo >/boot/abi-4.4.0-51-generic

etc.
When you have some space, try the previously suggested purge/remove commands.

Simply removing the files will cause the package manager to panic, and refuse to do anything, but a zero length file is acceptable, so it should complete. Looks like you have piled up a whole queue of things to install, they may refill the /boot. Be prepared to do more zeroing if that happens.


If you should delete a file that you wanted by accident, the package should still be around, and may be restored with another install or reconfigure.


The downloaded packages are put into directory /var/cache/apt/archives, so if your missing file has its package there, try

 sudo dpkg-reconfigure thepackage

There are a variety of other suggestions above to clean up, but worst case, you might have to create the empty files needed, purge the package, then just install it again.

3
  • Thanks for this. Something went good, only that I still have minors problems.
    – DrewHdz
    May 10, 2017 at 15:09
  • What happens if I, accidentally, delete files that are actually needed? Can I restore them?
    – DrewHdz
    May 10, 2017 at 16:06
  • Would you please help know how to restore the deleted file by accident? Or redirect me to an older question that explains it, plz.
    – DrewHdz
    May 17, 2017 at 3:48
2

The boot partition is full of the old linux releases. I had the same issue about a month ago because I was lazy about autoremove.

sudo apt-get autoremove

Will clean up everything that's not needed any longer, including those. Only after you have cleaned up some space, will apt work to fix or install other things.

After running the above command, I was then able to do:

sudo apt-get install -f

And then finally update and upgrade with

sudo apt-get update
sudo apt-get upgrade
1
  • Hello, off course Ive tried it before, and it still doesnt works.
    – DrewHdz
    May 5, 2017 at 23:27
0

I would try the same clean uninstall with aptitude or then dpkg (purge?), but why not just delete the file, and then the corresponding modules in /lib/modules. Maybe you need to move some big files to another storage temporarily, to make space to execute "apt-get -f install". Why having such a lot of kernels anyway, please just keep some milestones, and the latest ones.

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