[Aptitude-devel] why does not aptitude purge rather than just remove packages.

shirish शिरीष shirishag75 at gmail.com
Tue Feb 21 20:07:21 UTC 2012


Hi all,
This is more of a user question but don't know where else to ask hence
asking here.

This is when we do $sudo aptitude safe- upgrade (obviously after
updating the index)

Usually what happens is you get a bunch of updates and sometimes it
tells of a library or a package which needs to removed (as its
outdated).  Why isn't it purged (rather than just removed from the
system)

The question came to me as I was trawling through the wiki and came
across http://dsa.debian.org/howto/upgrade-to-squeeze/ .

I saw this interesting bit of code/commands :-

dpkg --get-selections | awk '$2=="deinstall" {print $1}' &&
echo "really purge these [y/N]?" && read ans && [ "$ans" = "y" ] &&
dpkg --purge `dpkg --get-selections | awk '$2=="deinstall" {print
$1}'` && echo "These are not at install:" && dpkg --get-selections |
awk '$2!="install" {print $1}'

Now I just ran the first bit of commands and it produced a nice listing :-

dpkg --get-selections | awk '$2=="deinstall" {print $1}'

For instance one of the things on the list was software-center

$ aptitude search software-center
c   software-center                                     - Utility for
browsing, installing, and removing software

just doing the purge gave me this :-

$ sudo aptitude purge software-center -y
The following packages will be REMOVED:
  software-center{p}
0 packages upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
Need to get 0 B of archives. After unpacking 0 B will be used.
D000001: deferred_remove package software-center
D000001: checking dependencies for remove `software-center'
(Reading database ... 374011 files and directories currently installed.)
Removing software-center ...
D000001: removal_bulk package software-center
D000001: removal_bulk purging? foundpostrm=1
Purging configuration files for software-center ...
D000001: removal_bulk purge done, removing list
`/var/lib/dpkg/info/software-center.list'
D000001: removal_bulk purge done, removing postrm
`/var/lib/dpkg/info/software-center.postrm'
D000001: removal done

so basically everything else has been removed except for an entry in
the database.

I did see this in the manpage of aptitude in the OPTIONS section :-

--purge-unused
           If Aptitude::Delete-Unused is set to “true” (its default),
then in addition to removing each package that
           is no longer required by any installed package, aptitude
will also purge them, removing their
           configuration files and perhaps other important data. For
more information about which packages are
           considered to be “unused”, see the section “Managing
Automatically Installed Packages” in the aptitude
           reference manual.  THIS OPTION CAN CAUSE DATA LOSS! DO NOT
USE IT UNLESS YOU KNOW WHAT YOU ARE DOING!

           This corresponds to the configuration option Aptitude::Purge-Unused.

Now I have few questions about this :-

a. Is this warning still valid ? 'THIS OPTION CAN CAUSE DATA LOSS! DO
NOT USE IT UNLESS YOU KNOW WHAT YOU ARE DOING!'  in 0.6.5-1 or not ?

b. If I do want to add this option where and how do I add it ? From
looking at the manpage and others, it seems I have to create a file in
/etc/apt/ and call it apt.conf .

Do I just say in that file Aptitude::Delete-Unused=True with some
comment on the top or what ?

I did have a look at /usr/share/aptitude/aptitude-defaults and
~/.aptitude/config is empty.

~/.aptitude$ ll
total 628
-rw-r--r-- 1 shirish shirish 637952 Feb 19 02:51 cache
-rw-r--r-- 1 shirish shirish      0 Feb 22 01:18 config

Looking forward to understand a bit of it.
-- 
          Regards,
          Shirish Agarwal  शिरीष अग्रवाल
  My quotes in this email licensed under CC 3.0
http://creativecommons.org/licenses/by-nc/3.0/
http://flossexperiences.wordpress.com
065C 6D79 A68C E7EA 52B3  8D70 950D 53FB 729A 8B17



More information about the Aptitude-devel mailing list