F5F Stay Refreshed Software Operating Systems How to keep Linux clean?

How to keep Linux clean?

How to keep Linux clean?

M
Mehta42
Member
112
02-23-2025, 08:57 PM
#1
I wasn't anticipating how quickly Linux could accumulate bloat. I made some adjustments, keeping journald off since I don’t need logging. After just three days of limited journaling, I noticed the log size exceeded 400 MB—a significant amount. Right now, my understanding of cleanup focuses on /tmp, system logs, and possibly certain cache or home directory folders. What areas should I inspect for unnecessary files? Beyond that, I suspect Pacman contributes a lot of bloat. I’m certain it stores files and logs, so deleting them would help. I can clear the cache using a Pacman command. Regarding Pacman itself, I suspect it generates excess files during package installation. Previously I used -R to remove just packages, but now learning about -Rns suggests it also cleans dependencies and configs. If I install a package intentionally and run it, should I truly have no record of it? There’s also a command for removing unused packages, though its syntax is more complex. My second concern is Yay, the AUR package manager. Since it builds from source, it likely produces a lot of unnecessary data. I’m curious about where it creates files in my home directory—have I checked bleach bit? Other good options might include cleaning bash history.
M
Mehta42
02-23-2025, 08:57 PM #1

I wasn't anticipating how quickly Linux could accumulate bloat. I made some adjustments, keeping journald off since I don’t need logging. After just three days of limited journaling, I noticed the log size exceeded 400 MB—a significant amount. Right now, my understanding of cleanup focuses on /tmp, system logs, and possibly certain cache or home directory folders. What areas should I inspect for unnecessary files? Beyond that, I suspect Pacman contributes a lot of bloat. I’m certain it stores files and logs, so deleting them would help. I can clear the cache using a Pacman command. Regarding Pacman itself, I suspect it generates excess files during package installation. Previously I used -R to remove just packages, but now learning about -Rns suggests it also cleans dependencies and configs. If I install a package intentionally and run it, should I truly have no record of it? There’s also a command for removing unused packages, though its syntax is more complex. My second concern is Yay, the AUR package manager. Since it builds from source, it likely produces a lot of unnecessary data. I’m curious about where it creates files in my home directory—have I checked bleach bit? Other good options might include cleaning bash history.

C
CeminCoala
Member
68
02-23-2025, 10:43 PM
#2
I rely on bleachbit. Without a swap partition, much of my RAM remains untouched, so I set up partitions for folders I don’t mind losing regularly. This ensures everything starts fresh each time. (It required some trial and error, as not everyone was happy, but most didn’t mind.)
C
CeminCoala
02-23-2025, 10:43 PM #2

I rely on bleachbit. Without a swap partition, much of my RAM remains untouched, so I set up partitions for folders I don’t mind losing regularly. This ensures everything starts fresh each time. (It required some trial and error, as not everyone was happy, but most didn’t mind.)

J
Jamella10
Junior Member
11
02-24-2025, 04:25 AM
#3
There seems to be an issue with your system, as the journal likely explains what. Instead of ignoring the problem, address it. The reason for deleting files isn't clear—logs help track recent changes and rolling back if a package fails works well. It only removes unmodified files from the package. Additional data might exist in system directories like "/etc", "/var/lib" or your home folder, which isn’t strictly standardized. Use "pacman -Rns $(pacman -Qdtq)" to create an alias in your shell config. Running "pacman -Rns" alone doesn't check for dependencies, so it may miss files that should be kept. If a file isn't explicitly listed or marked as installed, it gets removed. For example, "/home/$USER/.cache/yay" can be cleared with "yay -Scc".
J
Jamella10
02-24-2025, 04:25 AM #3

There seems to be an issue with your system, as the journal likely explains what. Instead of ignoring the problem, address it. The reason for deleting files isn't clear—logs help track recent changes and rolling back if a package fails works well. It only removes unmodified files from the package. Additional data might exist in system directories like "/etc", "/var/lib" or your home folder, which isn’t strictly standardized. Use "pacman -Rns $(pacman -Qdtq)" to create an alias in your shell config. Running "pacman -Rns" alone doesn't check for dependencies, so it may miss files that should be kept. If a file isn't explicitly listed or marked as installed, it gets removed. For example, "/home/$USER/.cache/yay" can be cleared with "yay -Scc".

H
Hooded_Master
Member
187
02-25-2025, 11:30 AM
#4
Turning off journald means apps will rely on /var/log, even if it’s not ideal. I’d prefer tweaking its log rotation instead. By default it keeps logs for years. If you’re worried about space, consider upgrading your disk. Many stores keep files in ~/.cache and /tmp—unless you really need to sync the repository index each time you install pacman. Just get a bigger drive or choose a distro with built-in log management. Arch likely doesn’t handle this well.
H
Hooded_Master
02-25-2025, 11:30 AM #4

Turning off journald means apps will rely on /var/log, even if it’s not ideal. I’d prefer tweaking its log rotation instead. By default it keeps logs for years. If you’re worried about space, consider upgrading your disk. Many stores keep files in ~/.cache and /tmp—unless you really need to sync the repository index each time you install pacman. Just get a bigger drive or choose a distro with built-in log management. Arch likely doesn’t handle this well.

M
mccoop03
Posting Freak
910
02-25-2025, 12:31 PM
#5
shundhammer/qdirstat provides directory statistics using a Qt-based tool (KDirStat without KDE). I usually rely on it to identify which files to remove for space optimization. A note: the logs typically don’t contain much data or temperatures, and most of what I download ends up in my home folder.
M
mccoop03
02-25-2025, 12:31 PM #5

shundhammer/qdirstat provides directory statistics using a Qt-based tool (KDirStat without KDE). I usually rely on it to identify which files to remove for space optimization. A note: the logs typically don’t contain much data or temperatures, and most of what I download ends up in my home folder.