Inventory Installed Software on Ubuntu 12.04
Log In or Register to download the BES file, and more.

2 Votes

Collections (part of 1 collection)

Ubuntu

Description

http://www.howtogeek.com/howto/linux/show-the-list-of-installed-packages-on-ubuntu-or-debian/
suggests using the following commands to get a list of currently installed software:

dpkg --get-selections

or find files within a package using:

dpkg -L openssh-server

 

to dump all "available" packages... use the following command:

 

On local system

Using your local package management caches a simple use of some shell scripting:

apt-cache dumpavail | grep ^Package | cut -d " " -f 2 | sort | uniq

This just lists package names, so it's not the same as using the Software Centre API, but it will list all package names you can use later to query the API with, I guess. This lists 38820 packages on my system. Be aware that it may contain non-Ubuntu repository backed packages, so not all of them might be available in the SC.

Note: on amd64 systems with Multiarch enabled apt-cache will list many double ones, so that's why the uniq tool is used.


Or online at:

http://packages.ubuntu.com/precise/allpackages?format=txt.gz or http://packages.ubuntu.com/precise/  (click the link at the bottom that says "all packages"


Property Details

ID1426
StatusQA - Ready for Production Level Testing
TitleInventory Installed Software on Ubuntu 12.04
DomainBESC
CategoryInventory
Download Size0
Sourcedanielheth@bigfix.me
Source ID<Unspecified>
Source Severity<Unspecified>
Source Release Date4/27/2013 12:00:00 AM
KeywordsCODE packages ubuntu Inventory package
Is TaskTrue
Added by on 5/1/2013 9:11:00 PM
Last Modified by on 5/2/2013 1:49:48 PM
Counters 5888 Views / 37 Downloads
User Rating 1 star 2 star 3 star 4 star 5 star * Average over 2 ratings. ** Log In or Register to add your rating.

Relevance

Used in 11 fixlets and 1 analsis   * Results in a true/false
Show indented relevance
name of operating system contains "Ubuntu"
Used in 2 fixlets   * Results in a true/false
Show indented relevance
exists file "apt-cache" of folder "/usr/bin"
Used in 2 fixlets   * Results in a true/false
Show indented relevance
exists file "dpkg" of folder "/usr/bin"

Actions

Action 1 (default)

Action Link Click here to deploy this action.
Script Type BigFix Action Script
//first get a list of currently installed applications
delete __appendfile
appendfile #!/bin/sh
appendfile dpkg --get-selections > "{pathname of parent folder of client}/installedApps.txt"
delete "installedApps.sh"
delete "{pathname of parent folder of client}/installedApps.txt"
move __appendfile "installedApps.sh"
wait chmod +x installedApps.sh
wait ./installedApps.sh
//then get a list of all available applications
delete __appendfile
appendfile #!/bin/sh
appendfile apt-cache dumpavail | grep ^Package | cut -d " " -f 2 | sort | uniq > "{pathname of parent folder of client}/availableApps.txt"
delete "availableApps.sh"
delete "{pathname of parent folder of client}/availableApps.txt"
move __appendfile "availableApps.sh"
wait chmod +x availableApps.sh
wait ./availableApps.sh
Success Criteria

This action will be considered successful when the applicability relevance evaluates to false.


Sharing

Social Media:
Share this page on Yammer

Comments

Log In or Register to leave comments!