Skip to main content
Actions

Install or update software

How this action installs a package or updates all outdated packages, which settings it has and when the step fails.

Use this action to install a package or bring it to the version you want. It can also update every package a package manager reports as outdated. The device must be online.

Prerequisites

  • The device must match the package manager: winget or Chocolatey on Windows, APT on Debian or Ubuntu, Homebrew on macOS. Custom packages work on Windows only and need a published version under Configuration → Custom Packages.
  • If Chocolatey is missing on a Windows device, octoja installs it before the first Chocolatey package. For what Homebrew needs on Macs, see the How software deployment works.
  • For Logged-in user under Run as, someone must be signed in to the device when winget, Chocolatey or a custom package runs.

Configuration fields

The properties panel has two fields:

FieldTypeRequiredDefaultDescription
Softwarepackage selectionYes—Search software… opens the Add Software dialog. Afterwards the field shows the package name (or Update all outdated), the package manager and the version (latest when no version is pinned). Change reopens the dialog with the saved values. Exception: for custom packages, you pick the version and parameters again
Run asenumNoSystem (agent identity)System (agent identity) installs for all users and works even when nobody is signed in. Logged-in user runs the package manager in that user's session. The field applies to winget, Chocolatey and custom packages. APT always runs as root, Homebrew as the account that owns the Homebrew installation

In the Add Software dialog, choose the mode first:

ModeWhat it does
Specific package (default)Installs the package if it is missing and updates it to the selected version if it is outdated. There is no update-only option.
Update all outdatedUpdates every package the package manager reports as outdated. You don't set a package name or version. Custom packages aren't offered in this mode.

Then set up the package and confirm with Add to Package:

FieldModeDetails
Package managerBothTabs Chocolatey (preselected), Homebrew, winget, APT and Custom.
Package searchSpecific packageFor Chocolatey, Homebrew and winget, type at least 2 characters and pick a result. Homebrew casks (graphical apps) carry a Cask badge.
Package NameSpecific package, APTAPT has no search. Enter the exact package name as used with apt-get, for example nginx.
VersionSpecific packageLatest (default) or a specific version from the list. For APT, type an exact version or leave it empty. Homebrew always installs the current version.
Custom packageSpecific package, CustomPick one of your published custom packages, then the latest published version or a pinned one, and fill in its parameters. The step's Run as field decides which account it runs under.
Never update these packagesUpdate all outdatedwinget, Chocolatey and APT only. Exact package IDs, case-insensitive: for example Mozilla.Firefox (winget), firefox (Chocolatey) or a name from apt list --upgradable (APT). Press Enter after each one.
Minimum update age (days)Update all outdatedwinget and Chocolatey only. 0–365, default 0 (no delay). Versions that haven't been available for this many days are skipped.

For how the minimum age is measured, see Deploy Software to Devices.

Platform support

PlatformSupported
WindowsYes — winget, Chocolatey, custom packages
LinuxYes — APT on Debian and Ubuntu
macOSYes — Homebrew

Outputs

OutputDescription
successtrue if the step succeeded, otherwise false
actionWhat happened: Installed, Updated, AlreadyUpToDate, Skipped or Failed
installedVersionVersion after the step. Empty in Update all outdated mode
previousVersionVersion before the step. Empty if the package wasn't installed, and in Update all outdated mode

In Insert variable, these outputs are called Succeeded, Action, Installed version and Previous version.

For custom packages, octoja doesn't detect which version was installed before. A successful run therefore always reports action = Installed, the pinned or latest published version as installedVersion and an empty previousVersion. That's true even if the package was already installed.

Result behaviour

Specific package:

CaseResult
Package not installedSucceeded, action = Installed.
Older version installedSucceeded, action = Updated.
Selected version already installed, or Latest and no newer versionSucceeded, action = AlreadyUpToDate.
Package manager reports an errorFailed, action = Failed.
Version unchanged although an update is still availableFailed. The application may have been running, or the package can't be updated with the selected Run as setting.
Package no longer detected after the runFailed.
Package manager doesn't fit the platform, for example Chocolatey on a MacSucceeded, action = Skipped. Nothing is installed.
Custom package version not found or not publishedFailed.

The update and detection cases don't apply to custom packages. If only matching steps should run in a mixed fleet, use a condition.

Update all outdated:

CaseResult
Nothing outdatedSucceeded, action = AlreadyUpToDate.
At least one package updatedSucceeded, action = Updated.
Individual packages couldn't be updatedStill Succeeded. Only an error from the package manager command itself fails the step.
Excluded packagesNot updated. Versions already installed stay as they are.

In both modes:

CaseResult
Logged-in user with nobody signed inFailed for winget, Chocolatey and custom packages. APT and Homebrew run anyway.
Device offline when the step startsDevice offline. Depending on If device is offline, the run ends with this status or the step is skipped.
No answer from the device within five minutesTimed out.

With the default On failure setting, a failed step stops the workflow. If later steps should run anyway, choose Continue to next step.

Test step and Test run really install and update software. Try a new step on one suitable device first.

See also: Create an automation · Deploy Software to Devices · How software deployment works · Build and Deploy a Custom Package