Skip to content

eclean-pkg / eclean-dist


eclean is part of gentoolkit and is used to remove old packages, distfiles, and other artifacts that are no longer needed. It is one of the most effective ways to keep a Gentoo system clean and minimize disk usage.


Overview

Command Cleans Default Mode Risk Level
eclean-pkg Binary packages in /var/cache/binpkgs Safe Low
eclean-dist Distfiles in /var/cache/distfiles Safe Medium

eclean-pkg

Cleans old binary packages that are no longer needed. This is completely safe to run regularly.

Common Flags

Flag Description
-d Deep clean — remove everything no longer needed
-p Pretend — show what would be removed
-n Do not remove packages matching current world/system
-s Summarize disk savings

Examples

Clean old binary packages

eclean-pkg -d

Show what would be removed

eclean-pkg -p

eclean-dist

Cleans distfiles that are no longer needed. This can free up a lot of space, but be cautious if you rebuild packages often.

Common Flags

Flag Description
-d Deep clean — remove all distfiles no longer needed
-p Pretend — show what would be removed
--destructive Removes everything not strictly required (use with caution)
-s Summarize disk savings

Examples

Clean unused distfiles

eclean-dist -d

Show what would be removed

eclean-dist -p

Tips & Best Practices

  • Run eclean-pkg after major updates to keep /var/cache/binpkgs small.
  • Run eclean-dist less frequently — distfiles may be needed again for rebuilds.
  • Use eclean --destructive only if you know exactly what you're doing.
  • Always use -p before performing a destructive clean.

Tool Function
emaint cleanresume Cleans resume data for interrupted emerge jobs
eclean-kernel Removes old kernels
revdep-rebuild Rebuilds broken library links

References

  • man eclean
  • man eclean-pkg
  • man eclean-dist