6

I installed a program (Paint.Net) with Choco. At the time, the version was 3.13, but Paint.Net updated itself to 3.15.

However, when I run choco outdated, it still thinks 3.13 is installed and wants to (re)install 3.15.

Is there a way to synchronize what's in the choco local database of installed packages to the actual current version?

This is the free version of choco.

1
+250

This option exists in chocolatey, but only in the paid version. It is called the Sync Command. You may find more information about using it in the above link. A video describing the command can be found on YouTube.

Chocolatey can also do this sync automatically, as described in
Synchronize with Programs And Features (Licensed Editions Only).


A free program manager for chocolatey that does syncing is said to be Deployify, which you might try.

In a pinch, if you don't want chocolatey to update certain package(s), ignoring them, you may use the choco pin command.

To make Chocolatey aware of installed applications without running the installation scripts, use the parameter -n, --skippowershell, --skip-powershell, --skipscripts, --skip-scripts, --skip-automation-scripts (these are all the same switch). See How To Install or Upgrade a Package Without Running Scripts.


You may also interface chocolatey to Microsoft's PowerShell counterpart to the Linux apt-get : OneGet, now renamed to Package management. Package Manager is Microsoft's name, while the underlying open source project is still named OneGet. You would then be able to use PowerShell as the unique interface to both Windows and chocolatey.

You may read about OneGet in the Microsoft blog
What’s New in PowerShell: Getting Started with OneGet in one line with Windows PowerShell 5.0.

OneGet is is a manager of package managers, and it supports chocolatey as a package provider. You may install it in PowerShell by using the Find-PackageProvider command:

enter image description here

You may then use the Install-PackageProvider command to setup the chocolatey interface (although attention as it is yet a prototype, so you will have to feel your way through):

Install-PackageProvider chocolatey -Scope CurrentUser

Here is a PowerShell example of installing Notepad++ from the chocolatey gallery:

enter image description here

You may find more information in the following references:

3

This answer is based on the output of the following command:

choco outdated

Output from choco outdated command

As mentioned in another answer, there is no automatic way in the Open Source version of Chocolatey to update the Chocolatey Package version, based on the version of the application being updated in another way. In a licensed version of Chocolatey, this feature is available.

If you want to do the initial install of an application with Chocolatey, i.e.

choco install paint.net

and then leave the application to update itself, then the best advice would be to pin the package using the pin command. This would be done with the following command:

choco pin add -n="paint.net"

This will mean that when you run the choco upgrade all command, assuming that you are using it, that this package will no longer be considered for an upgrade, even if a new version is found. Additionally, the output from the choco outdated command will change to the following:

Output from choco outdated after pin command

If you REALLY want to remove the entry from the choco outdated report, but you also want to rely on the application's ability to update itself, then you should be able to run the following command:

choco upgrade paint.net --skip-automation-scripts

This tells Chocolatey to upgrade the package to the currently available version, but it will also prevent the execution of the chocolateyInstall.ps1 (and other files) file, which will mean that the application installer will never be executed. As shown here:

Output from choco upgrade command when skipping automation scripts

After running the above command, the output of the choco outdated command then becomes:

Output from choco outdated after upgrade

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.