Copy a package using pucl commands

We can copy a package from a repository in to an accessible repository location for installation in an enterprise environment using the copy command for the IBM Packaging Utility command line, pucl.

If we use repositories that require authentication, create a storage file. The -keyring and -password options that are used to store credentials to a key ring file are deprecated. Use the -secureStorageFile and -masterPasswordFile options to store credentials to a credential file. For more information, see Migrate from key ring files to storage files. For versions 1.6.1 and earlier, use the -keyring option. For more information, see Store credentials in a key ring file.

Copy to remote HTTP and FTP repositories is not supported. We cannot use HTTP or FTP repositories as target repositories. Some packages require entitlement for versions or fixes. If we are not entitled for an update, the update is not copied. Entitlement is based on your IBM ID credentials. For information about entitlement, see IBM Entitlement Help.

Procedure

  1. Open a command-line utility.

  2. Open the Packaging Utility directory for your operating system.

    • Windows: install_dir\IBM\Packaging Utility
    • Linux, UNIX, and IBM z/OS : install_dir/IBM/PackagingUtility
    • OS X: install_dir/IBM/Packaging Utility

  3. To copy a package:
    pucl copy packageID_version 
    	-repositories source_repository 
    	-target destination_repository
    	[ -connectPassportAdvantage ] 
    	[ -secureStorageFile storage_file -masterPasswordFile master_password_file | -keyring keyring_file [ -password password ] ]
    	[ -platform os=os|arch=arch|os=os,arch=arch ]
    	[ -preferences preference_key=value ] 
    	[ -preview ]
    	[ -prompt ]
    	[ -showPlatforms ]
    	[ -useServiceRepository ]
    	-acceptLicense

    Enclose file paths that include spaces with double quotation marks.

    Restriction: We can use the -platform option only one time for each copy command. We can specify only one value for the -platform option. To copy files for multiple platforms, we must run the copy command for each platform. For more information about the values for the -platform option, see Command-line arguments for the pucl command. These examples use the -secureStorageFile and -masterPasswordFile options:

    • Windows: pucl.exe copy com.ibm.package_1.0.0 -repositories http://server/repository/package/ -target "C:\IBM\IBM Packages\" -secureStorageFile C:\credential.store -masterPasswordFile C:\master_password_file.txt -acceptLicense
    • Linux, UNIX, z/OS, and OS X: ./pucl copy com.ibm.package_1.0.0 -repositories http://server/repository/package/ -target /var/ibm/ibm_packages -secureStorageFile /var/credential.store -masterPasswordFile /var/master_password_file.txt -acceptLicense


Examples of creating repositories using the copy command

Example: Use the -platform option to create a repository for a base offering: Product 1.0.0. Only the files that are required for the platform are copied.

Example: Create a repository for an update offering, Product 1.0.1. List both the base offering and the update offering repositories using the -repositories option. We can access the repository to install Product 1.0.1, or update from Product 1.0.0 to Product 1.0.1.

Example: Create a repository to deploy packages to computers that do not have internet access by taking these steps:

  1. On a computer that has internet access, download the base offering for a package.

  2. Create a repository containing the base offering of the package using the copy command.

    Windows: pucl.exe copy com.ibm.package_1.0.0 -repositories C:\repository\package_1.0.0 -target C:\baseOfferingRepository

    Linux, UNIX, z/OS, and OS X: ./pucl copy com.ibm.package_1.0.0 -repositories /var/ibm/repository/package_1.0.0/ -target /var/ibm/baseOfferingRepository

  3. Use the listAvailablePackage command with the -repositories and -useServiceRepository options to find available versions for the package. The -repositories option points to the repository we created in the previous step. The -useServiceRepository option searches the service repositories for later versions of the package.

    Windows: pucl.exe listAvailablePackages -repositories C:\baseOfferingRepository -useServiceRepository

    Linux, UNIX, z/OS, and OS X: ./pucl listAvailablePackages -repositories /var/ibm/baseOfferingRepository -useServiceRepository

  4. Use the copy command with the -repositories and -useServiceRepository options to copy the selected version to the repository.

    Windows: pucl.exe copy com.ibm.package_1.0.3 -repositories http://server/repository/package_1.0.3/ -target C:\baseOfferingRepository -useServiceRepository

    Linux, UNIX, z/OS, and OS X: ./pucl copy com.ibm.package_1.0.3 -repositories http://server/repository/package_1.0.3/ -target /var/ibm/baseOfferingRepository -useServiceRepository

Related reference:
  • Command-line arguments for the pucl command
    Home