[svlug] Debian upgrade (was Debian Upgrade 7.8)

Rick Moen rick at svlug.org
Mon Jan 19 11:06:55 PST 2015


Scott DuBois wrote:

> If I run 'autoremove' it's going to get rid of them but some I want to
> keep. 

The situation's exactly as Akkana aptly described it.  apt-get's autoremove
heuristics are noting from records that you never _requested_ those packages,
which is why it's saying

   The following packages were automatically installed
                               ^^^^^^^^^^^^^

This design aim of the 'autoremove' mode is disclosed in apt-get's man page:

       autoremove
                  autoremove is used to remove packages that were
		  automatically installed to satisfy dependencies for some
		  package and that are no more needed.


Getting back to the --purge flag (a function also available, these days, 
using new-ish apt-get command 'purge'):  That option causes apt-get (or
dpkg) to clear out conffiles and similar files left behind that belonged
to packages you no longer have installed.  Those are indicated in dpkg
-l output by the letter 'rc' (indicating 'runcontrol' file, old-school
Unix jargon for the sorts of conffiles that belong in /etc/) in the
leftmost column.  

That would be, for example, the locally modified Apache httpd files you
maintained for a while, but then decided to remove the Apache httpd package:
apt-get will avoid removing any locally-modified conffiles unless you say to
purge them.

$ dpkg -l | less
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                                       Version                           Description
+++-==========================================-=================================-=========================================================================
ii  a2ps                                       1:4.14-1.1                        GNU a2ps - 'Anything to PostScript' converter and pretty-printer
ii  abiword                                    2.8.6-0.3                         efficient, featureful word processor with collaboration
ii  abiword-common                             2.8.6-0.3                         efficient, featureful word processor with collaboration -- common files
ii  accountsservice                            0.6.21-6                          query and manipulate user account information

[...]

I was hoping to show you an example, but I don't have any handy --
because I make a point of doing this occasionally:

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

I also 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:  You might judge that some packages are essential to your 
system's needs 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_, again, you must pay close attention when using it,
or you might remove something you actually want.


Above package-maintenance tips are adapted from the
site-docs/package-operations documentation that SVLUG's Web Team uses on
www.svlug.org .  Yr. welcome.





More information about the svlug mailing list