mirror of
https://github.com/mbirth/wiki.git
synced 2024-11-09 13:16:45 +00:00
31 lines
933 B
Markdown
31 lines
933 B
Markdown
|
---
|
||
|
title: Sync Package List between 2 PCs
|
||
|
layout: default
|
||
|
created: 2010-03-23 17:53:30 +0100
|
||
|
updated: 2010-03-24 10:39:37 +0100
|
||
|
toc: false
|
||
|
tags:
|
||
|
- know-how
|
||
|
- software
|
||
|
- linux
|
||
|
- administration
|
||
|
---
|
||
|
To export a list of all installed packages, you can use the following command:
|
||
|
|
||
|
sudo dpkg --get-selections > selections.txt
|
||
|
|
||
|
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.txt
|
||
|
|
||
|
(More `aptitude` filterstrings can be found on [their project page](http://algebraicthunk.net/~dburrows/projects/aptitude/doc/en/ch02s03s05.html).)
|
||
|
|
||
|
On the other machine, use the following command to set the new markers:
|
||
|
|
||
|
sudo dpkg --set-selections < selections.txt
|
||
|
|
||
|
Now run `aptitude` and resolve the dependencies.
|