:: Re: [DNG] cleaning before upgrade
Top Pagina
Delete this message
Reply to this message
Auteur: Rick Moen
Datum:  
Aan: dng
Onderwerp: Re: [DNG] cleaning before upgrade
Quoting Didier Kryn (kryn@???):

>     Some review of installed packages is usefull from time to time,
> ideally just after install, but before upgrade is also a good
> opportunity. In synaptic, you can easily review the packages which
> are "manually installed" and try to uninstall the ones you don't
> want; you will be warned if this removal breaks something usefull.

>
>     'apt-get autoremove --purge' will get rid of all packages which
> were once installed only to satisfy a dependency but are no longer
> needed.


Following is an excerpt from maintenance notes the Silicon Valley Linux
User Group keeps concerning package operations for the Ubuntu Server
virthost running www.svlug.org at Linode. (Ubuntu Server was _very
much_ not my choice, but rather that of the idiot SVLUG VP who worked
out the deal with Linode. This is on a headless server where the group
must put a premium on minimum footprint, hence eliminating all
unnecessary disk usage. I call attention in particular to the
usefulness of deborphan and debfoster.

(I should revise the text to include your excellent suggestion of
running 'apt-get autoremove' with the --purge flag.)



---<begin excerpt>---

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)"
    debfoster


(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,
here.]

Examples of packages removed:
gcc-4.2-base
python2.4-minimal
python2.5-minimal

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


---<end excerpt>---