On Friday 18 June 2010 12:07 PM, Abhishek Amberkar [अभिषेक] wrote: > On Fri, Jun 18, 2010 at 11:32 AM, Ramnarayan.K<[email protected]> wrote: >> 2010/6/18 Abhishek Amberkar [अभिषेक]<[email protected]>: >>>> dpkg --get-selections | awk '{print "sleep 0.5&& echo" " "$1}' | bash >>>> >>>> >>> >>> Above command lists the packages which are marked "deinstall" >>> >>> As `man dpkg' says "deinstall" means >>> The package is selected for deinstallation (i.e. we want to remove all >>> files, except configuration files). >> >> not sure what you mean - cannot see deinstall mentioned anywhere in the >> command >>> >>> Following command gives list of all installed pacakges >>> >>> dpkg -l | grep ^i | awk '{print $2}' >> >> Did a comparision of the results of both commands >> >> the first gives me 3055 packages and the second 3084. >> >> about 29 packages more in the latter >> >> so why this difference and what does the deinstall mean ?? >> > > I already gave the meaning of "deinstall" in my previous posting. > (Refer `man dpkg') > > If you do "$ dpkg --get-selections | grep deinstall" it shows > "deinstall" packages. If you check state of any of these packages > using "aptitude show<package_name>" it will show "not installed". So > this command doesn't really shows all the `currently' installed > packages on your system.
Also, In other word, deinstall == "package was not removed with purge flag." Deinstall is similar to "rc" flag in `dpkg -l` Also, `dpkg --get-selections` is giving *state* of the packages (Hold, Purge, Deinstall, Install), so it's not good idea to get installed software (Package) list from it. `dpkg -l | grep "^ii"` would be better if you would like to use in administration, automation script, etc. +1 to Abhishek. Also, if you want to remove deinstall (rc) packages, you have to purge it separately. Again, you can not use "apt-get remove --purge" command to purge packages. `dpkg -P package_name` would be your friend. If you have bunch of packages, then here is one liner for the same: +++ dpkg -l | grep "^rc" | cut -f3 -d' '|xargs dpkg -P +++ [FYI] If you want it for end user, i would suggest to use synaptic package manager: Go to -> System -> Administration -> Select "Synaptic Package Manager" (SPM). At bottom part of windows you will find number of installed packages. For detail information. You will find rectangle buttons @ left lower corner of SPM, select "Status" to know installed package statistics. Here is image for further information [1]. [1] http://people.canonical.com/~hardik/How-to/Ubuntu_Package_Statistics.png :wq -- Hardik Dalwadi -- ubuntu-in mailing list [email protected] https://lists.ubuntu.com/mailman/listinfo/ubuntu-in
