I recently got a new laptop (more on this in another post, perhaps). After I installed Debian Linux from scratch and copied my home directory over to it, I needed to install all the software I used on my old machine. Here’s one way to do this.
On your old system, create a list of your installed packages:
dpkg -l > old_packages cat old_packages | awk '{print $2}' | sort > old_packages_list
Copy the file old_packages_list
to your new system. Then, on your new system, run:
dpkg -l > new_packages cat new_packages | awk '{print $2}' | sort > new_packages_list comm -2 -3 old_packages_list new_packages_list > missing
The file missing
now contains a list of packages that existed on your old system that don’t exist on your new one.
If you don’t work with many library packages directly, you can filter them out by reverse grepping for ones that begin with “lib”. (These are installed automatically as dependencies for other things; you don’t usually need to worry about them unless you need them for development.)
cat missing | egrep -v "^lib" > missing_apps_only
Going through this list, I could quickly identify all the software I recognized and wanted to install, and skip packages no longer useful to me (programs to burn CDs and DVDs, for example, since my new machine doesn’t have a drive) or applications I only played with once or twice. And I didn’t install things I didn’t recognize—I can always install them later.
This gets your new computer up and running in short order.