Reclaiming Disk Space from Unused Package Versions on a Small Linux Server

Introduction to Disk Space Reclamation

Running a small Linux server at home can be a fun hobby, but it’s easy to let disk space get out of control. I’ve seen this happen to me when I forget to clean up old package versions, logs, or just general clutter. In this article, I’ll walk you through the process of reclaiming disk space from unused package versions on your Linux server. Don’t bother with trying to manually track down every last byte - the real trick is to use the right tools to make the process as painless as possible.

[Read More]

Reclaiming Disk Space with Find and xargs After a Package Manager Mishap

Introduction to Disk Space Reclamation

I’ve lost count of how many times I’ve run into issues with package managers leaving behind unnecessary files on my Linux systems. This can happen due to incomplete package removals, failed updates, or simply because the package manager didn’t clean up after itself. In my experience, this is more common than you’d think, especially when using less popular packages or experimenting with different distributions.

Identifying the Problem

To start reclaiming disk space, you first need to identify where the unnecessary files are located. A good starting point is to use the find command, which allows you to search for files based on various criteria such as size, modification time, and permissions. For example, to find all files larger than 100MB in the /usr directory, you can use the following command:

[Read More]