Free up disk space on Debian by cleaning your apt cache

Josh Sherman
1 min read
Command-line Interface Debian / Ubuntu

The other day one of my Debian systems locked up, due to the root / partition being filled up. Kind of a “same problem, different distro” scenario as a few years back I ran into the same dilemma on Arch Linux

At some point, I’ll probably bite the bullet and scale down my /home partition and give the root / partition a bit more breathing room, but until then, the quick fix is to simply clear out the apt cache.

To do so, all you need to run is the following:

apt clean # Requires super user privileges

While this didn’t have a huge impact, freeing up roughly 10% of the root partition’s disk space, it was enough to go from not working, back to working.

Keep in mind, after running this, I did need to reboot before things started to work as expected.

While it didn’t apply to me, since I do this regularly anyway, a bonus command you could run is apt autoremove, which also requires super user privileges, that will take care of anything that was previously installed that is no longer necessary.

Join the Conversation

Good stuff? Want more?

Weekly emails about technology, development, and sometimes sauerkraut.

100% Fresh, Grade A Content, Never Spam.

About Josh

Husband. Father. Pug dad. Musician. Founder of Holiday API, Head of Engineering and Emoji Specialist at Mailshake, and author of the best damn Lorem Ipsum Library for PHP.

Currently Reading

Parasie Eve

Previous Reads

Buy Me a Coffee Become a Sponsor

Related Articles