Preparing the configuration file for Ubuntu and Debian


In the configuration file, you provide information that is used by the Patch Downloader utility. This information includes definition of a proxy server (if one is used), identification of a local, temporary directory on the server that is used by the Patch Downloader utility during download, and download filter definitions.

The configuration file must contain the download settings and patch filter information as show in the image below.

Debian config.png

Before you begin

Use the following command to encrypt the password supplied to the proxy server by the Patch Downloader utility. You must specify the resulting encrypted password in the <password></password> parameter in the configuration XML file.

Use the following command if you are running the downloader on Microsoft Windows:

debian_downloader.bat -encode <passwordToEncrypt>

Use the following command if you are running the downloader on UNIX:

sh debian_downloader.sh -encode <passwordToEncrypt>

To prepare the configuration file for Ubuntu and Debian

  1. Edit the sample XML configuration file ( sample-debian-downloader-config.xml ) provided by BMC, and add the following XML tags based on your requirements:
  2. (Optional) Add proxy information using the following XML tags:

    Tag

    Description

    <port></port>

    Port number used to communicate with the proxy server

    <host></host>

    IP address or host name of the proxy server

    <username></username>

    User name required for authentication prior to communication 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>

    Domain name of the proxy server

    <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>
  3. Add download information 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> 
  4. 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.

    (UNIX) : sh debian_downloader.sh -listDists 

    (Windows) : debian_downloader.bat -listDists

  5. 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. 

    (UNIX)

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

    (Windows)

    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/ focal-updates Main Restricted

    • focal-updates is the distribution name
    • Main and Restricted are the component names.
    Sample command for adding a filter to the configuration file:
    debian_downloader.bat
    -addAptRepository
    -configFile <configFile>
    -debian Ubuntu
    -osVersion 20.04
    -debArch x86_64
    -debRepo http://archive.ubuntu.com/ubuntu focal-updates Main Restricted

     

    XML code of filter information appended to the <configFile>
    <subscriptions>
     <debian-update arch="x86_64" version="20.04" os="Ubuntu">
           <base-url>http://archive.ubuntu.com/ubuntu/</base-url>
           <distribution-list>
                 <distribution name="focal-updates">
                 <component name="Main">
                           <metadata-url>http://archive.ubuntu.com/ubuntu/dists/focal-updates/main/binary-amd64/Packages.gz</metadata-url>
                           <cnf-metadata-url>http://archive.ubuntu.com/ubuntu/dists/focal-updates/main/cnf/Commands-amd64.xz</cnf-metadata-url>
                           <base-payload-url>http://archive.ubuntu.com/ubuntu/</base-payload-url>
                 </component>
                <component name="Restricted">
                           <metadata-url>http://archive.ubuntu.com/ubuntu/dists/focal-updates/restricted/binary-amd64/Packages.gz</metadata-url>
                           <cnf-metadata-url>http://archive.ubuntu.com/ubuntu/dists/focal-updates/restricted/cnf/Commands-amd64.xz</cnf-metadata-url>
                           <base-payload-url>http://archive.ubuntu.com/ubuntu/</base-payload-url>
                 </component>                                  
                 </distribution>
           </distribution-list>
    </debian-update>
    </subscriptions>
  6. 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.5.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_64" version="18.04" os="Ubuntu">
                <base-url>http://archive.ubuntu.com/ubuntu/</base-url>
                <distribution-list>
                <distribution name="bionic">
    <component name="Main">
                            <metadata-url>http://archive.ubuntu.com/ubuntu/dists/bionic/main/binary-i386/Packages.gz</metadata-url>
                            <base-payload-url>http://archive.ubuntu.com/ubuntu/</base-payload-url>
                        </component>
                        <component name="Restricted">
                            <metadata-url>http://archive.ubuntu.com/ubuntu/dists/bionic/restricted/binary-i386/Packages.gz</metadata-url>
                            <base-payload-url>http://archive.ubuntu.com/ubuntu/</base-payload-url>
                        </component>                    
                    </distribution>
                </distribution-list>
            </debian-update> -->

          <debian-update arch="x86_64" version="20.04" os="Ubuntu">
               <base-url>http://archive.ubuntu.com/ubuntu/</base-url>
               <distribution-list>
               <distribution name="focal-updates">
    <component name="Main">
                           <metadata-url>http://archive.ubuntu.com/ubuntu/dists/focal-updates/main/binary-amd64/Packages.gz</metadata-url>
                           <cnf-metadata-url>http://archive.ubuntu.com/ubuntu/dists/focal-updates/main/cnf/Commands-amd64.xz</cnf-metadata-url>
                           <base-payload-url>http://archive.ubuntu.com/ubuntu/</base-payload-url>
                       </component>
                       <component name="Restricted">
                           <metadata-url>http://archive.ubuntu.com/ubuntu/dists/focal-updates/restricted/binary-amd64/Packages.gz</metadata-url>
                           <cnf-metadata-url>http://archive.ubuntu.com/ubuntu/dists/focal-updates/restricted/cnf/Commands-amd64.xz</cnf-metadata-url>
                           <base-payload-url>http://archive.ubuntu.com/ubuntu/</base-payload-url>
                       </component>               
                   </distribution>
               </distribution-list>
           </debian-update>
       </subscriptions>
    </debian-downloader-configuration>

    Where to go from here

    Use the command in Running-the-Patch-Downloader-utility-for-Ubuntu-and-Debian and pass the configuration file as a parameter to download the patches.

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*