On 05/10/2015 at 04:53 AM, Mohsen Pahlevanzadeh wrote: > On 05/10/2015 09:14 AM, Johannes Schauer wrote: > >> Hi, >> >> Quoting Mohsen Pahlevanzadeh (2015-05-10 05:53:17) >> >>> When i use : grep ^Status: /var/lib/dpkg/status , Unfortunately , >>> i only get "Status: install ok installed" >> >> how sure are you of that? Did you just look at the first few >> hundred or did you really find all unique values? Try: >> >> grep ^Status: /var/lib/dpkg/status | sort | uniq -c >> >> cheers, josch > > It's very interseting : > ///////////////////////////////////////////////////////////////////////// > I did : > root@debian:/home/mohsen# grep ^Status: /var/lib/dpkg/status | sort | uniq -c > 1 Status: install ok config-files > 2803 Status: install ok installed > ////////////////////////////////////////////////////////////////////
For comparison, I get> ======== $ grep ^Status: /var/lib/dpkg/status | sort | uniq -c 479 Status: deinstall ok config-files 2 Status: hold ok installed 3604 Status: install ok installed ======== > But : > > /////////////////////////////////////////////////////////////////// > root@debian:/home/mohsen# dpkg -l virtualbox* > 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 Architecture Description > +++-==============-============-============-================================= > un virtualbox <none> <none> (no description available) > ii virtualbox-4.3 4.3.22-98236 amd64 Oracle VM VirtualBox > un virtualbox-gue <none> <none> (no description available) > un virtualbox-ose <none> <none> (no description available) > //////////////////////////////////////////////////////////////////////////////////////////////// Yes, this makes sense. The logic as I understand it is that 'dpkg -l' effectively starts out by assuming that everything is in status "un", and overrides that for every package which is listed in /var/lib/dpkg/status. If that weren't true, then it would be necessary for your system to keep a list of _all available packages_ in /var/lib/dpkg/status - and since packages can come from multiple sources, there is no possible way (short of being omniscient) to compile a list of all available packages, much less keep it up to date every time someone in the world makes a new package version. If you've never installed a package, or if it has been fully purged and has (or should have) no remnants remaining on the system, then it will not be included in /var/lib/dpkg/status - and 'dpkg -l' will report status "un". -- The Wanderer The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore all progress depends on the unreasonable man. -- George Bernard Shaw
signature.asc
Description: OpenPGP digital signature