Sync Package List between 2 PCs

By | 23 Mar 2010

To export a list of all installed packages, you can use the following command:

sudo dpkg --get-selections > selections.txtCode language: JavaScript (javascript)

But this will loose any {A} markers for automatically installed packages and therefore produce a lot of garbage when dependencies change.

To export only manually installed packages, use aptitude like this:

sudo aptitude search '~i!~M' -F '%p install' > selections.txtCode language: JavaScript (javascript)

(More aptitude filterstrings can be found on their project page.)

On the other machine, use the following command to set the new markers:

sudo dpkg --set-selections < selections.txtCode language: JavaScript (javascript)

Now run aptitude and resolve the dependencies.

Leave a Reply

Your email address will not be published. Required fields are marked *

Your post must include a link to this post.

How does this work?
Write a response on your own website and include a link to this post. Then submit your response’s URL here. Your response may appear here after moderation. To update or remove it, edit or delete your original post and submit the same URL again. Learn more about Webmentions.