views:

2077

answers:

6

I'm looking at maybe moving from an older AMD64 to a new Intel dual-core which is 32 bit. Installation isn't a problem but can I transfer all the installed apps? I haven't been able to find anything so far on Google except where the migration is to a similar platform and file-system. I won't change the filesystem but the platform will be different. Is there something on the lines of the "World" file in Gentoo?

+1  A: 

For everything you've used apt-get to install, if you want to create a record of what's installed run the following:

dpkg -l|awk '/^ii\s*(.*)\s*/ {print $2}'|packages.txt

This will create a text file with all the packages you have installed. Then after you do the install, create and run a script with the following:

#!/bin/sh
for p in $(cat packages.txt); do apt-get install $p; done

Notes:
1) Since you're moving from 64 bit to 32 bit, some of the packages might not be compatible. I would grep packages.txt for '64' before running the script above and find alternatives if they are needed.
2) Anything you've installed from source, you'll have to make a note of and install from source again.

Good luck!

Mark Roddy
A: 

The best way I can think of to go about this is to back up the list of installed packages on your current system and then use that list to set what packages to install on the new system. See http://www.arsgeek.com/2006/09/19/ubuntu-tricks-how-to-generate-a-list-of-installed-packages-and-use-it-to-reinstall-packages/ for instructions on how to generate the list and then restore from it:

Backup Package List

dpkg –get-selections | grep -v deinstall > ubuntu-files

Restore Package Selections

sudo apt-get update
sudo apt-get dist-upgrade
dpkg –set-selections < ubuntu-files
sudo dselect

This will open up a dselect session. Type ‘I‘ and allow dselect to install of the the packages listed in your ubuntu-files document. When it’s finished, type ‘Q‘ and hit the ENTER key to exit dselect.

Jay
+4  A: 

You can save your list of packages easily: see "man dpkg" and search for --set-selections and --get-selections.

The basic of it, though is that to save the list of packages:

dpkg --get-selections > package_list

To restore that list on another system:

cat package_list | sudo dpkg --set-selections && sudo apt-get dselect-upgrade

Moving across architectures means that there will be some packages unavailable. They will be ignored; for example, ia32-libs will not be installable on a 32-bit system. That selection will be ignored if you're moving from x86-64 to x86.

Michael Trausch
+1  A: 

Funny, here I was using SO as a howto repository (write a question and then select my own answer), but in the time that it took me to write my own answer, I was beaten to the punch thrice!

Anyway, here's my take for the record:

Use dpkg's --get-selections and --set-selections options to capture and select your currently installed packages.

First, export your current package list on your old system:

sudo dpkg --get-selections > mypackages.txt

Then select this list as the packages to install on your new system:

sudo dpkg --set-selections < mypackages.txt

(For extra credit, copy your apt cache directory over to minimize downloads: /var/cache/apt)

Finally, tell apt to download and install the selected packages:

sudo apt-get dselect-upgrade
michaeljoseph
A: 

I'm not sure if this is an answer, but I just discovered the existence of the command aptitude-create-state-bundle. Yes, that's one command. Check out the man page.

OliBlogger