9.5 Adding or Removing Package Locks

You can configure package locks on managed devices to prevent the removal or upgrade of packages on the managed devices.

You can perform this action either by using the ZENworks Icon or from the command line utility. This section describes how to perform this action by using the command line utility.

For more information on how to lock or unlock packages by using the ZENworks Icon, see the ZENworks Agent guide.

9.5.1 Adding a Package Lock

  1. List all the packages installed on the managed device by entering the zac search command. From the list, select the package you want to lock.

  2. Lock the package by using the zac lock-add (name or pattern) [version] command.

    This command locks the specified packages. The packages that match the specified regular expression or string are not upgraded or removed. The package name can be specified individually, with wildcard patterns, or even with version number relations. The version number should be specified within single or double quotes.

    Relational Operator

    Functionality

    =

    Locks only the specific package version.

    <

    Locks all versions of the package older than the specified version, excluding the specified version.

    >

    Locks all versions of the package later than the specified version, excluding the specified version.

    <=

    Locks all versions of the package older than the specified version, as well as the specified version.

    >=

    Locks all versions of the package later than the specified version, as well as the specified version.

    If you want to install a specific version of the package, the zac lock-add command first checks if the package version has been locked, then installs the package version only if it is not locked.

    For example, assume that all the later versions of the package “X 1.7” have been locked by using the zac lock-add X '>' 1.7 command. If you try to install the X 1.9 package by using the zac install X (1.9) command, the installation fails.

    For more information on this command, see the ZENworks Command Line Utilities Reference.

  3. Ensure that the package is locked by using the zac lock-list command. This displays all the locked packages.

9.5.2 Removing a Package Lock

  1. List all the packages that are locked on the managed device by using the zac lock-list command. This displays the package name and its lock number.

  2. Select the package you want to unlock.

  3. Unlock the package by using the zac lock-delete lock_number command.

    For more information on this command, see the ZENworks Command Line Utilities Reference.

  4. Ensure that the package is locked by entering the zac lock-list command. This displays only the locked packages.