I have one machine setup with the apps I need, and I'd like to install the same on a new Ubuntu box.
Is there a script that will list all the installed apps, so that I can diff between the boxes and so add the missing items?
Thanks in advance, Chris
I have one machine setup with the apps I need, and I'd like to install the same on a new Ubuntu box.
Is there a script that will list all the installed apps, so that I can diff between the boxes and so add the missing items?
Thanks in advance, Chris
Aswell as the dpkg tricks mentioned by pjz, you may also want to look at etckeeper (tutorial ) - an app that puts your /etc/* under version control, making it easier to find any changes you've done and replicate them to other servers.
Also, for a shorter list than that produced by pjz's method, you can use
$ deborphan -a --no-show-section > /tmp/mypackagelist
This will give you a list of packages that will install all the other packages you require as dependencies. Can be useful if you actually want to look through the list. (dpkg --get-selections will produce a loooong list). In addition the list is short enough that you could add newlines and comment out entries with '#'. Then when installing the extra packages you can do
$ grep -v '#' /tmp/mypackagelist | xargs apt-get install -y
This way, if there are some packages you only want to install on some machines, you don't have to delete them from the package list altogether.
dpkg --get-selections >/tmp/mypackagelist
should do the trick. Then, after making sure that your /etc/apt/sources.list on the new machine has the same set of entries as on the old, copy mypackagelist over to the new machine and do:
cat mypackagelist | xargs apt-get -y install
and you should be good to go.
Note that the dpkg --get-selections line is also good info to put into your /etc/dir ocassionally - it means you don't have to bother to back up /bin/ and /usr/bin/ and such because you know what packages are on the system.
Ubuntu Forums has a good answer
Some additional links from the forums discussion:
The better dpkg commands may be [original machine]
dpkg --get-selections | grep -v deinstall > packages_list
then when installing [new machine; after transferring the packages_list]
sudo dpkg --set-selections < packages_list
sudo apt-get -u dselect-upgrade
If you're not a CLI fan (although you really should be), you can use the Synaptic package manager to save the image of the installed packages, and use that file (again through Synaptic) to load the new machine. Under the file/save markings option, there is a checkbox called "save full state".
Why aren't you just clonning the machine using dd?
There is a tool called ReMasterSys that can do it for you. see http://geekconnection.org/remastersys/
I hope that will be of use.
Using FSArchiver to replicate the machines is perfectly acceptable. Otherwise, here are useful pairs of commands, the first half of which you can also add to your backup cron:
debconf-get-selections
debconf-set-selections
~
aptitude-create-state-bundle
aptitude-run-state-bundle --unpack
~
dpkg --get-selections
dpkg --clear-selections; dpkg --set-selections
Locations you should replicate are /etc and /var. The above commands manipulate a few files in /var directly, and some conffiles in /etc indirectly via debconf. You will get the same effect by just replicating those subtrees and running aptitude.
I guess Docker would be the way to do this now - define the requirements in a Dockerfile - you can then run it on any Docker host.