Page tree

BMC Server Automation provides a common Patch Downloader utility for Ubuntu and Debian operating systems. The utility uses a configuration file to download metadata and payload from the third-party websites.

The following steps explain how to build the configuration file and how to use the downloader utility for Ubuntu or Debian:

Downloading the offline patch downloader utility

From the BMC Software Electronic Product Distribution (EPD) website, download and extract the installer package that is appropriate for your operating system. The offline downloader utilities are located in the \files\installers\other_files directory of the BBSA<version>-<platform>64 installer package. For information about downloading files from the EPD website, see Downloading the installation files.

The offline downloader utilities are located inside the All-OS-Patch-Downloaders-<platform>-<build>.<extension> package, where:

  • <platform> is the supported platform on which you can run the utilities.
  • <build> is the version number.
  • <extension> is the appropriate extension of the compressed file (.tar.gz or .zip).

For offline patching for Ubuntu or Debian, you must extract the contents of All-OS-Patch-Downloaders-linux-86.tar.gz

Depending on what version of BMC Server Automation you are using, you will need the following files:

  • sample-debian-downloader-config.xml - Sample configuration file that you can edit and use based on your requirements 
  • debian_downloader.bat - Offline downloader that runs on a Windows machine
  •  debian_downloader.sh - Offline downloader that runs on a UNIX machine

To prepare the configuration file for Ubuntu or Debian

The first step is to prepare the configuration file, which contains information (XML) that is used by the Patch Downloader utility. The configuration file must contain the download settings and patch filter information as show in the image below. You can also enter proxy server information if you are using one.



