LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 07-11-2015, 08:14 PM   #1
wh33t
Member
 
Registered: Oct 2003
Location: Canada
Posts: 720

Rep: Reputation: 47
Cool /boot is full, can't do any updates and can't autoremove, please help


Hi LQ,

So I've got an issue where my /boot is full and cannot do any updates/installs anymore. When I try to autoremove it tells me that I have to unmet dependencies:

Code:
guy@server:/boot$ sudo apt-get 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-3.13.0-44-generic : Depends: linux-image-3.13.0-44-generic but it is not installed
 linux-image-extra-3.13.0-57-generic : Depends: linux-image-3.13.0-57-generic but it is not installed
 linux-image-generic : Depends: linux-image-3.13.0-57-generic but it is not installed
E: Unmet dependencies. Try using -f.
Then the output of -f install

Code:
guy@server:/boot$ sudo apt-get 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-3.13.0-44-generic : Depends: linux-image-3.13.0-44-generic but it is not installed
 linux-image-extra-3.13.0-57-generic : Depends: linux-image-3.13.0-57-generic but it is not installed
 linux-image-generic : Depends: linux-image-3.13.0-57-generic but it is not installed
E: Unmet dependencies. Try using -f.
guy@server:/boot$ sudo apt-get -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following extra packages will be installed:
  linux-image-3.13.0-44-generic linux-image-3.13.0-57-generic
Suggested packages:
  fdutils linux-doc-3.13.0 linux-source-3.13.0 linux-tools
The following NEW packages will be installed:
  linux-image-3.13.0-44-generic linux-image-3.13.0-57-generic
0 upgraded, 2 newly installed, 0 to remove and 76 not upgraded.
63 not fully installed or removed.
Need to get 0 B/67.0 MB of archives.
After this operation, 84.6 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Setting up libapt-pkg4.12:amd64 (1.0.1ubuntu2.8) ...
Processing triggers for libc-bin (2.19-0ubuntu6.6) ...
(Reading database ... 322381 files and directories currently installed.)
Preparing to unpack .../linux-image-3.13.0-57-generic_3.13.0-57.95_amd64.deb ...
Done.
Unpacking linux-image-3.13.0-57-generic (3.13.0-57.95) ...
dpkg: error processing archive /var/cache/apt/archives/linux-image-3.13.0-57-generic_3.13.0-57.95_amd64.deb (--unpack):
 cannot copy extracted data for './boot/vmlinuz-3.13.0-57-generic' to '/boot/vmlinuz-3.13.0-57-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 3.13.0-57-generic /boot/vmlinuz-3.13.0-57-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 3.13.0-57-generic /boot/vmlinuz-3.13.0-57-generic
Preparing to unpack .../linux-image-3.13.0-44-generic_3.13.0-44.73_amd64.deb ...
Done.
Unpacking linux-image-3.13.0-44-generic (3.13.0-44.73) ...
dpkg: error processing archive /var/cache/apt/archives/linux-image-3.13.0-44-generic_3.13.0-44.73_amd64.deb (--unpack):
 cannot copy extracted data for './boot/vmlinuz-3.13.0-44-generic' to '/boot/vmlinuz-3.13.0-44-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 3.13.0-44-generic /boot/vmlinuz-3.13.0-44-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 3.13.0-44-generic /boot/vmlinuz-3.13.0-44-generic
Errors were encountered while processing:
 /var/cache/apt/archives/linux-image-3.13.0-57-generic_3.13.0-57.95_amd64.deb
 /var/cache/apt/archives/linux-image-3.13.0-44-generic_3.13.0-44.73_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
Finally, the contents of /boot, so I figure I just need to manually remove some stuff from here but not sure what exactly. Any ideas?

