[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#533267: release-notes: Purging uninstalled packages

Control: tags -1 patch

On Tue, 16 Jun 2009 00:22:54 -0500 "Karl O. Pinc" <kop@meme.com> wrote:
> Package: release-notes
> Version: lenny
> Severity: normal
> Hi,
> It almost goes without saying, but at the end of the
> upgrade process it can be a good idea to purge the
> configuration files of those packages that are no
> longer installed.  Something like:
> Examine leftover config files:
>   aptitude search ~c
> And then if all the config files are no longer needed:
>   aptitude purge $(aptitude search ~c -F "%p")
> Where this can really be important is purging the
> old linux kernels.  Sometimes /boot can fill up.
> It's probably a good idea to do a aptitude search ~c
> before starting the upgrade as well, and either keep
> the list for later comparison when the upgrade is
> done or cleanup before starting the upgrade.
> [...]


Thanks for suggesting this and sorry for the latency on getting back to you.

I am proposing the attached patch (to be applied to the Jessie
release-notes).  It will be added to the "Things to do before

Note, I opted for using dpkg -l + awk rather than aptitude, because a)
all users have dpkg + awk and b) we have started recommending apt-get
over aptitude again for upgrades.

A review of the text is much appreciated.  Please CC me on relies.



From 38f2fee6d1cd1d5214da55fa02d9ba3c74504151 Mon Sep 17 00:00:00 2001
From: Niels Thykier <niels@thykier.net>
Date: Sun, 23 Nov 2014 22:47:57 +0100
Subject: [PATCH] en/upgrading: Recommend purging old packages

Signed-off-by: Niels Thykier <niels@thykier.net>
 en/upgrading.dbk | 33 ++++++++++++++++++++++++++++++++-
 1 file changed, 32 insertions(+), 1 deletion(-)

diff --git a/en/upgrading.dbk b/en/upgrading.dbk
index 9a7b199..4273400 100644
--- a/en/upgrading.dbk
+++ b/en/upgrading.dbk
@@ -1267,7 +1267,38 @@ is complete, but there are some other things that should be taken care of
 <emphasis>before</emphasis> the next reboot.
-<programlisting condition="fixme">TODO: Still needed?</programlisting>
+<section id="purge-removed-packages">
+  <title>Purging removed packages</title>
+  <para>
+    It is generally advisable to purge packages have been removed.
+    This is especially true, if these have been removed in an earlier
+    release upgrade (e.g. from the upgrade to &oldreleasename;) or
+    from third-party vendors.  In particular, old init.d scripts have
+    been known to cause issues.
+  </para>
+  <caution>
+    <para>
+      Purging a package will generally also purge its log files
+      permanently.  If you want to keep these, you should take
+      a copy of them before purging the package.
+    </para>
+  </caution>
+  <para>
+    The following command displays a list of all removed packages that
+    may have configuration files left on the system (if any):
+  </para>
+  <screen>
+    # dpkg -l | awk '/^rc/ { print $2 }'
+  </screen>
+  <para>
+    The packages can be removed by using <command>apt-get
+    purge</command>.  Assuming you want to purge all of them
+    in one go, you can use the following command:
+  </para>
+  <screen>
+    # apt-get purge $(dpkg -l | awk '/^rc/ { print $2 }')
+  </screen>

Reply to: