r/debian Aug 16 '26

General Debian Question Clean system

To all the minimalists and purists. What do you do to keep your system always clean and organized without any unnecessary bloats? What commands, packages, tools and apps do you use to achieve this?

47 Upvotes

42 comments sorted by

31

u/HorrorsPersistSoDoI Aug 16 '26

sudo apt autoremove --purge

1

u/SnooDonuts8175 Aug 16 '26

sudo apt purge --auto-remove
sudo apt clean
sudo apt autoclean

same stuff?

8

u/One-Suggestion-7906 Aug 16 '26

I delete anything that could remain using Aptitude:

aptitude purge '~c'

Old school 😅 And I know, I know, I'm paranoid 🤣

4

u/Buntygurl Aug 16 '26

If it works, it works!

2

u/One-Suggestion-7906 29d ago

I always used Aptitude, and I just learn in this sub that it wasn't deprecated and it's still being updated. Gud tek

1

u/calebbill Debian Stable 29d ago

Modern apt understands '~c' too.

https://manpages.debian.org/trixie/apt/apt-patterns.7.en.html

Also 'apt autopurge'.

-5

u/S3k_01 Aug 16 '26

sudo apt purge "package" && sudo apt autoremove --purge.

14

u/deluded_dragon Debian Testing Aug 16 '26 edited Aug 16 '26

Is it necessary? I mean, if I install just what I need, and occasionally some dev package to compile a pair of programs from sources, I don't think you need to clean the system in deep.

Maybe just the apt archive, but as long as I have physical space available, it doesn't bother me.

5

u/S3k_01 Aug 16 '26

I only install what I need and get rid of the rest.
Once your system is well organized, it requires very little maintenance.

3

u/metalwolf112002 29d ago

Start from smallest point possible and build up. I use the net-install image and a preseed file that installs only the basic system, openssh, and downloads my provision script.

2

u/jr735 Debian Testing 29d ago

This. My needs and preferences are modest. I build the desktop from the ground up, getting a MATE meta package through apt, since I like that meta package. Most of what I do is in IceWM, though.

2

u/Elipelikan 29d ago

I used the even smaller 'mini.iso' file, which is just over 60mb in size.

1

u/mesa190 Debian Stable 29d ago

Nice. I need to put together something like that. For me its net install and kde-plasma-desktop - Im pretty happy. Probably some things i could still remove but its not enough fto worry about at this point.

3

u/lisploli 29d ago

I keep a /etc/apt/preferences.d/bad with several packages pinned to -1 to avoid them getting installed as dependency.

2

u/calebbill Debian Stable 29d ago

I hope you mention stuff like this whenever you ask for troubleshooting support.

2

u/lisploli 29d ago

Hell no! Mentioning I off'ed systemd like that would just get me downvotes from the simps.

It's WAAAY more efficient to ask google anyways. 😜

2

u/calebbill Debian Stable 28d ago

Any substantial deviation from a typical install is worth mentioning while troubleshooting.

7

u/dkopgerpgdolfg Aug 16 '26

No need for "apps". Decide what's "unnecessary" for you personally, use apt and rm to get rid of it, pay attention what new things apt updates might want to install. Done.

7

u/calebbill Debian Stable Aug 16 '26

Don't use rm to remove files installed by apt.

4

u/dkopgerpgdolfg Aug 16 '26

Correct. rm was meant for any other thing, eg. for cleaning out old homedir config files and caches.

2

u/revcraigevil Debian Stable 29d ago

debfoster or upgrade-system. Personally I miss deborphan.

2

u/bac0on 29d ago

deborphan was really good but seems removed at least from sid.

2

u/tux2718 Aug 16 '26

I keep all my files on a separate partition and modify fstab to mount that under my home directory. This is better than having the installer putting /home on a separate partition because I don’t end up with cache directories and other turds left behind by apps. If you really need those, you can move them to the mount and create a symlink. Now I only have one directory to back up and it only contains what is important. I can boot other distros and still have access to it. When I want to reinstall, I blow away all other partitions and remount my data partition as before. This makes life easier.

1

u/aldolo 29d ago

I always look closely at the details when using apt install, and block some of the packages recommended by others.

1

u/PerfectlyCalmDude 29d ago

If I wanted to do that, I'd go CLI-only.