Code:
guy@server:/boot$ ls
abi-3.13.0-32-generic     grub                          System.map-3.13.0-36-generic
abi-3.13.0-35-generic     initrd.img-3.13.0-32-generic  System.map-3.13.0-37-generic
abi-3.13.0-36-generic     initrd.img-3.13.0-35-generic  System.map-3.13.0-39-generic
abi-3.13.0-37-generic     initrd.img-3.13.0-36-generic  System.map-3.13.0-40-generic
abi-3.13.0-39-generic     initrd.img-3.13.0-37-generic  System.map-3.13.0-43-generic
abi-3.13.0-40-generic     initrd.img-3.13.0-39-generic  System.map-3.13.0-46-generic
abi-3.13.0-43-generic     initrd.img-3.13.0-40-generic  vmlinuz-3.13.0-32-generic
abi-3.13.0-46-generic     initrd.img-3.13.0-43-generic  vmlinuz-3.13.0-35-generic
config-3.13.0-32-generic  initrd.img-3.13.0-48-generic  vmlinuz-3.13.0-36-generic
config-3.13.0-35-generic  initrd.img-3.13.0-49-generic  vmlinuz-3.13.0-37-generic
config-3.13.0-36-generic  lost+found                    vmlinuz-3.13.0-39-generic
config-3.13.0-37-generic  memtest86+.bin                vmlinuz-3.13.0-40-generic
config-3.13.0-39-generic  memtest86+.elf                vmlinuz-3.13.0-43-generic
config-3.13.0-40-generic  memtest86+_multiboot.bin      vmlinuz-3.13.0-46-generic
config-3.13.0-43-generic  System.map-3.13.0-32-generic
config-3.13.0-46-generic  System.map-3.13.0-35-generic

Last edited by wh33t; 07-11-2015 at 08:15 PM.
 
Old 07-11-2015, 08:23 PM   #2
portaro
LQ Newbie
 
Registered: Mar 2015
Location: Portugal
Distribution: Ubuntu
Posts: 28

Rep: Reputation: Disabled
Maybe you can try remove some game or other tool, or themes, or older kernels that you dont need anymore.

Then try to force install and see if work.
 
Old 07-11-2015, 08:26 PM   #3
berndbausch
Senior Member
 
Registered: Nov 2013
Location: Tokyo
Distribution: Redhat/Centos, Ubuntu, Raspbian, Fedora
Posts: 2,048

Rep: Reputation: 438Reputation: 438Reputation: 438Reputation: 438Reputation: 438
That's a lot of stuff in /boot. Perhaps removing a few of the older kernels is acceptable? I don't know what the packages are called, but you could do a dpkg -l | grep 3.-generic to see the packages for the kernels with numbers 32 to 39, then apt-get remove them.

If there are no such packages, I would risk removing the oldest vmlinuz and initrd files; that should make enough room for now. You do have to clean up at some point though.

First check what's the default kernel in grub, so that you don't remove that by accident. It wouldn't be catastrophical, but require more work to fix it.
 
1 members found this post helpful.
Old 07-11-2015, 10:04 PM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 17,736

Rep: Reputation: 2381Reputation: 2381Reputation: 2381Reputation: 2381Reputation: 2381Reputation: 2381Reputation: 2381Reputation: 2381Reputation: 2381Reputation: 2381Reputation: 2381
Yes, Ubuntu does not automatically remove old kernels. You can a couple of methods by searching. Make sure you don't erase the latest.

https://help.ubuntu.com/community/Lu...moveOldKernels
 
1 members found this post helpful.
Old 07-12-2015, 06:31 PM   #5
wh33t
Member
 
Registered: Oct 2003
Location: Canada
Posts: 720

Original Poster
Rep: Reputation: 47
Thanks for suggestions guys. Is there some reason I need more than one file /boot? Is that all kernels in there?

Here is some output

