How to get a list of packages from one machine and install in another with Chocolatey?

If you have a look at the help information for the choco install command (you can do this using choco install -h, you will find the following usage:

cinst <pkg|packages.config> [<pkg2> <pkgN>] [<options/switches>]

As you will see, it is possible to pass a packages.config file, which would contain all the packages that you want to install. The format of this packages.config file is very simple and looks like the following:

<?xml version="1.0" encoding="utf-8"?>
<packages>
  <package id="calibre" version="2.81.0" />
  <package id="chocolatey" version="0.10.3" />
  <package id="chocolatey.extension" version="1.9.6" />
  <package id="chocolatey-core.extension" version="1.1.0" />
</packages>

Once you have this file, installing all the packages again on another machine is a simple one line command.

A simple way to generate this packages.config file would be to install ChocolateyGUI (choco install chocolateygui), which includes an option to export the currently installed list of applications.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)