Edit the sample XML configuration file (sample-debian-downloader-config.xml or sample-ubuntu-downloader-config.xml) provided by BMC, and add the following XML tags based on your requirements:

  1. (Optional) Add proxy information using the following XML tags:

    Tag

    Description

    <port></port>

    The port used for communication with the proxy server.

    <host></host>

    The proxy server's host name or IP address.

    <username></username>

    The user name required for authentication to communicate with the proxy server.

    <password></password>

    An encrypted password for the specified user.

    The encrypted password is the result of running the -encode switch with the downloader utility.

    For example, debian_downloader.sh -encode <passwordToEncrypt>

    <domain-name></domain-name>

    The proxy server domain name to be used for authentication.

    <proxy-type></proxy-type>

     

     

    The type of proxy server. Valid values are:

    • None — indicates that no proxy server is used
    • NTLM
    • NTLM-v2
    • Squid
    Example of proxy information in configuration file
    <proxy-settings>
    		<port>8080</port>
    		<host>127.0.0.1</host>
    		<username>user</username>
    		<password>password</password>
    		<domain-name></domain-name>
    		<proxy-type>ntlm</proxy-type>
    		<protocol>http</protocol>
    </proxy-settings>
  2. Define download settings using the following XML tags:

    Tag

    Description

    <temporary-location></temporary-location>>

    Location where files can be stored temporarily during the download process.

    <payload-repository-location></payload-repository-location>

    Local location of the patch repository where metadata and payload are stored.

    <download-request-retries></download-request-retries>

    Number of times the download utility attempts to download if the first attempt at downloading a payload fails.

    <download-request-timeout></download-request-timeout>

    Number of milliseconds that the utility waits for a response before considering the attempt as failed.

    This parameter is useful if the http response is slow.

    <downloader-parallel-threads></downloader-parallel-threads>

    Number of downloads that can be performed in parallel.

    Example of download settings in configuration file
    <temporary-location>c:\tmp</temporary-location> 
    <payload-repository-location>c:\tmp\Ubuntu</payload-repository-location>
    <download-request-retries>3</download-request-retries> 
    <download-request-timeout>180000</download-request-timeout> 
    <downloader-parallel-threads>50</downloader-parallel-threads> 
  3. Obtain a distribution list for Ubuntu and Debian using the following command. You can use this information when updating the configuration file with patch filter information in the next step.

    On a UNIX machine: sh debian_downloader.sh -listDists 

    On a Windows machine: debian_downloader.bat -listDists

    Note

    If you are using BMC Server Automation 8.6, the offline downloader is named as ubuntu_downloader.bat or ubuntu_downloader.sh.

  4. Specify filters to limit the patches downloaded in the catalog. The same filters entered here must also be entered during catalog creation.

    Enter the following command to automatically add the filter information to the configuration file.

    If you are running on a UNIX machine:

    debian_downloader.sh  
    -addAptRepository 
     -configFile <configFile> 
     -debian <flavor> 
    -osVersion <version> 
    -debArch <arch> 
    -debRepo <baseURL> 
    <Distribution> <Component1> 
    <Component2> ... <Component n>

    If you are running on a Windows machine:

    debian_downloader.bat 
    -addAptRepository 
     -configFile <configFile> 
     -debian <flavor> 
    -osVersion <version> 
    -debArch <arch> 
    -debRepo <baseURL> 
    <Distribution> <Component1> 
    <Component2> ... <Component n>

    Variable

    Description

    <configFile>

    Name of the configuration file.

    <flavor>

    Flavor of the patch operating system.

    <version>

    Version of the patch operating system.

    <arch>

    Architecture of the patch operating system.

    <baseURL>

     

    Base URL of the required apt-get repository of the patch.

    For example:

    http://archive.ubuntu.com/ubuntu/dists/ trusty Main Restricted

    • Trusty is the distribution name
    • Main and Restricted are the component names.

    Note

    If you are using BMC Server Automation 8.6, the offline downloader is named as ubuntu_downloader.bat or ubuntu_downloader.sh

    Sample command for adding a filter to the configuration file:

    debian_downloader.bat 
    -addAptRepository 
    -configFile <configFile> 
    -debian Ubuntu 
    -osVersion 14.04 
    -debArch x86 
    -debRepo http://archive.ubuntu.com/ubuntu/dists/ trusty Main Restricted
    XML code of filter information appended to the <configFile>
    <subscriptions>
    
     <debian-update arch="x86" version="14.04" os="Ubuntu">
            <base-url>http://archive.ubuntu.com/ubuntu/</base-url>
            <distribution-list>
               <distribution name="trusty">
                  <component name="Main" /> <component name="Restricted">
                     <metadata-url> http://archive.ubuntu.com/ubuntu/dists/trusty/restricted/binaryi386/Packages.gz</metadata-url>
                     <base-payload-url> http://archive.ubuntu.com/ubuntu/ 
                     </base-payload-url>
                   </component>
                 </distribution>
              </distribution-list>
     </debian-update>
    
     </subscriptions>
    
  5. Save the configuration file. Use the sample configuration file below as a reference:

    Click Expand source to see a sample configuration XML file
    <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    <debian-downloader-configuration>
    
    <config>
     <proxy-settings> 
     <port>8080</port> 
     <host>127.0.0.1</host> 
     <username>user</username> 
     <password>password</password> 
     <domain-name></domain-name> 
     <proxy-type>ntlm</proxy-type> 
     <protocol>http</protocol> 
     </proxy-settings>
      
     <temporary-location>c:\tmp</temporary-location>
     <payload-repository-location>c:\tmp\Ubuntu</payload-repository-location>
     <download-request-retries>3</download-request-retries>
     <download-request-timeout>180000</download-request-timeout>
     <downloader-parallel-threads>50</downloader-parallel-threads>
        
    </config>
    
    <subscriptions>
    
         <debian-update arch="x86" version="14.04" os="Ubuntu">
            <base-url>http://archive.ubuntu.com/ubuntu/</base-url>
            <distribution-list>
               <distribution name="trusty">
                  <component name="Main" /> <component name="Restricted">
                     <metadata-url> http://archive.ubuntu.com/ubuntu/dists/trusty/restricted/binaryi386/Packages.gz</metadata-url>
                     <base-payload-url> http://archive.ubuntu.com/ubuntu/</base-payload-url>
                  </component>
               </distribution>
            </distribution-list>
         </debian-update>
    
    </subscriptions>
    
    </debian-downloader-configuration>

