Ubuntu – No hdd space left

disk-usagehard drive

I have 13.4Gb hdd space for my Ubuntu partition, and the only software that I use is Thunderbird, Firefox, and Play On Linux with MS Office 2010 (.playonlinux uses 2.6Gb). I can't use UbuntuOne because of the limited space I have left (currently only 400mb is used).

I don't store any files on my Ubuntu partition, but only from updating the OS I got down to only 87mb free space, 'megabites', not gigabites. I've run Bleachbit a few times in the last few months and it can only recover about 250mb each time. I've run Disk Usage Analyser, and it says that 4gb is used in home/.encryptfs/myname/.Private Really, I do not store any files on the computer itself, but make them available to both OSs on an external hard drive and usb memory sticks. I'm currently running 12.04 LTS (64bit), and currently I wouldn't be able to upgrade to 14.04 LTS with only this tiny bit of space left. How do I fix this?

Best Answer

If you use the package and dist updates, and online installations of applications, clearing the package cache and old Linux kernels could recover considerable hard disk space.

And to do the same, open a terminal (press Ctrl + Alt + T) use the the commands that follow:

  1. To clean the package cache created by apt installations (i.e. remove all package archives cached in /var/cache/apt/archives):

    sudo apt-get clean
    
  2. To remove all the older kernels but the currently used one:

    sudo apt-get remove --purge $(dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d')
    

(Notes: -a- You can copy the above line of command combo and paste to the terminal. -b- Shortcut to paste in terminal is: Ctrl + Shift + V.)

Related Question