Linux list installed packages and install from list

The goal is to make a list of manually installed packages, then be able to install that list on another Linux computer.

http://superuser.com/questions/132614/how-to-list-manually-installed-software-packages-in-ubuntu

aptitude can do what are you looking for and much more, actually.

aptitude search ‘?installed ?not(?automatic)’

Or shorter:

aptitude search ‘~i!~M’

will list all the packages installed manually. None of the dependent (i.e., like mysql-data, or *-common, that are installed automatically) packages will be listed.

If you want just package names, use -F ‘%p’ parameter.

You can check out search patterns reference, there’s virtually no criteria it can’t search for.

 

Now to take that command and output it to a file

aptitude search ‘~i!~M’ >  > ~/installed-software.log

Then use that to install the same software to a new machine

aptitude install $(cat ~/installed-software.log | awk ‘{print $1}’)

Another way to install is this

sudo dpkg --set-selections < ~/packages && apt-get dselect-upgrade

 

 

For a basic overview of Linux package commands:

http://www.cyberciti.biz/tips/linux-debian-package-management-cheat-sheet.html

And more extensive reading/commands discussion

http://askubuntu.com/questions/17823/how-to-list-all-installed-packages

For a more extreme package report/install system see

http://devstructure.com/blueprint/