Previous page

Next page

Locate page in Contents

Print this page

Managing Default Repositories

When you install an OS EZ template on the server, it is preconfigured to use one or several package repositories storing Linux OS vendor's file sources. The path to the repositories for most OS EZ templates and their application EZ templates is automatically set during the EZ template installation in the mirrorlist or repositories files located in the /vz/template/<os_name>/<os_version>/<arch>/config/os/default directory. Thus, you do not have to perform any additional operations to start using an installed OS EZ template (i.e. cache it and create Containers on its basis). The only requirement your system must meet is to have an active Internet connection to access the servers where the preconfigured repositories are located.

Let us assume that you want to use the 32-bit version of Fedora 16 to base your Containers on. To do this, you install the fedora-core-16-x86-tmpl-4.0.0-17.swsoft.noarch.rpm EZ template on the server:

# vzpkg install template fedora-core-16-x86-tmpl-4.0.0-17.swsoft.noarch.rpm

Preparing... ############################## [100%]

1:fedora-core-16-x86-tmpl ############################## [100%]

After the OS EZ template has been successfully installed, you can explore the default repositories for Fedora 16 in the /vz/template/fedora/16/x86/config/os/default/mirrorlist file. For example:

# cat /vz/template/fedora/16/x86/config/os/default/mirrorlist

$SW_SERVER/download/mirrors/fedora-core-16

$SW_SERVER/download/mirrors/updates-released-fc16

http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-16&arch=i386

http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-f16&arch=i386

This file lists the repositories set to handle the Fedora 16 OS EZ template:

  • Repositories on the official Web server are defined in the first two lines. $SW_SERVER denotes the string whose value is specified in the /vz/template/conf/vztt/url.map file. In our case, this string is the URL of the official Web server. The repositories on the official Web server keep a number of software packages needed for the correct operation of the fedora-core-16-x86 template. Along with $SW_SERVER, the url.map file contains the list of URLs for all Linux distributions supported by Virtuozzo and having official repositories.
  • Repositories on the Fedora web server are defined in the third and fourth lines. These repositories store all RPM packages for the Fedora 16 distribution.

The priority according to which software packages are downloaded from the specified servers is determined by the repositories order in the mirrorlist file. So in the example above, RPM packages from the official Web server are downloaded first and, after that, all the packages from the Fedora server.

Notes:

1. You can use the vzpkg info OS_template_name mirrorlist repositories command to view the mirrors and repositories for specific OS templates.

2. Commercial Linux distributions (e.g., Red Hat Enterprise Linux) do not have official repositories. You need to manually set up software repositories for such distributions before you can start using them. For more information, see to Setting Up Repositories with vzcreaterepo.

Software packages are downloaded and installed on the server from package repositories when you:

  • Cache an OS EZ template.
  • Update an existing OS EZ template cache (provided that new packages are available in the repository).
  • Add an application EZ template or package to a Container for the first time.
  • Update an EZ template or software package in a Container.

You can set up your own repositories (e.g., storing unofficial software packages) for EZ templates. To do this, create the repositories file in the /vz/template/<os_name>/<os_version>/<arch>/config/os/default directory on the server, if it is not present, and specify the path to the desired repository. For example, to add the extra repository at http://mirrors.dotsrc.org/jpackage/ and keeping Java packages for Fedora 16:

  1. Create the /vz/template/fedora/16/x86/config/os/default/repositories file on the server.
  2. Add the following string to the file:

    http://mirrors.dotsrc.org/jpackage

  3. Save the file.