May 19, 2013, Sunday, 138

Make a copy of the package selection on Debian and Ubuntu and install the packages on a different server

From ezUnix

Revision as of 11:01, 9 September 2011 by YazzY (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
                                    pdf_icon.png Download this article as a single PDF document 

Introduction

You may have a Debian or Ubuntu server with a set of installed packages and you want to install exactly the same packages on a different server.
This HowTo will tell you how to easily do that.


Execution

To make a local copy of the package selection states:

# dpkg --get-selections "*" > myselections .txt  

Or use \* - "*" makes the myselections.txt file include package entries for "purge" too.

If you want to i.e. check only all the PHP packages installed, run:

# dpkg --get-selections "*php*"

Then you simply transfer this file to another computer, and install it there with:

# apt-get update
# dpkg --set-selections <myselections.txt
# apt-get -u dselect-upgrade


Cheers,
Marcin



You are not allowed to post comments. Login or register first.


Talk:Make a copy of the package selection on Debian and Ubuntu and install the packages on a different server