← Back to Home

Take Care About Your Distro — Complete Maintenance Guide

Take care about your distro

This page contains the complete and expanded version of the tutorial shown in my video. It’s not about distro-hopping, it’s not about reinstalling every two weeks, and it’s definitely not about chasing the “perfect desktop”.

Linux feels amazing right after installation. Clean, fast, sharp. Then time passes, we test stuff, we download things, we forget things, we pile up packages, caches, services, logs… and the system slowly becomes heavier and less predictable.

This guide is about the part everybody ignores: maintenance. Not because Linux is fragile, but because your distro is a living system, and if you don’t take care of it, the spark fades.

⚠️ DISCLAIMER
Think before you paste commands. Do not trust anyone blindly, not even me. Some commands require root access, and some can remove data. Read what you run, and run only what you understand.

1. Disk Space — Stop Feeding the Monster

We all know that in the era of abundance, gigabytes are thrown around like peanuts. But in reality they just end up making our disk fat. The most common crime scene is always the same: Downloads folders, forgotten ISOs, random videos, duplicated archives, and “I’ll keep this just in case”.

First, scan your disk and get a real overview:

df -h

If you have multiple partitions, this gives you the full panorama. Then we get more granular by analyzing only your home directory, so we understand where the space is actually going:

du -h /home --max-depth=2 2>/dev/null | sort -hr | head -30

This sorts folders by size and shows you the biggest ones first. Usually the biggest folders are the suspects, and you immediately get a sense of the situation.

Now let’s go deeper: list the biggest files in your home. Somewhere there is probably that ISO you downloaded and forgot, and this is how you find it:

find ~ -type f -printf '%s %p\n' 2>/dev/null | sort -nr | head -30

In my case you’ll mostly see videos and recordings, because I create content. That’s exactly why my distro gets messy fast, and why maintenance matters.

Old downloads you forgot exist

A practical tip: files downloaded a long time ago are often no longer needed. In a file manager you can sort by date, but you can also do it via terminal, and it’s brutally effective:

find ~/Downloads -type f -printf '%T@ %p\n' | sort -n | head -30

This lists the oldest files first. Delete what you don’t need, then run it again and expand the list if you want a wider view:

find ~/Downloads -type f -printf '%T@ %p\n' | sort -n | head -100

You can do this for any directory by changing the path. This method is more granular, easier to read, and way more effective than “clicking around hoping to find something”.

If I may give you one tip: always download into the same folder. Managing one single folder is the difference between an organized distro and a chaotic desktop landfill.

Cache — the silent disk killer

Another big enemy is cache. Megabytes and megabytes of useless data accumulate silently, and you don’t notice until the disk starts crying.

du -sh ~/.cache

To see which cache folders weigh the most:

du -h ~/.cache --max-depth=1 | sort -hr

This is also a reminder of your past choices. You’ll often find traces of desktops and apps you no longer use. Before deleting anything: be sure. Removing cache means losing application data, sessions, and stored stuff. No blind clicking.

System cache

Now let’s look at system cache, because package managers love to keep archives. It’s useful once. Then it becomes dead weight.

sudo du -sh /var/cache

To see what takes space inside:

sudo du -h /var/cache --max-depth=1 | sort -hr

In my case XBPS stores several gigabytes of packages, and we’ll deal with that in the next section.

2. Packages — What You Installed Still Lives There

This is a chronic problem for everyone, me included. I’m messy, I test desktops and apps, I remove things, I reinstall things, I experiment. Yet Void has never left me stranded. It behaves worse than Debian… almost.

Start with the simplest thing: open your menu. If there are icons you never use, maybe it’s time to uninstall them.

But the menu is just the surface. Underneath, the system remembers everything you installed over time. So let’s list the real package inventory.

List installed packages

This is the raw truth. It’s not “what you think you installed”, it’s what is actually installed.

Void:

xbps-query -l

Debian / Ubuntu:

dpkg -l

Arch:

pacman -Q

Slackware:

ls /var/log/packages/

If you want to understand not only what is installed, but also what happened and when, logs are your best friend. This is how you reconstruct the history when something starts behaving strangely.

Void (plain text log):

sudo less /var/log/socklog/xbps/current

On systemd you rely on journalctl. Good luck.

Orphan packages

Every installation leaves dependencies behind. Some remain useful, others become orphans: invisible, silent, but present. Removing them is not just cleaning — it’s reducing complexity.

Void:

xbps-query -O
sudo xbps-remove -o

Debian / Ubuntu:

sudo apt autoremove --dry-run
sudo apt autoremove

Arch:

pacman -Qtd
sudo pacman -Rns $(pacman -Qtdq)

The command: sudo pacman -Rns $(pacman -Qtdq) removes orphaned packages. While technically correct, it should never be run blindly. Always review the list returned by pacman -Qtdq first, to ensure no manually installed packages are mistakenly classified as orphans

