I’ve been using Gentoo for almost 17 years now, and noticed today that there is a new preferred method for removing packges. As old habits die hard, I thought I’d make a quick post with the steps so I can embrace change.

Remove Package From World File

sudo emerge --deselect app-text/asciidoc
>>> Removing app-text/asciidoc from "world" favorites file...

Check Dependencies

sudo emerge --depclean -vp

 * Always study the list of packages to be cleaned for any obvious
 * mistakes. Packages that are part of the world set will always
 * be kept.  They can be manually added to this set with
 * `emerge --noreplace <atom>`.  Packages that are listed in
 * package.provided (see portage(5)) will be removed by
 * depclean, even if they are part of the world set.
 * As a safety measure, depclean will not remove any packages
 * unless *all* required dependencies have been resolved.  As a
 * consequence of this, it often becomes necessary to run
 * `emerge --update --newuse --deep @world` prior to depclean.

Calculating dependencies
>>> Calculating removal order...

>>> These are the packages that would be unmerged:

    selected: 5.02
   protected: none
     omitted: none

    selected: 5.10.2 5.10.3
   protected: none
     omitted: 5.10.4

All selected packages: =sys-kernel/gentoo-sources-5.10.2 =app-misc/sl-5.02 =sys-kernel/gentoo-sources-5.10.3

>>> 'Selected' packages are slated for removal.
>>> 'Protected' and 'omitted' packages will not be removed.

Packages installed:   2244
Packages in world:    930
Packages in system:   43
Required packages:    2241
Number to remove:     3

Run the above command again removing the p parameter if there are no critical files targetted for removal.

Remove Package with No Dependencies

sudo emerge --deselect app-text/asciidoc

Rebuild Anything Necessary in World File

sudo emerge --update --changed-use --deep --quiet @world


Gentoo Cheat Sheet