Code:
guy@server:~$ uname -r
3.13.0-43-generic
guy@server:~$ ls /boot
abi-3.13.0-32-generic         initrd.img-3.13.0-43-generic
abi-3.13.0-35-generic         initrd.img-3.13.0-48-generic
abi-3.13.0-36-generic         initrd.img-3.13.0-49-generic
abi-3.13.0-37-generic         lost+found
abi-3.13.0-39-generic         memtest86+.bin
abi-3.13.0-40-generic         memtest86+.elf
abi-3.13.0-43-generic         memtest86+_multiboot.bin
abi-3.13.0-46-generic         System.map-3.13.0-32-generic
config-3.13.0-32-generic      System.map-3.13.0-35-generic
config-3.13.0-35-generic      System.map-3.13.0-36-generic
config-3.13.0-36-generic      System.map-3.13.0-37-generic
config-3.13.0-37-generic      System.map-3.13.0-39-generic
config-3.13.0-39-generic      System.map-3.13.0-40-generic
config-3.13.0-40-generic      System.map-3.13.0-43-generic
config-3.13.0-43-generic      System.map-3.13.0-46-generic
config-3.13.0-46-generic      vmlinuz-3.13.0-32-generic
grub                          vmlinuz-3.13.0-35-generic
initrd.img-3.13.0-32-generic  vmlinuz-3.13.0-36-generic
initrd.img-3.13.0-35-generic  vmlinuz-3.13.0-37-generic
initrd.img-3.13.0-36-generic  vmlinuz-3.13.0-39-generic
initrd.img-3.13.0-37-generic  vmlinuz-3.13.0-40-generic
initrd.img-3.13.0-39-generic  vmlinuz-3.13.0-43-generic
initrd.img-3.13.0-40-generic  vmlinuz-3.13.0-46-generic
guy@server:~$
Is there one handy command that could delete everything except what I need?
 
Old 07-12-2015, 07:59 PM   #6
berndbausch
Senior Member
 
Registered: Nov 2013
Location: Tokyo
Distribution: Redhat/Centos, Ubuntu, Raspbian, Fedora
Posts: 2,048

Rep: Reputation: 438Reputation: 438Reputation: 438Reputation: 438Reputation: 438
Quote:
Thanks for suggestions guys. Is there some reason I need more than one file /boot? Is that all kernels in there?
The vmlinuz files are kernels, the initrd files are the initial ram disks that are needed to bootstrap them, the config files contain the kernel configuration, and I don't know what the abi files are. All files with the same number e.g. 3.13.0-32 belong to the same kernel version. Do an ls -lh do see how large each file is - you will probably find the initrd and vmlinuz files occupy by far the most space.

When you install a new kernel, the old kernel is kept. If the new kernel causes trouble, you can still use the old one. After a few days or weeks of testing or monitoring, when you feel everything is OK, remove the old kernel (or keep it if you like).
Quote:
Is there one handy command that could delete everything except what I need?
Code:
apt-get remove <list of all the packages you don't need anymore>
"What packages" you ask? To be honest, I am not that familiar with Ubuntu, but google for "ubuntu remove old kernel".

Last edited by berndbausch; 07-12-2015 at 08:03 PM. Reason: added info
 
2 members found this post helpful.
Old 07-13-2015, 01:00 AM   #7
JimKyle
Member
 
Registered: Dec 2001
Location: Oklahoma City, OK, USA
Distribution: Xubuntu 16.04 LTS
Posts: 214
Blog Entries: 1

Rep: Reputation: 39
Quote:
Originally Posted by wh33t View Post
Is there one handy command that could delete everything except what I need?
If you can install the "synaptic package manager", you can then use it to search for "-3.13.0-3" in the installed programs. This string is the version number of a large number of kernel-associated programs, all of which are now obsolete (that final "3" is now a "4" for valid packages) and no longer needed. It can then remove them all with a single command.

You can install Synaptic from the software center; it's no longer installed by default, but is still a fully supported utility and quite helpful. You may need to manually remove one or two of the programs that contain the "-3.13.0-3" string in their names, to make room for the install, however.

Once you have it installed, launch Synaptic. You will be asked for authorization; reply with your login password. Then select "Status" from the options in the lower right of the resulting screen, then "Installed" from the choices that will appear on the left, and finally enter "-3.13.0-3" (without the quotes) in the search box. You'll see all the obsolete program packages listed, and nothing else. Highlight the top one on the list, then scroll down to the bottom, hold down either shift key, and click on the last item, to highlight all of them. Then click in the checkbox at the left of any of the highlighted entries, and select "delete" from the menu that pops up.