Clean package cache

After packages, you still have downloaded archives used for installation. Useful once, useless afterward. This is one of the most profitable cleanups in terms of recovered space.

Void:

sudo xbps-remove -O

Debian / Ubuntu:

sudo apt clean

Arch:

sudo pacman -Sc

Adding Slackware commands here would be almost ridiculous. On Slackware, these problems practically don’t exist.

3. Old Kernels — Dead Weight in Silence

Many people ignore old kernels. Distros keep several for safety, but over time they become dead weight. Keeping only a few makes the system cleaner and more ordered.

Void:

xbps-query -l | grep linux
echo "keep_kernels=3" | sudo tee /etc/xbps.d/keep-kernels.conf
sudo xbps-remove -o

Debian / Ubuntu:

dpkg -l | grep linux-image
sudo apt autoremove --purge

Arch:

pacman -Q | grep linux
sudo pacman -S pacman-contrib
sudo paccache -rk3

Slackware:

ls /var/log/packages | grep kernel
sudo removepkg kernel-VERSION
sudo removepkg kernel-modules-VERSION

Multiple boot entries do not necessarily mean multiple kernels. Bootloaders create separate entries for normal, fallback and recovery modes, all pointing to the same kernel image.

4. The Terminal’s Memory — Your Own Black Box

Besides the system’s memory, there is ours. And since human memory is unreliable, the terminal becomes the perfect diary of our actions. If two weeks ago you changed something and forgot what, this is where you start.

less ~/.bash_history

5. Active Processes — What Is Actually Running

So far we’ve seen what is installed. Now let’s see what is actually running. A program installed but never launched weighs little. A program running every day is what truly matters.

ps -eo comm --sort=start_time | tail
htop

6. Services — What Starts Without Asking You

Services are programs that start automatically at boot. Some are essential. Others are leftovers from past installations. Knowing them means knowing what really happens when you turn on your computer.

Void (runit services available):

ls /etc/sv

systemd (service files installed):

systemctl list-unit-files --type=service

Write down what you don’t need and remove it calmly. Every useless service removed means a lighter, more predictable, more stable system.

7. Final Goodies — The Difference Between Using and Knowing

Now we enter the part that makes the difference between using a distro… and truly knowing your distro. These are commands you won’t use every day, but when something goes wrong, they are the difference between reinstalling everything… and actually understanding what is happening.

Files recently modified in /etc

sudo find /etc -type f -mtime -7

/etc is the heart of system configuration. This command shows which files were modified in the last 7 days. If something started behaving strangely after an update or a manual change, here you’ll find where to look.

Slow boot services (systemd)

systemd-analyze blame

If your system takes too long to boot, this command shows who the culprit is. It lists services ordered by startup time, so you stop guessing and start measuring.

Active runit services on Void

sv status /var/service/*

Void doesn’t use systemd, but runit. This command lists all active services and their current status. If something crashes silently or stops starting, you’ll see it immediately.

Deleted files still in use

sudo lsof | grep deleted

This is a real hidden gem. When you delete a file while a program is still using it, disk space is not freed. This command shows which programs are holding “ghost” files open. Restart the program, and the space instantly comes back.

Files written in the last 24 hours in /var

sudo find /var -type f -mtime -1

/var is where the system constantly writes logs, cache, and temporary data. This command shows what changed in the last day. If something is growing too fast, you’ll find it here before the disk fills up.

Filesystem check (read-only)

This command must not be hardcoded to my NVMe path, because your disk is not my disk. First, identify your real device name, then run fsck in read-only mode.

Find your partitions and filesystem types:

lsblk -f

Now run fsck in read-only mode on the partition you want to verify:

sudo fsck -n /dev/YOUR_PARTITION

This checks filesystem integrity without modifying anything. It’s like an X-ray of your disk. If hidden errors exist, you’ll see them before they become serious problems.

Never run fsck in write mode on a mounted partition. Doing so can corrupt the filesystem. If you need to check a mounted partition, always use read-only mode (fsck -n) or run a full check from a live environment.

Programs that start automatically

ls ~/.config/autostart

Here you find programs that start automatically when your desktop loads. Often we install something, test it, uninstall it… but autostart remains. Result: useless processes running every day for no reason.

Files with strange permissions in home

find ~ -type f -perm 777

A file with 777 permissions means anyone can read, write, and execute it. Inside home, this should almost never happen. If you find something here, it’s worth checking: it may be your mistake, or something much more interesting.

Conclusion

Managing an operating system requires continuous effort. If we ignore it, the distro gets heavier, slower, unpredictable.

Linux doesn’t break by itself. It breaks when we stop taking care of it.

And the beautiful thing is that all the tools to do it are already there. We just need to use them.

See you in the next video....ops post
And may Linux be with you.

Comments