Sign up ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

I'll change my system from 32 bits to 64 bits, and will be the same I had before, Debian Squeeze, but I do not want to lose the programs I installed before, because I do not remember the name of them all.

So I wanted a command to do this for me, save the name of all the programs I installed on a file, but not the standard programs that came with the system, and when I'm using the other system I would mention the name of the file and your directory for everything to be installed automatically.

One more question: is it possible to do this with programs that were installed manually with dpkg-i package.deb? If so, how can I do that?

share|improve this question

3 Answers 3

up vote 6 down vote accepted

Have you tried to use dpkg --get-selections >packages? If you want to exclude some packages, you can edit the output file packages. When you're done, transfer it to the target system and say:

dpkg --set-selections <packages

And packages will be marked for installation. You'll most likely also need to say aptitude update; aptitude dist-upgrade.

The other question: if those packages are i386 architecture packages, and you have multiarch installed, you can install the .debs with the usual dpkg -i package.deb. But it's probably better to investigate on a case-by-case basis and install 64 bit versions of those packages that have them.

share|improve this answer
Thanks, you really helped me when you said about the packages already installed are in i386 architecture, I hadn't thought about it, I think is better re-install those others. – Zignd Jun 21 '12 at 13:52

You can get a list of explicitly installed packages with

aptitude search '~i !~M' -F %p >package.list

~i matches installed packages; !~M omits the packages that were installed automatically as a dependency of some other package. -F %p changes the output format to include only the package name.

You can later install those packages with

apt-get install $(cat package.list)
share|improve this answer

I don't see a simple, standard way to do so. I'm afraid you'll have to fiddle with dpkg's logs and options, because dpkg doesn't distinguish the "standard programs that came with the system" and the others.

THIS WON'T BE STRAIGHTFORWARD, I prefer to make it clear by using bold capitalized text, but you can do something like this

  • Extract the list of installed software from the /var/log/dpkg.log* files.

  • Remove those installed during system install. (Use the install time to detect them)

  • Save the list in the dpkg --get-selections format

Et voilà! When your system is up and running, reinstall your programs with

 apt-get update
 dpkg --set-selections < yourSelection
 apt-get -u dselect-upgrade
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.