Install or upgrade a version of a package in the target org.
Description for package install
To install or upgrade a package, specify a specific version of the package using the 04t package ID. The package and the version you specified installs in your default target org unless you supply the username for a different target org.
When upgrading an unlocked package, include the –upgrade-type value to specify whether any removed components are deprecated or deleted. To delete components that can be safely deleted and deprecate the others, specify “–upgrade-type Mixed” (the default). To deprecate all removed components, specify “–upgrade-type DeprecateOnly”. To delete all removed components, except for custom objects and custom fields, that don’t have dependencies, specify “–upgrade-type Delete”. (Note: This option can result in the loss of data that is associated with the deleted components.)
Aliases for package install
force:package:install
Flags
Flag Name (Long)
Flag Name (Short)
Description
‑‑apex‑compile
‑a
Type: Value Valid Values:all, package Default value:all
Compile all Apex in the org and package, or only Apex in the package; unlocked packages only.
Applies to unlocked packages only. Specifies whether to compile all Apex in the org and package, or only the Apex in the package.
For package installs into production orgs, or any org that has Apex Compile on Deploy enabled, the platform compiles all Apex in the org after the package install or upgrade operation completes.
This approach assures that package installs and upgrades don’t impact the performance of an org, and is done even if –apex-compile package is specified.
‑‑api‑version
N/A
Type: Value
Override the api version used for api requests made by this command
‑‑flags‑dir
N/A
Type: Value
Import flag values from a directory.
‑‑installation‑key
‑k
Type: Value
Installation key for key-protected package (default: null).
‑‑json
N/A
Type: Boolean
Format output as json.
‑‑no‑prompt
‑r
Type: Boolean
Don’t prompt for confirmation.
Allows the following without an explicit confirmation response: 1) Remote Site Settings and Content Security Policy websites to send or receive data, and 2) –upgrade-type Delete to proceed.
‑‑package
‑p
Type: Value Required
ID (starts with 04t) or alias of the package version to install.
‑‑publish‑wait
‑b
Type: Value Default value:0 minutes
Maximum number of minutes to wait for the Subscriber Package Version ID to become available in the target org before canceling the install request.
‑‑security‑type
‑s
Type: Value Valid Values:AllUsers, AdminsOnly Default value:AdminsOnly
Security access type for the installed package. Available options are AdminsOnly and AllUsers.
‑‑target‑org
‑o
Type: Value Required
Username or alias of the target org. Not required if the target-org configuration variable is already set.
‑‑upgrade‑type
‑t
Type: Value Valid Values:DeprecateOnly, Mixed, Delete Default value:Mixed
Upgrade type for the package installation; available only for unlocked packages.
For unlocked package upgrades, set this flag to one of these values:
DeprecateOnly: Mark all removed components as deprecated.
Mixed: Delete all removed components that can be safely deleted and deprecate the other components.
Delete: Delete removed components, except for custom objects and custom fields, that don’t have dependencies.
‑‑wait
‑w
Type: Value Default value:0 minutes
Number of minutes to wait for installation status.
Examples for package install
Install or upgrade a package version with the specified ID in the org with username “me@example.com”: