Re: how many Linux machines do you run?

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

 



Tim,
Sorry if I am being a moose feather, but I do not use Linux.
as I am sharing the data, i. e. want it saved in a file, do I need the Install-print part of the command?



On Mon, 15 Jul 2024, Tim Chase wrote:

 $ dpkg --get-selections | awk '$NF == "install"{print $1}' > list_of_packages.txt

The "dpkg --get-selections" lists all of the packages, then the
"awk" portion filters it to those that are currently installed, and
prints the package-name.  The results can be dumped to the screen,
sent to a file (as above) or piped to "less" for review, whichever
you prefer.

-tim

On 2024-07-15 17:53, Karen Lewellen wrote:
Hi Tim,
the goal would indeed be currently installed packages, seems to be Debian,
as dpkg seems to be here.
may I have the command for  installed packages again?
here it starts with dkg, and I want to be sure this is not a typo.



On Mon, 15 Jul 2024, Tim Chase wrote:

If the server is running an RPM-based distribution, then rpm -qa, but it
will likely print out a list of thousands of packages

Is there a way to copy output into a file?

The usual Unix way:

$ rpm -qa > list_of_packages.txt

and you can then review "list_of_packages.txt" as you see fit.

If it's a Debian-based system, you can use "dpkg" to obtain similar
info:

$ dpkg --get-selections > list_of_packages.txt

which will include all installed and installed-but-then-uninstalled
packages.  If you only want the currently-installed packages, you
can use

$ dpkg --get-selections | awk '$NF == "install"{print $1}' > list_of_packages.txt

-tim











[Index of Archives]     [Linux Speakup]     [Fedora]     [Linux Kernel]     [Yosemite News]     [Big List of Linux Books]