If you’re like me and ordered raspbian preinstalled on a 4gig card for model B pi, then you are also like me and have installed maybe two packages before you can’t run
sudo apt-get upgrade
You end up returning this error:
You don't have enough free space in /var/cache/apt/archives/.
So what do we do?
Well I just ordered another 16 gig card, I know, I could have bought a sd card, installed it for free and whatever… But I like to keep things easy.
In the mean time, if you need a couple extra megs, you can clean out your apt cache. It’s located here:
And if you try and get the disc usage of this folder you will see how much space your can clear out. Basically, apt just keeps cached copies of the packages in case you need to install them again, so most likely you’ll be ok if you remove them. To see how much storage you are using in this directory type:
cd /var/cache/apt/archives du -sh .
I returned like 256 MB. So I cleared the cache:
sudo apt-get clean
And looked at how much memory I have available: