0

This question already has an answer here:

I can't do a software update because /boot is almost full. I, as root deleted unneeded files, but it didn't change the space problem. Trash shows that it's empty, and I can't get run gksudo nautilus to access roots trash to empty it. So basically, I can't do any more upgrades if they involve /boot.

How do I empty root's trash?

marked as duplicate by Eric Carvalho, muru, Thomas Ward, user68186, Pilot6 Jul 7 '15 at 8:18

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • Can't you just use terminal as root to delete the files with commands? – aastefanov Jul 6 '15 at 22:37
  • I have tried, with no luck. Can you tell me what the command line is to empty roots trash? – Darby Gallagher Jul 6 '15 at 22:40
0

Try this:

Open a terminal,

Press Ctrl+Alt+T

Run it:

$ sudo -i
# OLDCONF=$(dpkg -l|grep "^rc"|awk '{print $2}')
# CURKERNEL=$(uname -r|sed 's/-*[a-z]//g'|sed 's/-386//g')
# LINUXPKG="linux-(image|headers|ubuntu-modules|restricted-modules)"
# METALINUXPKG="linux-(image|headers|restricted-modules)-(generic|i386|server|common|rt|xen)"
# OLDKERNELS=$(dpkg -l|awk '{print $2}'|grep -E $LINUXPKG |grep -vE $METALINUXPKG|grep -v $CURKERNEL)
# apt-get clean
# apt-get remove --purge $OLDCONF
# apt-get remove --purge $OLDKERNELS
# rm -rf /home/*/.local/share/Trash/*/** &> /dev/null
# rm -rf /root/.local/share/Trash/*/** &> /dev/null
0

/boot usually fills up because Ubuntu keeps old kernel versions around in case the new ones fail, so that you can go back to a working kernel. You'll need to delete old kernel versions to free up space on /boot.

Automatic method

  1. Reboot to ensure you're using the latest kernel version.
  2. Follow the instructions to use Ubuntu Tweak to remove old kernel versions (scroll down to the Ubuntu Tweak section).

Manual method

  1. Reboot to ensure you're using the latest kernel version.
  2. Open a terminal by pressing Ctrl+Alt+T.
  3. Find out what kernel version you're using:

    uname -r
    
  4. Type the following and press tab twice instead of enter:

    sudo apt-get purge linux-
    
  5. In the output, find a kernel version other than what you're using. For example, if your kernel version is 3.19.0-22 and you see linux-headers-3.19.0-21, you can remove version 3.19.0-21.

  6. Remove linux-headers-VERSION, linux-headers-VERSION-generic, linux-image-VERSION-generic, and linux-image-extra-VERSION-generic. For example, if you're removing version 3.19.0-21, run:

    sudo apt-get purge linux-headers-3.19.0-21 linux-headers-3.19.0-21-generic linux-image-3.19.0-21-generic linux-image-extra-3.19.0-21-generic
    
  7. Go back to step 4 and repeat until you only see the kernel version you're using.
  • I did this and now only have the kernel I am currently using. However, I have not changed the fact that /boot drive is still mostly full. I need (I think) to somehow get the root users trash to empty, and I can't seem to. – Darby Gallagher Jul 7 '15 at 1:44
  • Why do you think trash is stored in /boot? – Olathe Jul 8 '15 at 12:34
-1

According to this topic the root's trash has to be in `/root/.local/share/Trash'

Just open a terminal and type (after sudo -s enter your password, no characters will be shown):

sudo -s
rm -rf /root/.local/share/Trash

It's going to delete the Trash folder too.

  • Just did that, but when I run the software update it still says I have no more room on /boot. – Darby Gallagher Jul 6 '15 at 22:44
  • How big your /boot partition actually is? – aastefanov Jul 6 '15 at 22:46
  • The drive is 200 mb – Darby Gallagher Jul 6 '15 at 22:57
  • Isn't that too small? – aastefanov Jul 6 '15 at 22:59
  • I would say so. its the size Ubuntu made it. Can I change the size? I have loads of space on the disk. – Darby Gallagher Jul 6 '15 at 23:01

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