Package Reducer (Licensed Editions Only)

Reduce the size of your package installations automatically!

If you have a significant number of Chocolatey packages you manage, you may notice that you also may have a pretty significant space usage under the Chocolatey lib directory. Package reducer automatically decreases the size of nupkg files to around 5KB and removes installers and zips automatically from your package install directories. This may allow you to save GBs of usage for a large amount of packages being managed!

Automatic

Usage

When you normally create packages that embed or download resources, the impact on a system includes the following:

Typically with this in mind, the size of nupkg could account for an up to 4x impact on a system considering the above. So we typically recommend organizations set a comfortable threshold for package sizes (around 500MB) before splitting out binaries to downloaded resources.

Package Reducer nearly removes that need as it reduces the nupkg file to 5KB by removing all the embedded files. Then it takes it a step further and removes zip and installers from the package directory automatically (configurable by a feature switch, see Setup).

When you turn on Package Reducer, the first two items above no longer take up any significant space. This can reduce space usage in the order of GBs for some installations of Chocolatey.

With Package Reducer:

The following file extensions are removed automatically:

So the space usage impact changes to what you'd normally experience outside of Chocolatey:

Requirements

Setup

To turn on Package Reducer, you need to run the following:

See It In Action

Package Reducer - if you are on https://chocolatey.org/docs/features-package-reducer, see commented html below for detailed description of image

Options and Switches

Global Config Setting:

choco install / choco upgrade provide the following option(s):

     --reduce, --reduce-package-size, --deflate, --deflate-package-size
     Reducer Installed Package Size (Package Reducer) - Reduce size of the
       nupkg file to very small and remove extracted archives and installers.
       Overrides the default feature 'reduceInstalledPackageSpaceUsage' set to
       'False'. Licensed editions only (version 1.12.0+). See
       https://chocolatey.org/docs/features-package-reducer

     --no-reduce, --no-reduce-package-size, --no-deflate, --no-deflate-package-size
     Do Not Reduce Installed Package Size - Leave the nupkg and files alone
       in the package. Overrides the default feature
       'reduceInstalledPackageSpaceUsage' set to 'False'. Licensed editions
       only (version 1.12.0+). See https://chocolatey.org/docs/features-package-reducer

     --reduce-nupkg-only, --deflate-nupkg-only
     Reduce Only Nupkg File Size - reduce only the size of nupkg file when
       using Package Reducer. Overrides the default feature
       'reduceOnlyNupkgSize' set to 'False'. Licensed editions only (version -
       1.12.0+). See https://chocolatey.org/docs/features-package-reducer

FAQ

How do I take advantage of this feature?

You must have a licensed edition of Chocolatey (Pro, MSP, or Business) and use the community package repository to install/upgrade packages. Pro is a personal, named license that costs about the price of a lunch outing per month and comes with several other features. Business editions are great for organizations that need to manage the total software management lifecycle. MSP editions are for managed service providers and contain the same features as Pro (minus VirusTotal integration).

I'm a licensed customer, now what?

Once you have set up the feature(s), it will automatically reduce the size of the packaging on install and upgrade.

How does it work?

It just works. When you install or upgrade a package, it will automatically reduce the size of the installation directory if you've set up Package Reducer properly.

How do I turn this feature on?

How do I turn this feature off?

Can I just deflate nupkg file sizes?

Yes!

Can I apply reducer to already installed packages?

See the next section, the choco optimize command.

Optimize Command

NOTE: CURRENTLY IN PREVIEW - see setup below.

Package Reducer's Package Optimizer is available in all licensed editions starting at Chocolatey Licensed Extension v1.12.0. It is similar to the automatic reduction, except it reduces the size of existing installations.

With Package Optimizer:

The following file extensions are removed automatically:

Usage

choco optimize [<options/switches>]

Requirements

Setup

Optimize is currently in preview. You need to turn it on by enabling the feature allowPreviewFeatures:

Examples

choco optimize
choco optimize --reduce-nupkg-only

See It In Action

choco optimize - if you are on https://chocolatey.org/docs/features-package-reducer, see commented html below for detailed description of image

Options and Switches

    --reduce-nupkg-only, --deflate-nupkg-only
    Reduce Only Nupkg File Size - reduce only the size of nupkg file when
      using Package Optimizer. Licensed editions only (version 1.12.0+).

FAQ

How do I take advantage of this feature?

You must have a licensed edition of Chocolatey (Pro, MSP, or Business) and use the community package repository to install/upgrade packages. Pro is a personal, named license that costs about the price of a lunch outing per month and comes with several other features. Business editions are great for organizations that need to manage the total software management lifecycle. MSP editions are for managed service providers and contain the same features as Pro (minus VirusTotal integration).

I'm a licensed customer, now what?

Once you have set up the allowPreviewFeatures feature(s), you can just run choco optimize. Couple it with package reducer features to automatically ensure your Chocolatey installation stays very small.

How does it work?

It goes through all existing packages and removes unnecessary installers and zips. It also deflates nupkg files down to 5KB or less.