To download patches for Ubuntu and Debian using the configuration file

Next, you need to download patches using the filters you defined in the configuration file. On the command line, enter the following command:

For running on a Windows machine:

debian_downloader.bat -configFile <downloaderConfigurationFilePath>

For running on a UNIX machine:

sh debian_downloader.sh -configFile <downloaderConfigurationFilePath>

Note

  • The executables are located in the folder where you extracted the Patch Downloader utility files, and can be used for either Ubuntu or Debian platforms.
  • If you are using BMC Server Automation 8.6, the offline downloader is named as ubuntu_downloader.bat or ubuntu_downloader.sh

This command uses the following variable:

<downloaderConfigurationFilePath>

Enter the location of the configuration file used by the offline downloader.

Other useful patch offline downloader-related commands

From the command line, use any of the following commands to display information on version, available distributions, supported subscriptions and so on. The debian_downloader.bat and  debian_downloader.sh executable are located in the folder where you extracted the Patch Downloader utility files, and can be used for either Ubuntu or Debian platforms.

Note

If you are using BMC Server Automation 8.6, the offline downloader is named as ubuntu_downloader.bat or ubuntu_downloader.sh

  • To display the downloader help file, enter the following command:

    On a Windows machine: debian_downloader.bat -help

    On a UNIX machine: debian_downloader.sh -help

  • To display version information for the downloader, enter the following command:

    On a Windows machine: debian_downloader.bat -version

    On a UNIX machine: debian_downloader.sh -version

  • To list all available Ubuntu and Debian supported distributions, enter the following command:

    On a Windows machine: debian_downloader.bat -listDists

    On a UNIX machine: debian_downloader.sh -listDists

  • To list all available Ubuntu and Debian supported distributions filtered by given configuration file, enter the following command:

    On a Windows machine: debian_downloader.bat -listDists <configFile>

    On a UNIX machine: debian_downloader.sh -listDists <configFile>

    This command uses the following variable:

    VariableDescription
    <configFile>
    Name of the configuration file.
  • To add a filter to the configuration file, enter the following command:

    debian_downloader.bat -addAptRepository

    -configFile <configFile>

    -debian <flavor>

    -osVersion <version>

    -debArch <arch>

    -debRepo <apt-get repository>

    This command uses the following variable:

    VariableDescription
    <configFile>Name of the configuration file. If the configuration file does not exist, a new file will be created.
    <flavor>Flavor of the OS, either Debian or Ubuntu.
    <version>Version of OS. For example, 11.10 for Ubuntu, or 6.0 for Debian.
    <arch>OS architecture type, either x86 or x86_64. If this option is not mentioned, both architectures will be filtered.
    <apt-get repository>

    apt-get repository specified in sources.list format: baseURL Distribution [Component1] [Component2]...[Component n]

    Debian example: http://ftp.debian.org/debian/dists squeeze

    Ubuntu example: http://archive.ubuntu.com/ubuntu natty Main Restricted

  • To delete a filter from a given configuration file, enter the following command:

    debian_downloader.bat -deleteAptRepository

    -configFile <configFile>

    -debian <flavor>

    -osVersion <version>

    -debArch <arch>

    -debRepo <apt-get repository>

    This command uses the following variables:

    VariableDescription
    <configFile>Name of the configuration file. If the configuration file does not exist, a new file will be created.
    <flavor>Flavor of the OS, either Debian or Ubuntu.
    <version>Version of OS. For example, 11.10 for Ubuntu, or 6.0 for Debian.
    <arch>OS architecture type, either 'x86' or 'x86_64'. If this option is not mentioned, both architectures will be filtered.
    <apt-get repository>

    apt-get repository specified in sources.list format: baseURL Distribution [Component1] [Component2]...[Component n]

    Debian example: http://ftp.debian.org/debian/dists squeeze

    Ubuntu example: http://archive.ubuntu.com/ubuntu natty Main Restricted

Where to go next

Creating a patch catalog.