diff --git a/content/technical/2009/01/determining-non-automatically-installed-debian-packages.html b/content/technical/2009/01/determining-non-automatically-installed-debian-packages.html
index cfbe787..f1b0d1a 100644
--- a/content/technical/2009/01/determining-non-automatically-installed-debian-packages.html
+++ b/content/technical/2009/01/determining-non-automatically-installed-debian-packages.html
@@ -1,13 +1,14 @@
Tonight I began migrating from my current VPS at vpsFarm to a new one at Crucial Paradigm. The primary driver behind this is financial. Firstly I wanted to reduce the cost of running a VPS and secondly I wanted a VPS billed in Australian dollars so I wasn't exposed to wildly varying value of the Australian dollar. Due to the recent slump in the exchange rate the vpsFarm server started costing $10 or so more a month.
+
With my fresh Debian 4 VPS up and running I now wanted to install all the various packages that I had on the vpsFarm server. However I'm aware that when using aptitude to install packages it tracks which ones were included automatically as dependencies and can then clean them up if they are later on no longer needed by anything. As a result of this I didn't want to just install every package listed by `dpkg -l`
on the old server. The solution I came up with was as follows. Its not particularly elegant but got the job done:
-
# On old server -aptitude search '~i' | grep -v 'i A' > ~/installed.txt -# scp installed.txt to new server -# Then on new server -aptitude search '~i' | grep -v 'i A' > ~/installed2.txt -# Then determine which ones the new server doesn't have already -diff installed*.txt | awk '{ print $3 }'|sort |uniq+ # On old server + aptitude search '~i' | grep -v 'i A' > ~/installed.txt + # scp installed.txt to new server + # Then on new server + aptitude search '~i' | grep -v 'i A' > ~/installed2.txt + # Then determine which ones the new server doesn't have already + diff installed*.txt | awk '{ print $3 }'|sort |uniq I joined the resulting list into a single line (Text > Unwrap Selection in TextMate or :%j in vim), removed a few that I didn't want then did
sudo aptitude install
and pasted the list of packages from TextMate. The aptitude search '~i'
lists installed packages, the grep
removes ones that were automatically installed and the diff
finds ones that the new server doesn't already have.
\ No newline at end of file