I have been reading some online that portage does'nt get rid of packages that it is not using while apt does. Is this true? I have tested this out on my debian system but it seems to keep the packages to. Anyway to change this? I guess I have two questions...

Dani AI

Generated

Short answer: both package systems can leave "extra" stuff behind, but they handle it differently. APT keeps downloaded .deb archives in a local cache and tracks whether a package was installed manually or automatically; orphaned dependency-packages are removed only when you run the right cleanup commands. (debian.org)

Practical APT notes: use apt autoremove to remove packages that were installed solely as dependencies and are no longer needed, and apt-get autoclean / apt-get clean to prune the on-disk .deb cache in /var/cache/apt/archives. Mark a package manual to keep it (apt-mark manual <pkg>) or automatic to enable future removal (apt-mark auto <pkg>). These are safe-first operations; review what autoremove lists before confirming. (manpages.debian.org)

Portage (Gentoo) differences and safe workflow: Portage keeps a user-selected "world" set (the packages you asked for); packages not in that set and not required by other installed packages are candidates for removal. Always preview removals (pretend/ask), update the world deps first, and inspect the proposed removals before accepting them — tooling warns about fragile removals (kernels, compilers, etc.). If you want to keep things from being auto-removed, add them to the world set or install with the oneshot option. (wiki.gentoo.org)

Extra safety step for Gentoo: after doing aggressive cleanup, run the gentoolkit reverse-dependency checker to detect and rebuild packages broken by library changes. Back up or regenerate your world file if it looks wrong, and always study the removal list: Portage gives explicit warnings because a careless depclean can remove things you still need. (wiki.gentoo.org)

Notes tied to the thread: 's observation that apt "keeps" packages is expected unless you run the cleanup commands above; 's pointer toward Portage cleanup is on track, but follow the preview-and-rebuild workflow to avoid surprises.

Recommended Answers

All 2 Replies

AFAIK, apt will leave packages there too. Not positive, but almost certain.

I also recommend you look into emerge --depclean. Does what you're looking for (but not recursively I don't think... I wonder if that's being developed...).

You could keep running it...;)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.