Scroll through the list one more time to make certain that no other package has crept in; if one has, or if you're in doubt, click the checkbox and select "unmark" to remove it from the list to be killed. Finally, click the "Apply" button at the top of the window, and follow the prompts. You should find a satisfying amount of disk space being recovered.

Hope this helps. Let us know how you come out!

Last edited by JimKyle; 07-13-2015 at 01:02 AM. Reason: To clarify the search string's meaning.
 
2 members found this post helpful.
Old 07-15-2015, 09:18 PM   #8
wh33t
Member
 
Registered: Oct 2003
Location: Canada
Posts: 720

Original Poster
Rep: Reputation: 47
Quote:
Originally Posted by JimKyle View Post
If you can install the "synaptic package manager", you can then use it to search for "-3.13.0-3" in the installed programs. This string is the version number of a large number of kernel-associated programs, all of which are now obsolete (that final "3" is now a "4" for valid packages) and no longer needed. It can then remove them all with a single command.

You can install Synaptic from the software center; it's no longer installed by default, but is still a fully supported utility and quite helpful. You may need to manually remove one or two of the programs that contain the "-3.13.0-3" string in their names, to make room for the install, however.

Once you have it installed, launch Synaptic. You will be asked for authorization; reply with your login password. Then select "Status" from the options in the lower right of the resulting screen, then "Installed" from the choices that will appear on the left, and finally enter "-3.13.0-3" (without the quotes) in the search box. You'll see all the obsolete program packages listed, and nothing else. Highlight the top one on the list, then scroll down to the bottom, hold down either shift key, and click on the last item, to highlight all of them. Then click in the checkbox at the left of any of the highlighted entries, and select "delete" from the menu that pops up.

Scroll through the list one more time to make certain that no other package has crept in; if one has, or if you're in doubt, click the checkbox and select "unmark" to remove it from the list to be killed. Finally, click the "Apply" button at the top of the window, and follow the prompts. You should find a satisfying amount of disk space being recovered.

Hope this helps. Let us know how you come out!
I don't use a GUI, this is for Ubuntu Server, I should have specified. Thanks for the advice anyhow.

I managed to delete some old kernels and got it to update and reboot correctly. Thanks for your help guys. Is there anyway to make Ubuntu purge kernels automatically that are say... 3 iterations old?
 
Old 07-15-2015, 09:32 PM   #9
JimKyle
Member
 
Registered: Dec 2001
Location: Oklahoma City, OK, USA
Distribution: Xubuntu 16.04 LTS
Posts: 214
Blog Entries: 1

Rep: Reputation: 39
Quote:
Originally Posted by wh33t View Post
Is there anyway to make Ubuntu purge kernels automatically that are say... 3 iterations old?
No quick and easy configuration that I've found, but you should be able to put together a shell script and run it from a cron.weekly job to do the trick.

I would first try to do it by sorting the list on the "last modified" date field, and keep only the three most recent. It might be a rather complicated script to design but when finished it should be quite effective.

You could use "ls" to create a list in date order, much as you did in messages up the thread, then delete the top three lines from the list, and add "rm " or an "apt-get purge " command at the front of each remaining line...

And you could make the script go through these motions. Might even make it detect addition of new versions, and do the trimming only when there were more than three of each package...

The possibilities are almost endless! Scripting is my best friend when faced with repetitive and tedious actions. Do it once, copy the history file, edit it down, and never have to figure things out again...
 
2 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Using qemu to boot a full hardware installed Windows partion on dual boot system dwmolyneux Linux - General 8 05-13-2012 01:11 PM
Autoremove again Phiebie Debian 2 03-23-2012 09:50 PM
apt-get autoremove whittycat Debian 5 09-22-2009 03:13 AM
want cron-apt to full-upgrade but only updates gongli Debian 0 04-12-2009 10:23 AM
Significant change caused by apt-get-autoremove, new package, or full disk- which? sonichedgehog Debian 0 02-06-2008 07:36 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 12:40 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration