LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   dpkg list (https://www.linuxquestions.org/questions/linux-newbie-8/dpkg-list-4175503904/)

AlexBB 05-04-2014 11:43 AM

dpkg list
 
Hi there,

I issued this command:

$
Code:

dpkg --get-selections >pkg-list
As a result I got a file with a list which is mile-long. In the second column there is a single word "install." It is printed against the name of every package. Does it mean that this package is already installed or needs to be installed?

It looks they are all installed but I am not sure because the answer to

Code:

$ dpkg -l xterm
for instance is confusing.

Thanks, - Alex

jdkaye 05-04-2014 12:35 PM

This is taken from the man page of dpkg
Quote:

--get-selections [package-name-pattern...]
Get list of package selections, and write it to stdout. Without a pattern, non-
installed packages (i.e. those which have been previously purged) will not be
shown.
Code:

dpkg -l aptitude
yields this:
Quote:

:~$ dpkg -l aptitude
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
+++-===================-==============-==============-===========================================
ii aptitude 0.6.10-1 amd64 terminal-based package manager
where the "ii" at the beginning of the final line means it's installed.
The entry for aptitude in the pkg-list created per your command yields this:
Quote:

aptitude install
We can conclude that "install" in the pkg-list means alrealy installed. I'm not clear why you find the output of dpkg -l xterm confusing.

jdk

AlexBB 05-04-2014 02:21 PM

The confusing part starts with Desired... etc:

Quote:

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)
What does it all mean? It is pure gibberish to me.

Thanks, - Alex

Shadow_7 05-04-2014 02:22 PM

That is how you transfer the list of installed packages between installs. With a variant with --set-selections on the other install. So yes, it's a list of installed packages. If you want that list in a different format of sorts.

# dpkg -l

If you want a list of ALL available packages.

# dpkg-query --load-avail -l '*'

And probably dozens of other ways for the same basic stuff.

AlexBB 05-04-2014 03:37 PM

Quote:

And probably dozens of other ways for the same basic stuff
Yep, Linux is enormous.


All times are GMT -5. The time now is 07:47 AM.