Article ID: 122705, created on Aug 24, 2014, last review on Aug 24, 2014

  • Applies to:
  • Virtuozzo 6.0

Question

How to change a default mirror for templates?

Answer

Default mirror customization is performed in /etc/vztt/url.map, this file contains the list of replacements to apply to files repositories and mirrorlist. For example, to change Debian security repository, one can configure the replacement:

~# vzpkg info debian-7.0-x86_64 repositories
repositories:
        ftp://ftp.de.debian.org/debian wheezy main contrib non-free
        ftp://ftp.de.debian.org/debian-security wheezy/updates main contrib non-free
~# grep debian /etc/vztt/url.map
$DEB_SERVER     ftp://ftp.de.debian.org
~# echo 'ftp://ftp.de.debian.org/debian-security http://security.debian.org/' >> /etc/vztt/url.map
~# vzpkg info debian-7.0-x86_64 repositories
repositories:
        ftp://ftp.de.debian.org/debian wheezy main contrib non-free
        http://security.debian.org/ wheezy/updates main contrib non-free

Note: the string to replace is checked to be a substring of the line. Thus, one cannot replace only "ftp://ftp.de.debian.org/debian" in the first line and not to replace the second line with the -security suffix.

Note: among replacement lines the first one has priority over the next ones, therefore the shorter replacement string should be defined in the end.

~# echo 'ftp://ftp.de.debian.org/debian-security http://security.debian.org/' >> /etc/vztt/url.map
~# echo 'ftp://ftp.de.debian.org/debian http://ftp.us.debian.org/debian' >> /etc/vztt/url.map
~# vzpkg info debian-7.0-x86_64 repositories
repositories:
    http://ftp.us.debian.org/debian wheezy main contrib non-free
    http://security.debian.org/ wheezy/updates main contrib non-free

Search Words

ez template mirror

c62e8726973f80975db0531f1ed5c6a2 2897d76d56d2010f4e3a28f864d69223 0dd5b9380c7d4884d77587f3eb0fa8ef

Email subscription for changes to this article
Save as PDF