3

I am trying to clean up my /boot drive but I feel like I'm in a vicious circle. What I have tried so far is this:

$ df -h
/dev/xvda1                                   236M  230M     0 100% /boot

$ uname -r
3.19.0-64-generic

$ dpkg --list | grep linux-image
rc  linux-image-3.19.0-25-generic        3.19.0-25.26~14.04.1                amd64        Linux kernel image for version 3.19.0 on 64 bit x86 SMP 
ii  linux-image-3.19.0-49-generic        3.19.0-49.55~14.04.1                amd64        Linux kernel image for version 3.19.0 on 64 bit x86 SMP
ii  linux-image-3.19.0-51-generic        3.19.0-51.58~14.04.1                amd64        Linux kernel image for version 3.19.0 on 64 bit x86 SMP
ii  linux-image-3.19.0-56-generic        3.19.0-56.62~14.04.1                amd64        Linux kernel image for version 3.19.0 on 64 bit x86 SMP
ii  linux-image-3.19.0-58-generic        3.19.0-58.64~14.04.1                amd64        Linux kernel image for version 3.19.0 on 64 bit x86 SMP
ii  linux-image-3.19.0-59-generic        3.19.0-59.66~14.04.1                amd64        Linux kernel image for version 3.19.0 on 64 bit x86 SMP
ii  linux-image-3.19.0-61-generic        3.19.0-61.69~14.04.1                amd64        Linux kernel image for version 3.19.0 on 64 bit x86 SMP
ii  linux-image-3.19.0-64-generic        3.19.0-64.72~14.04.1                amd64        Linux kernel image for version 3.19.0 on 64 bit x86 SMP
rc  linux-image-extra-3.19.0-25-generic  3.19.0-25.26~14.04.1                amd64        Linux kernel extra modules for version 3.19.0 on 64 bit x86 SMP
ii  linux-image-extra-3.19.0-49-generic  3.19.0-49.55~14.04.1                amd64        Linux kernel extra modules for version 3.19.0 on 64 bit x86 SMP
ii  linux-image-extra-3.19.0-51-generic  3.19.0-51.58~14.04.1                amd64        Linux kernel extra modules for version 3.19.0 on 64 bit x86 SMP
ii  linux-image-extra-3.19.0-56-generic  3.19.0-56.62~14.04.1                amd64        Linux kernel extra modules for version 3.19.0 on 64 bit x86 SMP
ii  linux-image-extra-3.19.0-58-generic  3.19.0-58.64~14.04.1                amd64        Linux kernel extra modules for version 3.19.0 on 64 bit x86 SMP
ii  linux-image-extra-3.19.0-59-generic  3.19.0-59.66~14.04.1                amd64        Linux kernel extra modules for version 3.19.0 on 64 bit x86 SMP
ii  linux-image-extra-3.19.0-61-generic  3.19.0-61.69~14.04.1                amd64        Linux kernel extra modules for version 3.19.0 on 64 bit x86 SMP
iF  linux-image-extra-3.19.0-64-generic  3.19.0-64.72~14.04.1                amd64        Linux kernel extra modules for version 3.19.0 on 64 bit x86 SMP
rc  linux-image-extra-3.19.0-65-generic  3.19.0-65.73~14.04.1                amd64        Linux kernel extra modules for version 3.19.0 on 64 bit x86 SMP

And when I try to remove one unused kernel I get the following error:

$ sudo apt-get remove linux-image-3.19.0-49-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-headers-generic-lts-vivid : Depends: linux-headers-3.19.0-73-generic but it is not going to be installed
 linux-image-extra-3.19.0-49-generic : Depends: linux-image-3.19.0-49-generic but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

When I try to install unmet dependencies, I get the following error.

apt-get -f install
[...]
unable to create `/usr/src/linux-headers-3.19.0-73-generic/include/config/ath9k/common.h.dpkg-new' (while processing `./usr/src/linux-headers-3.19.0-73-generic/include/config/ath9k/common.h'): 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)
Errors were encountered while processing:
 /var/cache/apt/archives/linux-headers-3.19.0-73-generic_3.19.0-73.81~14.04.1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

any suggestion what I can do about it? Can I manually/safely increase the size of /boot drive? Cheers

0
0

According to the man page:

"autoremove is used to remove packages that were automatically installed to satisfy dependencies for other packages and are now no longer needed."

First try:

apt-get -s autoremove

This will do a simulated dry run of autoremove, which will tell you what it will remove for real when you run it without the -s option. If you are satsified it won't nuke anything you need, then:

apt-get autoremove

Note: it seems like your /boot partition is already completely full. You could run gparted from a live version CD (such as Knoppix) to redistribute your hard disk space and give /boot a bit more room.

3
  • apt-get -s autoremove or apt-get autoremove won't work for me. The error is as follows: 'The following packages have unmet dependencies: linux-headers-generic-lts-vivid : Depends: linux-headers-3.19.0-73-generic but it is not installed E: Unmet dependencies. Try using -f.'
    – Ege Ugur
    Oct 24 '16 at 17:07
  • and I am trying to work on my VPS, so I don't know how to usel ive version CD. Any other suggestions?
    – Ege Ugur
    Oct 24 '16 at 17:08
  • Did you try the -f option? Also, uname -r will tell you what kernel you are really using; it should not affect your VPS if you manually delete the initrd and vmlinuz files not in use. Deleting the initrd files from old sets in particular will free up a lot of hard disk space.
    – dbkeys
    Oct 24 '16 at 20:01

Not the answer you're looking for? Browse other questions tagged or ask your own question.