---
title: "How to easily keep your Ubuntu packages in sync"
date: 2009-06-19
canonical: https://michaelshadle.com/2009/06/19/how-to-easily-keep-your-ubuntu-packages-in-sync
---

# How to easily keep your Ubuntu packages in sync

Thanks to [Monty](http://mysql-ha.com/), I've learned something that will save me a lot of headache in the future. I had a bunch of random scripts I wrote myself to try to keep things in sync, turns out most of the work is already all done for me.

On the source host you want to clone:

```
dpkg --get-selections > file
```

On the destination host:

```
dpkg --set-selections < file
apt-get dselect-upgrade
```

Now your machines should be identical, package-wise.
