Record Installed .deb Packages In A Text File (Ubuntu/Debian)

Version 1.0

Author: Falko Timme



This short guide shows two methods of recording all your installed .deb packages in a text file that you can then use on another computer to install the same packages there. This is useful if you want to install the same set of packages on more than one computer.

I do not issue any guarantee that this will work for you!

1 Preliminary Note

I will show how to do this on the desktop (with Synaptic) and on the command line. I'm using a USB stick to store the text file; that way I can simply plug in the USB stick with the text file into the other computer and start the package installation there.

If you try this, please make sure the the file /etc/apt/sources.list is identical on both systems (if you like, you can also copy that file to the USB stick so that it can be used on the other computer).

2 Synaptic Package Manager

This chapter shows how you can create the package file with the Synaptic Package Manager. Open the Synaptic Package Manager (System > Administration > Synaptic Package Manager):

Then go to File > Save Markings or File > Save Markings As...:

Type in a name for the file (e.g. my_packages.txt) and check Save full state, not only changes (otherwise it would save only the changes that you've made in the current Synaptic session). Select your USB stick to save the file (my USB stick is named disk):

That's it. Now plug the USB stick into the other computer, open Synaptic, and go to File > Read Markings...:

Select the my_packages.txt file from the USB stick:

Afterwards, you should notice that some packages are marked (the ones that are installed on the first system, but not on this one). Click on Apply to start the installation:


3 Command Line

This chapter shows how you can create the package file on the command line. Open a terminal (Applications > Accessories > Terminal) and type:

sudo dpkg --get-selections "*" > /media/disk/my_packages.txt

(I'm assuming that /media/disk is your USB stick.)

Now plug the USB stick into the other computer, open a terminal there and run...

sudo dpkg --set-selections < /media/disk/my_packages.txt

sudo apt-get -u dselect-upgrade

... to start the package installation (I'm assuming that the USB stick's mount point on the second computer is /media/disk again). Advertisement