Quoting KatolaZ (kato...@freaknet.org):

> ....or, just use debfoster :P

Words of wisdom.  ;->

Excerpts follow from the package-operations notes for the team managing
www.svlug.org for Silicon Valley Linux User Group.  (A long-ago nitwit
LUG vice-president chose Ubuntu Server for the system, and we've been
stuck with it since.)

3.  Occasionally check for unnecessary packages (as the root user):

    apt-get autoremove  #finds unneeded dependencies
    deborphan           #finds unneeded libs:  Consider running
                        # "apt-get --purge remove $(deborphan)"

(WARNING:  dhcp3-client, dhcp3-common, and nsd* are essential packages
regardless of what the above may claim.)  Suggestion:  Run all three
in sequence repeatedly until they cease to find new unwanted packages.

The last of these tools (debfoster) is a very sophisticated and useful checker.
_However_, you must pay close attention when using it, or you might remove
something vital to the system.

Also useful along those lines:

    dpkg --purge [packagename]

...will remove vestigial package conffile and similar directories left
over after you've removed the packages associated with them.  You can
spot such leftovers by doing 'dpkg -l | more' and spotting any line
beginning with 'rc' in the leftmost column.  That indicates run
control (init) and similar files left over from a removed package.

This will remove all vestigial 'rc' files for removed packages:

   dpkg -l | grep ^rc | awk {'print $2'} | xargs dpkg --purge

(If you get a diagnostic about dpkg that starts out 'dpkg: --purge needs
at least one package name argument', that means there were no vestigial
'rc' packages.)

Once you're done with that cleanup, read down the list of installed
packages, and test whether any are unneeded and can be removed.

   dpkg -l | less  # You'll want a wide window for this.

Try 'apt-get remove [packagename]' for packages that seem unwanted:
If dependencies make it a bad idea, apt-get will make that obvious and
ask your confirmation.  E.g., package 'plymouth' is a graphical bootup
utility that's pointless on a headless server, but critical system
packages depend on it.  [Insert rude comment about Ubuntu mentality,

Examples of packages removed:

Last, this will purge the package cache (saving us significant disk),
i.e., delete everything but the lock file from /var/cache/apt/archives/
and /var/cache/apt/archives/partial/.  Run the command when you're done
for the day with package operations:

    apt-get clean

Dng mailing list

Reply via email to