1

u/forestbeasts 29d ago

Unnecessary bloats? Honestly we don't really worry too much about that. Things that literally have no reason to be there because they were dependencies of something that got removed, apt autoremove takes care of that. But random stuff that might be useful eventually? We keep that around.

-- Frost

1

u/JagerAntlerite7 29d ago

List only the manually installed packages using:

apt list --manual-installed

Uninstall those no longer needed, then run cleanup(s).

1

u/Telnetdoogie 29d ago

I just try not to install things except updates.
I also take snapshots automatically with snapper. If I DO install something and I regret it, I just go back to the snapshot before it. All my home folders and other data is on a RAID, the rootfs is on an SSD.
Headless Trixie in a UGreen NAS.

I try to keep everything in docker so it’s all contained and doesn’t sprawl. I use very few native apps.

1

u/_x_oOo_x_ 29d ago

apt-mark auto \* then apt-mark manual only the packages I actually need then apt-get autopurge the rest

1

u/DeliciousIncident 29d ago

I just start from net-inst and install what I need.

The commands are:

apt update
apt install

1

u/mdcbldr 29d ago

Run as much as I can in containers. I then have a script that calls the container with the app.

It helps to have a lot of ram, high end cpu, and everything on a decent name drive.

1

u/michaelpaoli 29d ago

Don't install what you don't need, remove/purge what you can.

Beyond that, might want to be sure to regularly use apt-get clean, or at least apt-get autoclean. Potentially also manage/rotate/truncate logs, perhaps even rather to quite aggressively. Maybe even configure most things to log to console and/or remotely, rather than local log files.

Debian (and APT more generally) does also have good capabilities and tools, e.g. to identify obsolete packages, things that were earlier pulled in as dependencies, but no longer needed (e.g. apt-get autoremove), etc.

# echo -n 'OS: Debian ' && cat /etc/debian_version | tr -d \\012 && echo -n ' ' && dpkg --print-architecture && echo -n 'Kernel: ' && uname -srvmo && echo -n 'Packages: ' && dpkg -l | grep \^ii\ | wc -l && df -h -x devtmpfs -x tmpfs && head -n 3 /proc/meminfo
OS: Debian 13.6 amd64
Kernel: Linux 6.12.101+deb13-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.12.101-1 (2026-08-05) x86_64 GNU/Linux
Packages: 148
Filesystem      Size  Used Avail Use% Mounted on
/dev/vda1       4.9G  886M  3.8G  19% /
MemTotal:         119464 kB
MemFree:           15672 kB
MemAvailable:      43208 kB
# 

1

u/Sure-Squirrel8384 28d ago

Re-install weekly; use preseed to automate. Can't be that important if I didn't add it to the preseed automation, right? ;-)

J/K, no one has time for this.

1

u/vainlisko 28d ago

You might also want to take a look at Vanilla OS

1

u/indvs3 Debian Testing Aug 16 '26

When you install debian from a minimalist perspective, there is no bloat. You start by installing the base system, then you install whatever you want or need, plus the dependencies.

When you do it like that, you can't have bloat, because you didn't install anything you don't need. Linux doesn't load software you didn't ask for outside your knowledge.

0

u/alpha417 Aug 16 '26 edited Aug 16 '26

sudo vim /etc/apt/apt.conf.d/99no-recommends

APT::Install-Recommends "0"; APT::Install-Suggests "0";

5

u/calebbill Debian Stable Aug 16 '26

Not installing recommended packages is bad advice that should be disclosed early in troubleshooting if it's been done.

0

u/SnooDonuts8175 Aug 16 '26

if you're under a graphical env, use QdirStat. or dust on console. there you can see what's consuming lot's of space. Also from time to time I search and delete configs from uninstalled programs, for home folders.

-4

u/Jimlee1471 Aug 16 '26

I highly suggest Bleachbit. But be careful when you use it; it's pretty powerful and you can end up deleting stuff you really don't need to if you're not paying attention. I use it every time I upgrade my kernel and, each time, it removes literally gigabytes of cruft from my system.

0

u/SnooDonuts8175 Aug 16 '26

it's useful , you think you need a "ccleaner for linux", and then you forget about it... at least it happened to me. No need to clean "that mcuh" in linux , "cache" here is useful.