<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.openvz.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=BurnMage</id>
	<title>OpenVZ Virtuozzo Containers Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.openvz.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=BurnMage"/>
	<link rel="alternate" type="text/html" href="https://wiki.openvz.org/Special:Contributions/BurnMage"/>
	<updated>2026-06-13T23:26:20Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.31.1</generator>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Install_vzpkg2_and_pkg-cacher&amp;diff=6727</id>
		<title>Install vzpkg2 and pkg-cacher</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Install_vzpkg2_and_pkg-cacher&amp;diff=6727"/>
		<updated>2008-11-23T20:24:38Z</updated>

		<summary type="html">&lt;p&gt;BurnMage: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Introduction ===&lt;br /&gt;
&lt;br /&gt;
Robert Nelson has created a couple new utilities to make managing and updating templates and containers easier, vzpkg2 pkg-cacher.  So far they will create and update a large range of containers, including both 32bit and 64bit of the following:&lt;br /&gt;
    &lt;br /&gt;
* Centos 4 and 5,&lt;br /&gt;
* Fedora 7, 8 and 9,&lt;br /&gt;
* Debian Sarge and Etch,&lt;br /&gt;
* Ubuntu Feisty, Gutsy and Hardy.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Pkg-cacher is a transparent caching proxy daemon optimized for Debian and RPM packages.  In other terms, pkg-cacher is a service that runs on a machine that other machines and containers, or &amp;quot;clients&amp;quot;, use to update themselves instead of each of them directly hitting the package repositories.  Pkg-cacher only downloads a file once and then gives that to all its clients, instead of each of the clients downloading the file from the Internet at large.  It is based on [http://www.nick-andrew.net/projects/apt-cacher/ apt-cacher], available with Debian.  This version has been modified to understand RedHat RPM repositories.  It also adds support for the HTTP Range header and deals correctly with files which have the same name but different content on different distributions or in some cases different versions of the same distribution.  &lt;br /&gt;
&lt;br /&gt;
Robert has setup repositories for Fedora, CentOS and Debian.&lt;br /&gt;
&lt;br /&gt;
====Screencast====&lt;br /&gt;
&lt;br /&gt;
Scott Dowdle has recorded a good screencast overview of vzpkg2 and pkg-cacher at:&lt;br /&gt;
&lt;br /&gt;
 http://www.montanalinux.org/vzpkg2-screencast.html&lt;br /&gt;
&lt;br /&gt;
===Installation===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Centos &amp;amp; Fedora installs:====&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Remove Old Packages&amp;lt;/u&amp;gt;=====&lt;br /&gt;
If this is an '''existing''' install, uninstall your vzpkg and vztmpl-* packages:&lt;br /&gt;
&lt;br /&gt;
 yum remove vzpkg vztmpl-*&lt;br /&gt;
&lt;br /&gt;
and backup &amp;amp; remove your current template directory:&lt;br /&gt;
&lt;br /&gt;
 tar cjf /some/backup/location/old_templates.tbz /vz/template&lt;br /&gt;
 rm -r /vz/template&lt;br /&gt;
&lt;br /&gt;
If this is a '''new''' install, you should probably review the [http://download.openvz.org/doc/OpenVZ-Users-Guide.pdf OpenVZ User's Guide] and the wiki's [[Quick installation]] page.  The only way you would vary your installation setups is declining to install the default vzpkg package, and instead using vzpkg2 here.&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Download the repository file for your OS&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
For CentOS:&lt;br /&gt;
    wget http://repo.opensource-sw.net/centos/ossw.repo -P /etc/yum.repos.d&lt;br /&gt;
&lt;br /&gt;
For Fedora:&lt;br /&gt;
    wget http://repo.opensource-sw.net/fedora/ossw.repo -P /etc/yum.repos.d&lt;br /&gt;
&lt;br /&gt;
You may wish to edit the repository file, perhaps to add a priorities setting.  &lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Install vzpkg2 and pkg-cacher&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
Once the repository is added in /etc/yum.repos.d, you can now install the new vzpkg2 and pkg-cacher from it:&lt;br /&gt;
&lt;br /&gt;
 yum install vzpkg2 vztmpl2-centos vztmpl2-fedora vztmpl2-debian vztmpl2-ubuntu&lt;br /&gt;
 yum install pkg-cacher-sa&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Configure vzpkg2&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
Open /etc/vz/vzpkg.conf in an editor.  Replace 'hostname' with the hostname or IP of the machine you are installing this on for VZPKG_CACHE_HOST, make sure not to use 'localhost', because this name is what OpenVZ Containers will use to access the pkg-cacher daemon:&lt;br /&gt;
&lt;br /&gt;
 VZPKG_CACHE_HOST=hostname:3142&lt;br /&gt;
&lt;br /&gt;
While you are here, review this file to ensure it makes sense for your setup.  In particular, you will probably have to update the VZPKG_DNS line with IP addresses of DNS servers you use.&lt;br /&gt;
&lt;br /&gt;
 VZPKG_DNS=192.168.1.2,192.168.1.3&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Configure pkg-cacher&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
Edit /etc/pkg-cacher/pkg-cacher.conf.  You should read the included documentation in the file to ensure it is appropriate for your setup.  Mostly the defaults will work just fine.  By default pkg-cacher will let any system use its cache.  You will probably want to limit it to your own systems on the line:&lt;br /&gt;
&lt;br /&gt;
 allowed_hosts=*&lt;br /&gt;
&lt;br /&gt;
Once you have checked and updated pkg-cacher.conf, simply restart it by running as root:&lt;br /&gt;
&lt;br /&gt;
 service pkg-cacher restart&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Generate the new template cache&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
Now everything should be ready to go!  Make sure both the 'vz' service and 'pkg-cacher' service are running, then run as root:&lt;br /&gt;
&lt;br /&gt;
 vzpkgcache&lt;br /&gt;
&lt;br /&gt;
vzpkg2 should get to work generating your initial caches.  Now you can run 'vzctl create' and use them.&lt;br /&gt;
&lt;br /&gt;
====Debian Installs:====&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Remove Old Packages&amp;lt;/u&amp;gt;=====&lt;br /&gt;
If this is an '''existing''' install, uninstall your vzpkg and vztmpl-* packages:&lt;br /&gt;
&lt;br /&gt;
 apt-get erase vzpkg vzctl-ostmpl-*&lt;br /&gt;
&lt;br /&gt;
and backup &amp;amp; remove your current template directory:&lt;br /&gt;
&lt;br /&gt;
 tar cjf /some/backup/location/old_templates.tbz /vz/template&lt;br /&gt;
 rm -r /vz/template&lt;br /&gt;
&lt;br /&gt;
If this is a '''new''' install, you should probably review the [http://download.openvz.org/doc/OpenVZ-Users-Guide.pdf OpenVZ User's Guide] and the wiki's [[Installation on Debian]] page.  The only way you would vary your installation setups is declining to install the default vzpkg package, and instead using vzpkg2 here.&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Add the deb repositories to your /etc/apt/sources.list:&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
Add the following lines to your /etc/apt/sources.list:&lt;br /&gt;
&lt;br /&gt;
Etch:&lt;br /&gt;
    deb http://repo.opensource-sw.net/debian/ etch openvz&lt;br /&gt;
    deb-src http://repo.opensource-sw.net/debian/ etch openvz&lt;br /&gt;
&lt;br /&gt;
Sarge:&lt;br /&gt;
    deb http://repo.opensource-sw.net/debian/ sarge openvz&lt;br /&gt;
    deb-src http://repo.opensource-sw.net/debian/ sarge openvz&lt;br /&gt;
&lt;br /&gt;
Then do:&lt;br /&gt;
    apt-get update&lt;br /&gt;
    apt-get install pkg-cacher-sa vzpkg2&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Adding New Templates:&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
At the time of writing the OS templates were only available in RPM format.  To be able to install them, install yum:&lt;br /&gt;
&lt;br /&gt;
    apt-get install yum&lt;br /&gt;
   &lt;br /&gt;
Then fetch the templates and install them:&lt;br /&gt;
&lt;br /&gt;
    wget http://repo.opensource-sw.net/centos/5/i386/vztmpl2-centos-0.9.0-1.noarch.rpm &lt;br /&gt;
    wget http://repo.opensource-sw.net/centos/5/i386/vztmpl2-fedora-0.9.0-1.noarch.rpm&lt;br /&gt;
    wget http://repo.opensource-sw.net/centos/5/i386/vztmpl2-debian-0.9.0-1.noarch.rpm&lt;br /&gt;
 &lt;br /&gt;
    rpm -i --nodeps vztmpl2-*.rpm&lt;br /&gt;
&lt;br /&gt;
Then move the templates to where Debian expects them:&lt;br /&gt;
&lt;br /&gt;
    mv /vz/template/* /var/lib/vz/template/&lt;br /&gt;
&lt;br /&gt;
Edit the /var/lib/vz/template/{centos,fedora,debian}/config/vzpkg.conf files as well to reference where Debian expects them.  Change the line:&lt;br /&gt;
    baseurl=file:///vz/template/$OS_NAME/$OS_VER/$OS_ARCH/vz-addons/&lt;br /&gt;
to:&lt;br /&gt;
    baseurl=file:///var/lib/vz/template/$OS_NAME/$OS_VER/$OS_ARCH/vz-addons/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Configure vzpkg2&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
Open /etc/vz/vzpkg.conf in an editor.  Replace 'hostname' with the hostname or IP of the machine you are installing this on for VZPKG_CACHE_HOST, make sure not to use 'localhost', because this name is what OpenVZ Containers will use to access the pkg-cacher daemon:&lt;br /&gt;
&lt;br /&gt;
 VZPKG_CACHE_HOST=hostname:3142&lt;br /&gt;
&lt;br /&gt;
While you are here, review this file to ensure it makes sense for your setup.  In particular, you will probably have to update the VZPKG_DNS line with IP addresses of DNS servers you use.&lt;br /&gt;
&lt;br /&gt;
 VZPKG_DNS=192.168.1.2,192.168.1.3&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Configure pkg-cacher&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
Edit /etc/pkg-cacher/pkg-cacher.conf.  You should read the included documentation in the file to ensure it is appropriate for your setup.  Mostly the defaults will work just fine.  By default pkg-cacher will let any system use its cache.  You will probably want to limit it to your own systems on the line:&lt;br /&gt;
&lt;br /&gt;
 allowed_hosts=*&lt;br /&gt;
&lt;br /&gt;
Once you have checked and updated pkg-cacher.conf, simply restart it.&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Generate the new template cache&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
Now everything should be ready to go!  Make sure both the 'vz' service and 'pkg-cacher' service are running, then run as root:&lt;br /&gt;
&lt;br /&gt;
 vzpkgcache&lt;br /&gt;
&lt;br /&gt;
vzpkg2 should get to work generating your initial caches.  Now you can run 'vzctl create' and use them.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Source===&lt;br /&gt;
&lt;br /&gt;
The source for the new vzpkg2 and templates is available on http://git.opensource-sw.net.  In order to clone the updated source use the command:&lt;br /&gt;
 git clone http://git.opensource-sw.net/git/vzpkg  &lt;br /&gt;
&lt;br /&gt;
The templates are available using:&lt;br /&gt;
 git clone http://git.opensource-sw.net/git/vztmpl&lt;/div&gt;</summary>
		<author><name>BurnMage</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Install_vzpkg2_and_pkg-cacher&amp;diff=6726</id>
		<title>Install vzpkg2 and pkg-cacher</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Install_vzpkg2_and_pkg-cacher&amp;diff=6726"/>
		<updated>2008-11-22T00:58:46Z</updated>

		<summary type="html">&lt;p&gt;BurnMage: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Introduction ===&lt;br /&gt;
&lt;br /&gt;
2008/11/19: This is still unfinished, a work in progress, give me a couple days or email me through wiki if you have questions or concerns -BurnMage&lt;br /&gt;
&lt;br /&gt;
Robert Nelson has created a couple new utilities to make managing and updating templates and containers easier, vzpkg2 pkg-cacher.  So far they will create and update a large range of containers, including both 32bit and 64bit of the following:&lt;br /&gt;
    &lt;br /&gt;
* Centos 4 and 5,&lt;br /&gt;
* Fedora 7, 8 and 9,&lt;br /&gt;
* Debian Sarge and Etch,&lt;br /&gt;
* Ubuntu Feisty, Gutsy and Hardy.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Pkg-cacher is a transparent caching proxy daemon optimized for Debian and RPM packages.  In other terms, pkg-cacher is a service that runs on a machine that other machines and containers, or &amp;quot;clients&amp;quot;, use to update themselves instead of each of them directly hitting the package repositories.  Pkg-cacher only downloads a file once and then gives that to all its clients, instead of each of the clients downloading the file from the Internet at large.  It is based on [http://www.nick-andrew.net/projects/apt-cacher/ apt-cacher], available with Debian.  This version has been modified to understand RedHat RPM repositories.  It also adds support for the HTTP Range header and deals correctly with files which have the same name but different content on different distributions or in some cases different versions of the same distribution.  &lt;br /&gt;
&lt;br /&gt;
Robert has setup repositories for Fedora, CentOS and Debian.&lt;br /&gt;
&lt;br /&gt;
====Screencast====&lt;br /&gt;
&lt;br /&gt;
Scott Dowdle has recorded a good screencast overview of vzpkg2 and pkg-cacher at:&lt;br /&gt;
&lt;br /&gt;
 http://www.montanalinux.org/vzpkg2-screencast.html&lt;br /&gt;
&lt;br /&gt;
===Installation===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Centos &amp;amp; Fedora installs:====&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Remove Old Packages&amp;lt;/u&amp;gt;=====&lt;br /&gt;
If this is an '''existing''' install, uninstall your vzpkg and vztmpl-* packages:&lt;br /&gt;
&lt;br /&gt;
 yum remove vzpkg vztmpl-*&lt;br /&gt;
&lt;br /&gt;
and backup &amp;amp; remove your current template directory:&lt;br /&gt;
&lt;br /&gt;
 tar cjf /some/backup/location/old_templates.tbz /vz/template&lt;br /&gt;
 rm -r /vz/template&lt;br /&gt;
&lt;br /&gt;
If this is a '''new''' install, you should probably review the [http://download.openvz.org/doc/OpenVZ-Users-Guide.pdf OpenVZ User's Guide] and the wiki's [[Quick installation]] page.  The only way you would vary your installation setups is declining to install the default vzpkg package, and instead using vzpkg2 here.&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Download the repository file for your OS&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
For CentOS:&lt;br /&gt;
    wget http://repo.opensource-sw.net/centos/ossw.repo -P /etc/yum.repos.d&lt;br /&gt;
&lt;br /&gt;
For Fedora:&lt;br /&gt;
    wget http://repo.opensource-sw.net/fedora/ossw.repo -P /etc/yum.repos.d&lt;br /&gt;
&lt;br /&gt;
You may wish to edit the repository file, perhaps to add a priorities setting.  &lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Install vzpkg2 and pkg-cacher&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
Once the repository is added in /etc/yum.repos.d, you can now install the new vzpkg2 and pkg-cacher from it:&lt;br /&gt;
&lt;br /&gt;
 yum install vzpkg2 vztmpl2-centos vztmpl2-fedora vztmpl2-debian vztmpl2-ubuntu&lt;br /&gt;
 yum install pkg-cacher-sa&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Configure vzpkg2&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
Open /etc/vz/vzpkg.conf in an editor.  Replace 'hostname' with the hostname or IP of the machine you are installing this on for VZPKG_CACHE_HOST, make sure not to use 'localhost', because this name is what OpenVZ Containers will use to access the pkg-cacher daemon:&lt;br /&gt;
&lt;br /&gt;
 VZPKG_CACHE_HOST=hostname:3142&lt;br /&gt;
&lt;br /&gt;
While you are here, review this file to ensure it makes sense for your setup.  In particular, you will probably have to update the VZPKG_DNS line with IP addresses of DNS servers you use.&lt;br /&gt;
&lt;br /&gt;
 VZPKG_DNS=192.168.1.2,192.168.1.3&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Configure pkg-cacher&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
Edit /etc/pkg-cacher/pkg-cacher.conf.  You should read the included documentation in the file to ensure it is appropriate for your setup.  Mostly the defaults will work just fine.  By default pkg-cacher will let any system use its cache.  You will probably want to limit it to your own systems on the line:&lt;br /&gt;
&lt;br /&gt;
 allowed_hosts=*&lt;br /&gt;
&lt;br /&gt;
Once you have checked and updated pkg-cacher.conf, simply restart it by running as root:&lt;br /&gt;
&lt;br /&gt;
 service pkg-cacher restart&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Generate the new template cache&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
Now everything should be ready to go!  Make sure both the 'vz' service and 'pkg-cacher' service are running, then run as root:&lt;br /&gt;
&lt;br /&gt;
 vzpkgcache&lt;br /&gt;
&lt;br /&gt;
vzpkg2 should get to work generating your initial caches.  Now you can run 'vzctl create' and use them.&lt;br /&gt;
&lt;br /&gt;
====Debian Installs:====&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Remove Old Packages&amp;lt;/u&amp;gt;=====&lt;br /&gt;
If this is an '''existing''' install, uninstall your vzpkg and vztmpl-* packages:&lt;br /&gt;
&lt;br /&gt;
 apt-get erase vzpkg vzctl-ostmpl-*&lt;br /&gt;
&lt;br /&gt;
and backup &amp;amp; remove your current template directory:&lt;br /&gt;
&lt;br /&gt;
 tar cjf /some/backup/location/old_templates.tbz /vz/template&lt;br /&gt;
 rm -r /vz/template&lt;br /&gt;
&lt;br /&gt;
If this is a '''new''' install, you should probably review the [http://download.openvz.org/doc/OpenVZ-Users-Guide.pdf OpenVZ User's Guide] and the wiki's [[Installation on Debian]] page.  The only way you would vary your installation setups is declining to install the default vzpkg package, and instead using vzpkg2 here.&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Add the deb repositories to your /etc/apt/sources.list:&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
Add the following lines to your /etc/apt/sources.list:&lt;br /&gt;
&lt;br /&gt;
Etch:&lt;br /&gt;
    deb http://repo.opensource-sw.net/debian/ etch openvz&lt;br /&gt;
    deb-src http://repo.opensource-sw.net/debian/ etch openvz&lt;br /&gt;
&lt;br /&gt;
Sarge:&lt;br /&gt;
    deb http://repo.opensource-sw.net/debian/ sarge openvz&lt;br /&gt;
    deb-src http://repo.opensource-sw.net/debian/ sarge openvz&lt;br /&gt;
&lt;br /&gt;
Then do:&lt;br /&gt;
    apt-get update&lt;br /&gt;
    apt-get install pkg-cacher-sa vzpkg2&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Adding New Templates:&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
At the time of writing the OS templates were only available in RPM format.  To be able to install them, install yum:&lt;br /&gt;
&lt;br /&gt;
    apt-get install yum&lt;br /&gt;
   &lt;br /&gt;
Then fetch the templates and install them:&lt;br /&gt;
&lt;br /&gt;
    wget http://repo.opensource-sw.net/centos/5/i386/vztmpl2-centos-0.9.0-1.noarch.rpm &lt;br /&gt;
    wget http://repo.opensource-sw.net/centos/5/i386/vztmpl2-fedora-0.9.0-1.noarch.rpm&lt;br /&gt;
    wget http://repo.opensource-sw.net/centos/5/i386/vztmpl2-debian-0.9.0-1.noarch.rpm&lt;br /&gt;
 &lt;br /&gt;
    rpm -i --nodeps vztmpl2-*.rpm&lt;br /&gt;
&lt;br /&gt;
Then move the templates to where Debian expects them:&lt;br /&gt;
&lt;br /&gt;
    mv /vz/template/* /var/lib/vz/template/&lt;br /&gt;
&lt;br /&gt;
Edit the /var/lib/vz/template/{centos,fedora,debian}/config/vzpkg.conf files as well to reference where Debian expects them.  Change the line:&lt;br /&gt;
    baseurl=file:///vz/template/$OS_NAME/$OS_VER/$OS_ARCH/vz-addons/&lt;br /&gt;
to:&lt;br /&gt;
    baseurl=file:///var/lib/vz/template/$OS_NAME/$OS_VER/$OS_ARCH/vz-addons/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Configure vzpkg2&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
Open /etc/vz/vzpkg.conf in an editor.  Replace 'hostname' with the hostname or IP of the machine you are installing this on for VZPKG_CACHE_HOST, make sure not to use 'localhost', because this name is what OpenVZ Containers will use to access the pkg-cacher daemon:&lt;br /&gt;
&lt;br /&gt;
 VZPKG_CACHE_HOST=hostname:3142&lt;br /&gt;
&lt;br /&gt;
While you are here, review this file to ensure it makes sense for your setup.  In particular, you will probably have to update the VZPKG_DNS line with IP addresses of DNS servers you use.&lt;br /&gt;
&lt;br /&gt;
 VZPKG_DNS=192.168.1.2,192.168.1.3&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Configure pkg-cacher&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
Edit /etc/pkg-cacher/pkg-cacher.conf.  You should read the included documentation in the file to ensure it is appropriate for your setup.  Mostly the defaults will work just fine.  By default pkg-cacher will let any system use its cache.  You will probably want to limit it to your own systems on the line:&lt;br /&gt;
&lt;br /&gt;
 allowed_hosts=*&lt;br /&gt;
&lt;br /&gt;
Once you have checked and updated pkg-cacher.conf, simply restart it.&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Generate the new template cache&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
Now everything should be ready to go!  Make sure both the 'vz' service and 'pkg-cacher' service are running, then run as root:&lt;br /&gt;
&lt;br /&gt;
 vzpkgcache&lt;br /&gt;
&lt;br /&gt;
vzpkg2 should get to work generating your initial caches.  Now you can run 'vzctl create' and use them.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Source===&lt;br /&gt;
&lt;br /&gt;
The source for the new vzpkg2 and templates is available on http://git.opensource-sw.net.  In order to clone the updated source use the command:&lt;br /&gt;
 git clone http://git.opensource-sw.net/git/vzpkg  &lt;br /&gt;
&lt;br /&gt;
The templates are available using:&lt;br /&gt;
 git clone http://git.opensource-sw.net/git/vztmpl&lt;/div&gt;</summary>
		<author><name>BurnMage</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Install_vzpkg2_and_pkg-cacher&amp;diff=6725</id>
		<title>Install vzpkg2 and pkg-cacher</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Install_vzpkg2_and_pkg-cacher&amp;diff=6725"/>
		<updated>2008-11-22T00:19:07Z</updated>

		<summary type="html">&lt;p&gt;BurnMage: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Introduction ===&lt;br /&gt;
&lt;br /&gt;
2008/11/19: This is still unfinished, a work in progress, give me a couple days or email me through wiki if you have questions or concerns -BurnMage&lt;br /&gt;
&lt;br /&gt;
Robert Nelson has created a couple new utilities to make managing and updating templates and containers easier, vzpkg2 pkg-cacher.  So far they will create and update a large range of containers, including both 32bit and 64bit of the following:&lt;br /&gt;
    &lt;br /&gt;
* Centos 4 and 5,&lt;br /&gt;
* Fedora 7, 8 and 9,&lt;br /&gt;
* Debian Sarge and Etch,&lt;br /&gt;
* Ubuntu Feisty, Gutsy and Hardy.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Pkg-cacher is a transparent caching proxy daemon optimized for Debian and RPM packages.  In other terms, pkg-cacher is a service that runs on a machine that other machines and containers, or &amp;quot;clients&amp;quot;, use to update themselves instead of each of them directly hitting the package repositories.  Pkg-cacher only downloads a file once and then gives that to all its clients, instead of each of the clients downloading the file from the Internet at large.  It is based on [http://www.nick-andrew.net/projects/apt-cacher/ apt-cacher], available with Debian.  This version has been modified to understand RedHat RPM repositories.  It also adds support for the HTTP Range header and deals correctly with files which have the same name but different content on different distributions or in some cases different versions of the same distribution.  &lt;br /&gt;
&lt;br /&gt;
Robert has setup repositories for Fedora, CentOS and Debian.&lt;br /&gt;
&lt;br /&gt;
====Screencast====&lt;br /&gt;
&lt;br /&gt;
Scott Dowdle has recorded a good screencast overview of vzpkg2 and pkg-cacher at:&lt;br /&gt;
&lt;br /&gt;
 http://www.montanalinux.org/vzpkg2-screencast.html&lt;br /&gt;
&lt;br /&gt;
===Installation===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Centos &amp;amp; Fedora installs:====&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Remove Old Packages&amp;lt;/u&amp;gt;=====&lt;br /&gt;
If this is an '''existing''' install, uninstall your vzpkg and vztmpl-* packages:&lt;br /&gt;
&lt;br /&gt;
 yum remove vzpkg vztmpl-*&lt;br /&gt;
&lt;br /&gt;
and backup &amp;amp; remove your current template directory:&lt;br /&gt;
&lt;br /&gt;
 tar cjf /some/backup/location/old_templates.tbz /vz/template&lt;br /&gt;
 rm -r /vz/template&lt;br /&gt;
&lt;br /&gt;
If this is a '''new''' install, you should probably review the [http://download.openvz.org/doc/OpenVZ-Users-Guide.pdf OpenVZ User's Guide] and the wiki's [[Quick installation]] page.  The only way you would vary your installation setups is declining to install the default vzpkg package, and instead using vzpkg2 here.&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Download the repository file for your OS&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
For CentOS:&lt;br /&gt;
    wget http://repo.opensource-sw.net/centos/ossw.repo -P /etc/yum.repos.d&lt;br /&gt;
&lt;br /&gt;
For Fedora:&lt;br /&gt;
    wget http://repo.opensource-sw.net/fedora/ossw.repo -P /etc/yum.repos.d&lt;br /&gt;
&lt;br /&gt;
You may wish to edit the repository file, perhaps to add a priorities setting.  &lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Install vzpkg2 and pkg-cacher&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
Once the repository is added in /etc/yum.repos.d, you can now install the new vzpkg2 and pkg-cacher from it:&lt;br /&gt;
&lt;br /&gt;
 yum install vzpkg2 vztmpl2-centos vztmpl2-fedora vztmpl2-debian vztmpl2-ubuntu&lt;br /&gt;
 yum install pkg-cacher-sa&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Configure vzpkg2&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
Open /etc/vz/vzpkg.conf in an editor.  Replace 'hostname' with the hostname or IP of the machine you are installing this on for VZPKG_CACHE_HOST, make sure not to use 'localhost', because this name is what OpenVZ Containers will use to access the pkg-cacher daemon:&lt;br /&gt;
&lt;br /&gt;
 VZPKG_CACHE_HOST=hostname:3142&lt;br /&gt;
&lt;br /&gt;
While you are here, review this file to ensure it makes sense for your setup.  In particular, you will probably have to update the VZPKG_DNS line with IP addresses of DNS servers you use.&lt;br /&gt;
&lt;br /&gt;
 VZPKG_DNS=192.168.1.2,192.168.1.3&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Configure pkg-cacher&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
Edit /etc/pkg-cacher/pkg-cacher.conf.  You should read the included documentation in the file to ensure it is appropriate for your setup.  Mostly the defaults will work just fine.  By default pkg-cacher will let any system use its cache.  You will probably want to limit it to your own systems on the line:&lt;br /&gt;
&lt;br /&gt;
 allowed_hosts=*&lt;br /&gt;
&lt;br /&gt;
Once you have checked and updated pkg-cacher.conf, simply restart it by running as root:&lt;br /&gt;
&lt;br /&gt;
 service pkg-cacher restart&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Generate the new template cache&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
Now everything should be ready to go!  Make sure both the 'vz' service and 'pkg-cacher' service are running, then run as root:&lt;br /&gt;
&lt;br /&gt;
 vzpkgcache&lt;br /&gt;
&lt;br /&gt;
vzpkg2 should get to work generating your initial caches.  Now you can run 'vzctl create' and use them.&lt;br /&gt;
&lt;br /&gt;
====Debian Installs:====&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Remove Old Packages&amp;lt;/u&amp;gt;=====&lt;br /&gt;
If this is an '''existing''' install, uninstall your vzpkg and vztmpl-* packages:&lt;br /&gt;
&lt;br /&gt;
 apt-get erase vzpkg vzctl-ostmpl-*&lt;br /&gt;
&lt;br /&gt;
and backup &amp;amp; remove your current template directory:&lt;br /&gt;
&lt;br /&gt;
 tar cjf /some/backup/location/old_templates.tbz /vz/template&lt;br /&gt;
 rm -r /vz/template&lt;br /&gt;
&lt;br /&gt;
If this is a '''new''' install, you should probably review the [http://download.openvz.org/doc/OpenVZ-Users-Guide.pdf OpenVZ User's Guide] and the wiki's [[Installation on Debian]] page.  The only way you would vary your installation setups is declining to install the default vzpkg package, and instead using vzpkg2 here.&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Add the deb repositories to your /etc/apt/sources.list:&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
Add the following lines to your /etc/apt/sources.list:&lt;br /&gt;
&lt;br /&gt;
Etch:&lt;br /&gt;
    deb http://repo.opensource-sw.net/debian/ etch openvz&lt;br /&gt;
    deb-src http://repo.opensource-sw.net/debian/ etch openvz&lt;br /&gt;
&lt;br /&gt;
Sarge:&lt;br /&gt;
    deb http://repo.opensource-sw.net/debian/ sarge openvz&lt;br /&gt;
    deb-src http://repo.opensource-sw.net/debian/ sarge openvz&lt;br /&gt;
&lt;br /&gt;
Then do:&lt;br /&gt;
    apt-get update&lt;br /&gt;
    apt-get install pkg-cacher-sa vzpkg2&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Adding New Templates:&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
At the time of writing the OS templates were only available in RPM format.  To be able to install them, install yum:&lt;br /&gt;
&lt;br /&gt;
    apt-get install yum&lt;br /&gt;
   &lt;br /&gt;
Then fetch the templates and install them:&lt;br /&gt;
&lt;br /&gt;
    wget http://repo.opensource-sw.net/centos/5/i386/vztmpl2-centos-0.9.0-1.noarch.rpm &lt;br /&gt;
    wget http://repo.opensource-sw.net/centos/5/i386/vztmpl2-fedora-0.9.0-1.noarch.rpm&lt;br /&gt;
    wget http://repo.opensource-sw.net/centos/5/i386/vztmpl2-debian-0.9.0-1.noarch.rpm&lt;br /&gt;
 &lt;br /&gt;
    rpm -i --nodeps vztmpl2-*.rpm&lt;br /&gt;
&lt;br /&gt;
Then move the templates to where Debian expects them:&lt;br /&gt;
&lt;br /&gt;
    mv /vz/template/* /var/lib/vz/template/&lt;br /&gt;
&lt;br /&gt;
Edit the /var/lib/vz/template/{centos,fedora,debian}/config/vzpkg.conf files as well to reference where Debian expects them.  Change the line:&lt;br /&gt;
    baseurl=file:///vz/template/$OS_NAME/$OS_VER/$OS_ARCH/vz-addons/&lt;br /&gt;
to:&lt;br /&gt;
    baseurl=file:///var/lib/vz/template/$OS_NAME/$OS_VER/$OS_ARCH/vz-addons/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Configure vzpkg2&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
Open /etc/vz/vzpkg.conf in an editor.  Replace 'hostname' with the hostname or IP of the machine you are installing this on for VZPKG_CACHE_HOST, make sure not to use 'localhost', because this name is what OpenVZ Containers will use to access the pkg-cacher daemon:&lt;br /&gt;
&lt;br /&gt;
 VZPKG_CACHE_HOST=hostname:3142&lt;br /&gt;
&lt;br /&gt;
While you are here, review this file to ensure it makes sense for your setup.  In particular, you will probably have to update the VZPKG_DNS line with IP addresses of DNS servers you use.&lt;br /&gt;
&lt;br /&gt;
 VZPKG_DNS=192.168.1.2,192.168.1.3&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Configure pkg-cacher&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Source===&lt;br /&gt;
&lt;br /&gt;
The source for the new vzpkg2 and templates is available on http://git.opensource-sw.net.  In order to clone the updated source use the command:&lt;br /&gt;
 git clone http://git.opensource-sw.net/git/vzpkg  &lt;br /&gt;
&lt;br /&gt;
The templates are available using:&lt;br /&gt;
 git clone http://git.opensource-sw.net/git/vztmpl&lt;/div&gt;</summary>
		<author><name>BurnMage</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Install_vzpkg2_and_pkg-cacher&amp;diff=6724</id>
		<title>Install vzpkg2 and pkg-cacher</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Install_vzpkg2_and_pkg-cacher&amp;diff=6724"/>
		<updated>2008-11-21T23:59:12Z</updated>

		<summary type="html">&lt;p&gt;BurnMage: /* Configure pkg-cacher */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Introduction ===&lt;br /&gt;
&lt;br /&gt;
2008/11/19: This is still unfinished, a work in progress, give me a couple days or email me through wiki if you have questions or concerns -BurnMage&lt;br /&gt;
&lt;br /&gt;
Robert Nelson has created a couple new utilities to make managing and updating templates and containers easier, vzpkg2 pkg-cacher.  So far they will create and update a large range of containers, including both 32bit and 64bit of the following:&lt;br /&gt;
    &lt;br /&gt;
* Centos 4 and 5,&lt;br /&gt;
* Fedora 7, 8 and 9,&lt;br /&gt;
* Debian Sarge and Etch,&lt;br /&gt;
* Ubuntu Feisty, Gutsy and Hardy.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Pkg-cacher is a transparent caching proxy daemon optimized for Debian and RPM packages.  In other terms, pkg-cacher is a service that runs on a machine that other machines and containers, or &amp;quot;clients&amp;quot;, use to update themselves instead of each of them directly hitting the package repositories.  Pkg-cacher only downloads a file once and then gives that to all its clients, instead of each of the clients downloading the file from the Internet at large.  It is based on [http://www.nick-andrew.net/projects/apt-cacher/ apt-cacher], available with Debian.  This version has been modified to understand RedHat RPM repositories.  It also adds support for the HTTP Range header and deals correctly with files which have the same name but different content on different distributions or in some cases different versions of the same distribution.  &lt;br /&gt;
&lt;br /&gt;
Robert has setup repositories for Fedora, CentOS and Debian.&lt;br /&gt;
&lt;br /&gt;
====Screencast====&lt;br /&gt;
&lt;br /&gt;
Scott Dowdle has recorded a good screencast overview of vzpkg2 and pkg-cacher at:&lt;br /&gt;
&lt;br /&gt;
 http://www.montanalinux.org/vzpkg2-screencast.html&lt;br /&gt;
&lt;br /&gt;
===Installation===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Centos &amp;amp; Fedora installs:====&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Remove Old Packages&amp;lt;/u&amp;gt;=====&lt;br /&gt;
If this is an '''existing''' install, uninstall your vzpkg and vztmpl-* packages:&lt;br /&gt;
&lt;br /&gt;
 yum remove vzpkg vztmpl-*&lt;br /&gt;
&lt;br /&gt;
and backup &amp;amp; remove your current template directory:&lt;br /&gt;
&lt;br /&gt;
 tar cjf /some/backup/location/old_templates.tbz /vz/template&lt;br /&gt;
 rm -r /vz/template&lt;br /&gt;
&lt;br /&gt;
If this is a '''new''' install, you should probably review the [http://download.openvz.org/doc/OpenVZ-Users-Guide.pdf OpenVZ User's Guide] and the wiki's [[Quick installation]] page.  The only way you would vary your installation setups is declining to install the default vzpkg package, and instead using vzpkg2 here.&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Download the repository file for your OS&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
For CentOS:&lt;br /&gt;
    wget http://repo.opensource-sw.net/centos/ossw.repo -P /etc/yum.repos.d&lt;br /&gt;
&lt;br /&gt;
For Fedora:&lt;br /&gt;
    wget http://repo.opensource-sw.net/fedora/ossw.repo -P /etc/yum.repos.d&lt;br /&gt;
&lt;br /&gt;
You may wish to edit the repository file, perhaps to add a priorities setting.  &lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Install vzpkg2 and pkg-cacher&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
Once the repository is added in /etc/yum.repos.d, you can now install the new vzpkg2 and pkg-cacher from it:&lt;br /&gt;
&lt;br /&gt;
 yum install vzpkg2 vztmpl2-centos vztmpl2-fedora vztmpl2-debian vztmpl2-ubuntu&lt;br /&gt;
 yum install pkg-cacher-sa&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Configure vzpkg2&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
Open /etc/vz/vzpkg.conf in an editor.  Replace 'hostname' with the hostname or IP of the machine you are installing this on for VZPKG_CACHE_HOST, make sure not to use 'localhost', because this name is what OpenVZ Containers will use to access the pkg-cacher daemon:&lt;br /&gt;
&lt;br /&gt;
 VZPKG_CACHE_HOST=hostname:3142&lt;br /&gt;
&lt;br /&gt;
While you are here, review this file to ensure it makes sense for your setup.  In particular, you will probably have to update the VZPKG_DNS line with IP addresses of DNS servers you use.&lt;br /&gt;
&lt;br /&gt;
 VZPKG_DNS=192.168.1.2,192.168.1.3&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Configure pkg-cacher&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
Edit /etc/pkg-cacher/pkg-cacher.conf.  You should read the included documentation in the file to ensure it is appropriate for your setup.  Mostly the defaults will work just fine.  By default pkg-cacher will let any system use its cache.  You will probably want to limit it to your own systems on the line:&lt;br /&gt;
&lt;br /&gt;
 allowed_hosts=*&lt;br /&gt;
&lt;br /&gt;
Once you have checked and updated pkg-cacher.conf, simply restart it by running as root:&lt;br /&gt;
&lt;br /&gt;
 service pkg-cacher restart&lt;br /&gt;
&lt;br /&gt;
====Debian Installs:====&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Remove Old Packages&amp;lt;/u&amp;gt;=====&lt;br /&gt;
If this is an '''existing''' install, uninstall your vzpkg and vztmpl-* packages:&lt;br /&gt;
&lt;br /&gt;
 apt-get erase vzpkg vzctl-ostmpl-*&lt;br /&gt;
&lt;br /&gt;
and backup &amp;amp; remove your current template directory:&lt;br /&gt;
&lt;br /&gt;
 tar cjf /some/backup/location/old_templates.tbz /vz/template&lt;br /&gt;
 rm -r /vz/template&lt;br /&gt;
&lt;br /&gt;
If this is a '''new''' install, you should probably review the [http://download.openvz.org/doc/OpenVZ-Users-Guide.pdf OpenVZ User's Guide] and the wiki's [[Installation on Debian]] page.  The only way you would vary your installation setups is declining to install the default vzpkg package, and instead using vzpkg2 here.&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Add the deb repositories to your /etc/apt/sources.list:&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
Add the following lines to your /etc/apt/sources.list:&lt;br /&gt;
&lt;br /&gt;
Etch:&lt;br /&gt;
    deb http://repo.opensource-sw.net/debian/ etch openvz&lt;br /&gt;
    deb-src http://repo.opensource-sw.net/debian/ etch openvz&lt;br /&gt;
&lt;br /&gt;
Sarge:&lt;br /&gt;
    deb http://repo.opensource-sw.net/debian/ sarge openvz&lt;br /&gt;
    deb-src http://repo.opensource-sw.net/debian/ sarge openvz&lt;br /&gt;
&lt;br /&gt;
Then do:&lt;br /&gt;
    apt-get update&lt;br /&gt;
    apt-get install pkg-cacher-sa vzpkg2&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Adding New Templates:&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
At the time of writing the OS templates were only available in RPM format.  To be able to install them, install yum:&lt;br /&gt;
&lt;br /&gt;
    apt-get install yum&lt;br /&gt;
   &lt;br /&gt;
Then fetch the templates and install them:&lt;br /&gt;
&lt;br /&gt;
    wget http://repo.opensource-sw.net/centos/5/i386/vztmpl2-centos-0.9.0-1.noarch.rpm &lt;br /&gt;
    wget http://repo.opensource-sw.net/centos/5/i386/vztmpl2-fedora-0.9.0-1.noarch.rpm&lt;br /&gt;
    wget http://repo.opensource-sw.net/centos/5/i386/vztmpl2-debian-0.9.0-1.noarch.rpm&lt;br /&gt;
 &lt;br /&gt;
    rpm -i --nodeps vztmpl2-*.rpm&lt;br /&gt;
&lt;br /&gt;
Then move the templates to where Debian expects them:&lt;br /&gt;
&lt;br /&gt;
    mv /vz/template/* /var/lib/vz/template/&lt;br /&gt;
&lt;br /&gt;
Edit the /var/lib/vz/template/{centos,fedora,debian}/config/vzpkg.conf files as well to reference where Debian expects them.  Change the line:&lt;br /&gt;
    baseurl=file:///vz/template/$OS_NAME/$OS_VER/$OS_ARCH/vz-addons/&lt;br /&gt;
to:&lt;br /&gt;
    baseurl=file:///var/lib/vz/template/$OS_NAME/$OS_VER/$OS_ARCH/vz-addons/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Configure vzpkg2&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
Open /etc/vz/vzpkg.conf in an editor.  Replace 'hostname' with the hostname or IP of the machine you are installing this on for VZPKG_CACHE_HOST, make sure not to use 'localhost', because this name is what OpenVZ Containers will use to access the pkg-cacher daemon:&lt;br /&gt;
&lt;br /&gt;
 VZPKG_CACHE_HOST=hostname:3142&lt;br /&gt;
&lt;br /&gt;
While you are here, review this file to ensure it makes sense for your setup.  In particular, you will probably have to update the VZPKG_DNS line with IP addresses of DNS servers you use.&lt;br /&gt;
&lt;br /&gt;
 VZPKG_DNS=192.168.1.2,192.168.1.3&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Configure pkg-cacher&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Source===&lt;br /&gt;
&lt;br /&gt;
The source for the new vzpkg2 and templates is available on http://git.opensource-sw.net.  In order to clone the updated source use the command:&lt;br /&gt;
 git clone http://git.opensource-sw.net/git/vzpkg  &lt;br /&gt;
&lt;br /&gt;
The templates are available using:&lt;br /&gt;
 git clone http://git.opensource-sw.net/git/vztmpl&lt;/div&gt;</summary>
		<author><name>BurnMage</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Install_vzpkg2_and_pkg-cacher&amp;diff=6716</id>
		<title>Install vzpkg2 and pkg-cacher</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Install_vzpkg2_and_pkg-cacher&amp;diff=6716"/>
		<updated>2008-11-20T19:53:11Z</updated>

		<summary type="html">&lt;p&gt;BurnMage: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Introduction ===&lt;br /&gt;
&lt;br /&gt;
2008/11/19: This is still unfinished, a work in progress, give me a couple days or email me through wiki if you have questions or concerns -BurnMage&lt;br /&gt;
&lt;br /&gt;
Robert Nelson has created a couple new utilities to make managing and updating templates and containers easier, vzpkg2 pkg-cacher.  So far they will create and update a large range of containers, including both 32bit and 64bit of the following:&lt;br /&gt;
    &lt;br /&gt;
* Centos 4 and 5,&lt;br /&gt;
* Fedora 7, 8 and 9,&lt;br /&gt;
* Debian Sarge and Etch,&lt;br /&gt;
* Ubuntu Feisty, Gutsy and Hardy.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Pkg-cacher is a transparent caching proxy daemon optimized for Debian and RPM packages.  In other terms, pkg-cacher is a service that runs on a machine that other machines and containers, or &amp;quot;clients&amp;quot;, use to update themselves instead of each of them directly hitting the package repositories.  Pkg-cacher only downloads a file once and then gives that to all its clients, instead of each of the clients downloading the file from the Internet at large.  It is based on [http://www.nick-andrew.net/projects/apt-cacher/ apt-cacher], available with Debian.  This version has been modified to understand RedHat RPM repositories.  It also adds support for the HTTP Range header and deals correctly with files which have the same name but different content on different distributions or in some cases different versions of the same distribution.  &lt;br /&gt;
&lt;br /&gt;
Robert has setup repositories for Fedora, CentOS and Debian.&lt;br /&gt;
&lt;br /&gt;
====Screencast====&lt;br /&gt;
&lt;br /&gt;
Scott Dowdle has recorded a good screencast overview of vzpkg2 and pkg-cacher at:&lt;br /&gt;
&lt;br /&gt;
 http://www.montanalinux.org/vzpkg2-screencast.html&lt;br /&gt;
&lt;br /&gt;
===Installation===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Centos &amp;amp; Fedora installs:====&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Remove Old Packages&amp;lt;/u&amp;gt;=====&lt;br /&gt;
If this is an '''existing''' install, uninstall your vzpkg and vztmpl-* packages:&lt;br /&gt;
&lt;br /&gt;
 yum remove vzpkg vztmpl-*&lt;br /&gt;
&lt;br /&gt;
and backup &amp;amp; remove your current template directory:&lt;br /&gt;
&lt;br /&gt;
 tar cjf /some/backup/location/old_templates.tbz /vz/template&lt;br /&gt;
 rm -r /vz/template&lt;br /&gt;
&lt;br /&gt;
If this is a '''new''' install, you should probably review the [http://download.openvz.org/doc/OpenVZ-Users-Guide.pdf OpenVZ User's Guide] and the wiki's [[Quick installation]] page.  The only way you would vary your installation setups is declining to install the default vzpkg package, and instead using vzpkg2 here.&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Download the repository file for your OS&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
For CentOS:&lt;br /&gt;
    wget http://repo.opensource-sw.net/centos/ossw.repo -P /etc/yum.repos.d&lt;br /&gt;
&lt;br /&gt;
For Fedora:&lt;br /&gt;
    wget http://repo.opensource-sw.net/fedora/ossw.repo -P /etc/yum.repos.d&lt;br /&gt;
&lt;br /&gt;
You may wish to edit the repository file, perhaps to add a priorities setting.  &lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Install vzpkg2 and pkg-cacher&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
Once the repository is added in /etc/yum.repos.d, you can now install the new vzpkg2 and pkg-cacher from it:&lt;br /&gt;
&lt;br /&gt;
 yum install vzpkg2 vztmpl2-centos vztmpl2-fedora vztmpl2-debian vztmpl2-ubuntu&lt;br /&gt;
 yum install pkg-cacher-sa&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Configure vzpkg2&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
Open /etc/vz/vzpkg.conf in an editor.  Replace 'hostname' with the hostname or IP of the machine you are installing this on for VZPKG_CACHE_HOST, make sure not to use 'localhost', because this name is what OpenVZ Containers will use to access the pkg-cacher daemon:&lt;br /&gt;
&lt;br /&gt;
 VZPKG_CACHE_HOST=hostname:3142&lt;br /&gt;
&lt;br /&gt;
While you are here, review this file to ensure it makes sense for your setup.  In particular, you will probably have to update the VZPKG_DNS line with IP addresses of DNS servers you use.&lt;br /&gt;
&lt;br /&gt;
 VZPKG_DNS=192.168.1.2,192.168.1.3&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Configure pkg-cacher&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Debian Installs:====&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Remove Old Packages&amp;lt;/u&amp;gt;=====&lt;br /&gt;
If this is an '''existing''' install, uninstall your vzpkg and vztmpl-* packages:&lt;br /&gt;
&lt;br /&gt;
 apt-get erase vzpkg vzctl-ostmpl-*&lt;br /&gt;
&lt;br /&gt;
and backup &amp;amp; remove your current template directory:&lt;br /&gt;
&lt;br /&gt;
 tar cjf /some/backup/location/old_templates.tbz /vz/template&lt;br /&gt;
 rm -r /vz/template&lt;br /&gt;
&lt;br /&gt;
If this is a '''new''' install, you should probably review the [http://download.openvz.org/doc/OpenVZ-Users-Guide.pdf OpenVZ User's Guide] and the wiki's [[Installation on Debian]] page.  The only way you would vary your installation setups is declining to install the default vzpkg package, and instead using vzpkg2 here.&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Add the deb repositories to your /etc/apt/sources.list:&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
Add the following lines to your /etc/apt/sources.list:&lt;br /&gt;
&lt;br /&gt;
Etch:&lt;br /&gt;
    deb http://repo.opensource-sw.net/debian/ etch openvz&lt;br /&gt;
    deb-src http://repo.opensource-sw.net/debian/ etch openvz&lt;br /&gt;
&lt;br /&gt;
Sarge:&lt;br /&gt;
    deb http://repo.opensource-sw.net/debian/ sarge openvz&lt;br /&gt;
    deb-src http://repo.opensource-sw.net/debian/ sarge openvz&lt;br /&gt;
&lt;br /&gt;
Then do:&lt;br /&gt;
    apt-get update&lt;br /&gt;
    apt-get install pkg-cacher-sa vzpkg2&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Adding New Templates:&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
At the time of writing the OS templates were only available in RPM format.  To be able to install them, install yum:&lt;br /&gt;
&lt;br /&gt;
    apt-get install yum&lt;br /&gt;
   &lt;br /&gt;
Then fetch the templates and install them:&lt;br /&gt;
&lt;br /&gt;
    wget http://repo.opensource-sw.net/centos/5/i386/vztmpl2-centos-0.9.0-1.noarch.rpm &lt;br /&gt;
    wget http://repo.opensource-sw.net/centos/5/i386/vztmpl2-fedora-0.9.0-1.noarch.rpm&lt;br /&gt;
    wget http://repo.opensource-sw.net/centos/5/i386/vztmpl2-debian-0.9.0-1.noarch.rpm&lt;br /&gt;
 &lt;br /&gt;
    rpm -i --nodeps vztmpl2-*.rpm&lt;br /&gt;
&lt;br /&gt;
Then move the templates to where Debian expects them:&lt;br /&gt;
&lt;br /&gt;
    mv /vz/template/* /var/lib/vz/template/&lt;br /&gt;
&lt;br /&gt;
Edit the /var/lib/vz/template/{centos,fedora,debian}/config/vzpkg.conf files as well to reference where Debian expects them.  Change the line:&lt;br /&gt;
    baseurl=file:///vz/template/$OS_NAME/$OS_VER/$OS_ARCH/vz-addons/&lt;br /&gt;
to:&lt;br /&gt;
    baseurl=file:///var/lib/vz/template/$OS_NAME/$OS_VER/$OS_ARCH/vz-addons/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Configure vzpkg2&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
Open /etc/vz/vzpkg.conf in an editor.  Replace 'hostname' with the hostname or IP of the machine you are installing this on for VZPKG_CACHE_HOST, make sure not to use 'localhost', because this name is what OpenVZ Containers will use to access the pkg-cacher daemon:&lt;br /&gt;
&lt;br /&gt;
 VZPKG_CACHE_HOST=hostname:3142&lt;br /&gt;
&lt;br /&gt;
While you are here, review this file to ensure it makes sense for your setup.  In particular, you will probably have to update the VZPKG_DNS line with IP addresses of DNS servers you use.&lt;br /&gt;
&lt;br /&gt;
 VZPKG_DNS=192.168.1.2,192.168.1.3&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Configure pkg-cacher&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Source===&lt;br /&gt;
&lt;br /&gt;
The source for the new vzpkg2 and templates is available on http://git.opensource-sw.net.  In order to clone the updated source use the command:&lt;br /&gt;
 git clone http://git.opensource-sw.net/git/vzpkg  &lt;br /&gt;
&lt;br /&gt;
The templates are available using:&lt;br /&gt;
 git clone http://git.opensource-sw.net/git/vztmpl&lt;/div&gt;</summary>
		<author><name>BurnMage</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Install_vzpkg2_and_pkg-cacher&amp;diff=6715</id>
		<title>Install vzpkg2 and pkg-cacher</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Install_vzpkg2_and_pkg-cacher&amp;diff=6715"/>
		<updated>2008-11-20T19:08:15Z</updated>

		<summary type="html">&lt;p&gt;BurnMage: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Introduction ===&lt;br /&gt;
&lt;br /&gt;
2008/11/19: This is still unfinished, a work in progress, give me a couple days or email me through wiki if you have questions or concerns -BurnMage&lt;br /&gt;
&lt;br /&gt;
Robert Nelson has created a couple new utilities to make managing and updating templates and containers easier, vzpkg2 pkg-cacher.  So far they will create and update a large range of containers, including both 32bit and 64bit of the following:&lt;br /&gt;
    &lt;br /&gt;
* Centos 4 and 5,&lt;br /&gt;
* Fedora 7, 8 and 9,&lt;br /&gt;
* Debian Sarge and Etch,&lt;br /&gt;
* Ubuntu Feisty, Gutsy and Hardy.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Pkg-cacher is a transparent caching proxy daemon optimized for Debian and RPM packages.  In other terms, pkg-cacher is a service that runs on a machine that other machines and containers, or &amp;quot;clients&amp;quot;, use to update themselves instead of each of them directly hitting the package repositories.  Pkg-cacher only downloads a file once and then gives that to all its clients, instead of each of the clients downloading the file from the Internet at large.  It is based on [http://www.nick-andrew.net/projects/apt-cacher/ apt-cacher], available with Debian.  This version has been modified to understand RedHat RPM repositories.  It also adds support for the HTTP Range header and deals correctly with files which have the same name but different content on different distributions or in some cases different versions of the same distribution.  &lt;br /&gt;
&lt;br /&gt;
Robert has setup repositories for Fedora, CentOS and Debian.&lt;br /&gt;
&lt;br /&gt;
===Installation===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Centos &amp;amp; Fedora installs:====&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Remove Old Packages&amp;lt;/u&amp;gt;=====&lt;br /&gt;
If this is an '''existing''' install, uninstall your vzpkg and vztmpl-* packages:&lt;br /&gt;
&lt;br /&gt;
 yum remove vzpkg vztmpl-*&lt;br /&gt;
&lt;br /&gt;
and backup &amp;amp; remove your current template directory:&lt;br /&gt;
&lt;br /&gt;
 tar cjf /some/backup/location/old_templates.tbz /vz/template&lt;br /&gt;
 rm -r /vz/template&lt;br /&gt;
&lt;br /&gt;
If this is a '''new''' install, you should probably review the [http://download.openvz.org/doc/OpenVZ-Users-Guide.pdf OpenVZ User's Guide] and the wiki's [[Quick installation]] page.  The only way you would vary your installation setups is declining to install the default vzpkg package, and instead using vzpkg2 here.&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Download the repository file for your OS&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
For CentOS:&lt;br /&gt;
    wget http://repo.opensource-sw.net/centos/ossw.repo -P /etc/yum.repos.d&lt;br /&gt;
&lt;br /&gt;
For Fedora:&lt;br /&gt;
    wget http://repo.opensource-sw.net/fedora/ossw.repo -P /etc/yum.repos.d&lt;br /&gt;
&lt;br /&gt;
You may wish to edit the repository file, perhaps to add a priorities setting.  &lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Install vzpkg2 and pkg-cacher&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
Once the repository is added in /etc/yum.repos.d, you can now install the new vzpkg2 and pkg-cacher from it:&lt;br /&gt;
&lt;br /&gt;
 yum install vzpkg2 vztmpl2-centos vztmpl2-fedora vztmpl2-debian vztmpl2-ubuntu&lt;br /&gt;
 yum install pkg-cacher-sa&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Configure vzpkg2&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
Open /etc/vz/vzpkg.conf in an editor.  Replace 'hostname' with the hostname or IP of the machine you are installing this on for VZPKG_CACHE_HOST, make sure not to use 'localhost', because this name is what OpenVZ Containers will use to access the pkg-cacher daemon:&lt;br /&gt;
&lt;br /&gt;
 VZPKG_CACHE_HOST=hostname:3142&lt;br /&gt;
&lt;br /&gt;
While you are here, review this file to ensure it makes sense for your setup.  In particular, you will probably have to update the VZPKG_DNS line with IP addresses of DNS servers you use.&lt;br /&gt;
&lt;br /&gt;
 VZPKG_DNS=192.168.1.2,192.168.1.3&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Configure pkg-cacher&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Debian Installs:====&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Remove Old Packages&amp;lt;/u&amp;gt;=====&lt;br /&gt;
If this is an '''existing''' install, uninstall your vzpkg and vztmpl-* packages:&lt;br /&gt;
&lt;br /&gt;
 apt-get erase vzpkg vzctl-ostmpl-*&lt;br /&gt;
&lt;br /&gt;
and backup &amp;amp; remove your current template directory:&lt;br /&gt;
&lt;br /&gt;
 tar cjf /some/backup/location/old_templates.tbz /vz/template&lt;br /&gt;
 rm -r /vz/template&lt;br /&gt;
&lt;br /&gt;
If this is a '''new''' install, you should probably review the [http://download.openvz.org/doc/OpenVZ-Users-Guide.pdf OpenVZ User's Guide] and the wiki's [[Installation on Debian]] page.  The only way you would vary your installation setups is declining to install the default vzpkg package, and instead using vzpkg2 here.&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Add the deb repositories to your /etc/apt/sources.list:&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
Add the following lines to your /etc/apt/sources.list:&lt;br /&gt;
&lt;br /&gt;
Etch:&lt;br /&gt;
    deb http://repo.opensource-sw.net/debian/ etch openvz&lt;br /&gt;
    deb-src http://repo.opensource-sw.net/debian/ etch openvz&lt;br /&gt;
&lt;br /&gt;
Sarge:&lt;br /&gt;
    deb http://repo.opensource-sw.net/debian/ sarge openvz&lt;br /&gt;
    deb-src http://repo.opensource-sw.net/debian/ sarge openvz&lt;br /&gt;
&lt;br /&gt;
Then do:&lt;br /&gt;
    apt-get update&lt;br /&gt;
    apt-get install pkg-cacher-sa vzpkg2&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Adding New Templates:&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
At the time of writing the OS templates were only available in RPM format.  To be able to install them, install yum:&lt;br /&gt;
&lt;br /&gt;
    apt-get install yum&lt;br /&gt;
   &lt;br /&gt;
Then fetch the templates and install them:&lt;br /&gt;
&lt;br /&gt;
    wget http://repo.opensource-sw.net/centos/5/i386/vztmpl2-centos-0.9.0-1.noarch.rpm &lt;br /&gt;
    wget http://repo.opensource-sw.net/centos/5/i386/vztmpl2-fedora-0.9.0-1.noarch.rpm&lt;br /&gt;
    wget http://repo.opensource-sw.net/centos/5/i386/vztmpl2-debian-0.9.0-1.noarch.rpm&lt;br /&gt;
 &lt;br /&gt;
    rpm -i --nodeps vztmpl2-*.rpm&lt;br /&gt;
&lt;br /&gt;
Then move the templates to where Debian expects them:&lt;br /&gt;
&lt;br /&gt;
    mv /vz/template/* /var/lib/vz/template/&lt;br /&gt;
&lt;br /&gt;
Edit the /var/lib/vz/template/{centos,fedora,debian}/config/vzpkg.conf files as well to reference where Debian expects them.  Change the line:&lt;br /&gt;
    baseurl=file:///vz/template/$OS_NAME/$OS_VER/$OS_ARCH/vz-addons/&lt;br /&gt;
to:&lt;br /&gt;
    baseurl=file:///var/lib/vz/template/$OS_NAME/$OS_VER/$OS_ARCH/vz-addons/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Configure vzpkg2&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
Open /etc/vz/vzpkg.conf in an editor.  Replace 'hostname' with the hostname or IP of the machine you are installing this on for VZPKG_CACHE_HOST, make sure not to use 'localhost', because this name is what OpenVZ Containers will use to access the pkg-cacher daemon:&lt;br /&gt;
&lt;br /&gt;
 VZPKG_CACHE_HOST=hostname:3142&lt;br /&gt;
&lt;br /&gt;
While you are here, review this file to ensure it makes sense for your setup.  In particular, you will probably have to update the VZPKG_DNS line with IP addresses of DNS servers you use.&lt;br /&gt;
&lt;br /&gt;
 VZPKG_DNS=192.168.1.2,192.168.1.3&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Configure pkg-cacher&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Source===&lt;br /&gt;
&lt;br /&gt;
The source for the new vzpkg2 and templates is available on http://git.opensource-sw.net.  In order to clone the updated source use the command:&lt;br /&gt;
 git clone http://git.opensource-sw.net/git/vzpkg  &lt;br /&gt;
&lt;br /&gt;
The templates are available using:&lt;br /&gt;
 git clone http://git.opensource-sw.net/git/vztmpl&lt;/div&gt;</summary>
		<author><name>BurnMage</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Install_vzpkg2_and_pkg-cacher&amp;diff=6714</id>
		<title>Install vzpkg2 and pkg-cacher</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Install_vzpkg2_and_pkg-cacher&amp;diff=6714"/>
		<updated>2008-11-20T18:59:21Z</updated>

		<summary type="html">&lt;p&gt;BurnMage: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Introduction ===&lt;br /&gt;
&lt;br /&gt;
2008/11/19: This is still unfinished, a work in progress, give me a couple days or email me through wiki if you have questions or concerns -BurnMage&lt;br /&gt;
&lt;br /&gt;
Robert Nelson has created a couple new utilities to make managing and updating templates and containers easier, vzpkg2 pkg-cacher.  So far they will create and update a large range of containers, including both 32bit and 64bit of the following:&lt;br /&gt;
    &lt;br /&gt;
* Centos 4 and 5,&lt;br /&gt;
* Fedora 7, 8 and 9,&lt;br /&gt;
* Debian Sarge and Etch,&lt;br /&gt;
* Ubuntu Feisty, Gutsy and Hardy.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Pkg-cacher is a transparent caching proxy daemon optimized for Debian and RPM packages.  It is based on [http://www.nick-andrew.net/projects/apt-cacher/ apt-cacher], available with Debian.  This version has been modified to understand RedHat RPM repositories.  It also adds support for the HTTP Range header and deals correctly with files which have the same name but different content on different distributions or in some cases different versions of the same distribution.&lt;br /&gt;
&lt;br /&gt;
Robert has setup repositories for Fedora, Centos and Debian.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Installation===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Centos &amp;amp; Fedora installs:====&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Remove Old Packages&amp;lt;/u&amp;gt;=====&lt;br /&gt;
If this is an '''existing''' install, uninstall your vzpkg and vztmpl-* packages:&lt;br /&gt;
&lt;br /&gt;
 yum remove vzpkg vztmpl-*&lt;br /&gt;
&lt;br /&gt;
and backup &amp;amp; remove your current template directory:&lt;br /&gt;
&lt;br /&gt;
 tar cjf /some/backup/location/old_templates.tbz /vz/template&lt;br /&gt;
 rm -r /vz/template&lt;br /&gt;
&lt;br /&gt;
If this is a '''new''' install, you should probably review the [http://download.openvz.org/doc/OpenVZ-Users-Guide.pdf OpenVZ User's Guide] and the wiki's [[Quick installation]] page.  The only way you would vary your installation setups is declining to install the default vzpkg package, and instead using vzpkg2 here.&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Download the repository file for your OS&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
For CentOS:&lt;br /&gt;
    wget http://repo.opensource-sw.net/centos/ossw.repo -P /etc/yum.repos.d&lt;br /&gt;
&lt;br /&gt;
For Fedora:&lt;br /&gt;
    wget http://repo.opensource-sw.net/fedora/ossw.repo -P /etc/yum.repos.d&lt;br /&gt;
&lt;br /&gt;
You may wish to edit the repository file, perhaps to add a priorities setting.  &lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Install vzpkg2 and pkg-cacher&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
Once the repository is added in /etc/yum.repos.d, you can now install the new vzpkg2 and pkg-cacher from it:&lt;br /&gt;
&lt;br /&gt;
 yum install vzpkg2 vztmpl2-centos vztmpl2-fedora vztmpl2-debian vztmpl2-ubuntu&lt;br /&gt;
 yum install pkg-cacher-sa&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Configure vzpkg2&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
Open /etc/vz/vzpkg.conf in an editor.  Replace 'hostname' with the hostname or IP of the machine you are installing this on for VZPKG_CACHE_HOST, make sure not to use 'localhost', because this name is what OpenVZ Containers will use to access the pkg-cacher daemon:&lt;br /&gt;
&lt;br /&gt;
 VZPKG_CACHE_HOST=hostname:3142&lt;br /&gt;
&lt;br /&gt;
While you are here, review this file to ensure it makes sense for your setup.  In particular, you will probably have to update the VZPKG_DNS line with IP addresses of DNS servers you use.&lt;br /&gt;
&lt;br /&gt;
 VZPKG_DNS=192.168.1.2,192.168.1.3&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Configure pkg-cacher&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Debian Installs:====&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Remove Old Packages&amp;lt;/u&amp;gt;=====&lt;br /&gt;
If this is an '''existing''' install, uninstall your vzpkg and vztmpl-* packages:&lt;br /&gt;
&lt;br /&gt;
 apt-get erase vzpkg vzctl-ostmpl-*&lt;br /&gt;
&lt;br /&gt;
and backup &amp;amp; remove your current template directory:&lt;br /&gt;
&lt;br /&gt;
 tar cjf /some/backup/location/old_templates.tbz /vz/template&lt;br /&gt;
 rm -r /vz/template&lt;br /&gt;
&lt;br /&gt;
If this is a '''new''' install, you should probably review the [http://download.openvz.org/doc/OpenVZ-Users-Guide.pdf OpenVZ User's Guide] and the wiki's [[Installation on Debian]] page.  The only way you would vary your installation setups is declining to install the default vzpkg package, and instead using vzpkg2 here.&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Add the deb repositories to your /etc/apt/sources.list:&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
Add the following lines to your /etc/apt/sources.list:&lt;br /&gt;
&lt;br /&gt;
Etch:&lt;br /&gt;
    deb http://repo.opensource-sw.net/debian/ etch openvz&lt;br /&gt;
    deb-src http://repo.opensource-sw.net/debian/ etch openvz&lt;br /&gt;
&lt;br /&gt;
Sarge:&lt;br /&gt;
    deb http://repo.opensource-sw.net/debian/ sarge openvz&lt;br /&gt;
    deb-src http://repo.opensource-sw.net/debian/ sarge openvz&lt;br /&gt;
&lt;br /&gt;
Then do:&lt;br /&gt;
    apt-get update&lt;br /&gt;
    apt-get install pkg-cacher-sa vzpkg2&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Adding New Templates:&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
At the time of writing the OS templates were only available in RPM format.  To be able to install them, install yum:&lt;br /&gt;
&lt;br /&gt;
    apt-get install yum&lt;br /&gt;
   &lt;br /&gt;
Then fetch the templates and install them:&lt;br /&gt;
&lt;br /&gt;
    wget http://repo.opensource-sw.net/centos/5/i386/vztmpl2-centos-0.9.0-1.noarch.rpm &lt;br /&gt;
    wget http://repo.opensource-sw.net/centos/5/i386/vztmpl2-fedora-0.9.0-1.noarch.rpm&lt;br /&gt;
    wget http://repo.opensource-sw.net/centos/5/i386/vztmpl2-debian-0.9.0-1.noarch.rpm&lt;br /&gt;
 &lt;br /&gt;
    rpm -i --nodeps vztmpl2-*.rpm&lt;br /&gt;
&lt;br /&gt;
Then move the templates to where Debian expects them:&lt;br /&gt;
&lt;br /&gt;
    mv /vz/template/* /var/lib/vz/template/&lt;br /&gt;
&lt;br /&gt;
Edit the /var/lib/vz/template/{centos,fedora,debian}/config/vzpkg.conf files as well to reference where Debian expects them.  Change the line:&lt;br /&gt;
    baseurl=file:///vz/template/$OS_NAME/$OS_VER/$OS_ARCH/vz-addons/&lt;br /&gt;
to:&lt;br /&gt;
    baseurl=file:///var/lib/vz/template/$OS_NAME/$OS_VER/$OS_ARCH/vz-addons/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Configure vzpkg2&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
Open /etc/vz/vzpkg.conf in an editor.  Replace 'hostname' with the hostname or IP of the machine you are installing this on for VZPKG_CACHE_HOST, make sure not to use 'localhost', because this name is what OpenVZ Containers will use to access the pkg-cacher daemon:&lt;br /&gt;
&lt;br /&gt;
 VZPKG_CACHE_HOST=hostname:3142&lt;br /&gt;
&lt;br /&gt;
While you are here, review this file to ensure it makes sense for your setup.  In particular, you will probably have to update the VZPKG_DNS line with IP addresses of DNS servers you use.&lt;br /&gt;
&lt;br /&gt;
 VZPKG_DNS=192.168.1.2,192.168.1.3&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Configure pkg-cacher&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Source===&lt;br /&gt;
&lt;br /&gt;
The source for the new vzpkg2 and templates is available on http://git.opensource-sw.net.  In order to clone the updated source use the command:&lt;br /&gt;
 git clone http://git.opensource-sw.net/git/vzpkg  &lt;br /&gt;
&lt;br /&gt;
The templates are available using:&lt;br /&gt;
 git clone http://git.opensource-sw.net/git/vztmpl&lt;/div&gt;</summary>
		<author><name>BurnMage</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Install_vzpkg2_and_pkg-cacher&amp;diff=6713</id>
		<title>Install vzpkg2 and pkg-cacher</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Install_vzpkg2_and_pkg-cacher&amp;diff=6713"/>
		<updated>2008-11-20T18:57:52Z</updated>

		<summary type="html">&lt;p&gt;BurnMage: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Introduction ===&lt;br /&gt;
&lt;br /&gt;
2008/11/19: This is still unfinished, a work in progress, give me a couple days or email me through wiki if you have questions or concerns -BurnMage&lt;br /&gt;
&lt;br /&gt;
Robert Nelson has created a couple new utilities to make managing and updating templates and containers easier, vzpkg2 pkg-cacher.  So far they will create and update a large range of containers, including both 32bit and 64bit of the following:&lt;br /&gt;
    &lt;br /&gt;
* Centos 4 and 5,&lt;br /&gt;
* Fedora 7, 8 and 9,&lt;br /&gt;
* Debian Sarge and Etch,&lt;br /&gt;
* Ubuntu Feisty, Gutsy and Hardy.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Pkg-cacher is a transparent caching proxy daemon optimized for Debian and RPM packages.  It is based on [http://www.nick-andrew.net/projects/apt-cacher/ apt-cacher], available with Debian.  This version has been modified to understand RedHat RPM repositories.  It also adds support for the HTTP Range header and deals correctly with files which have the same name but different content on different distributions or in some cases different versions of the same distribution.&lt;br /&gt;
&lt;br /&gt;
Robert has setup repositories for Fedora, Centos and Debian.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Installation===&lt;br /&gt;
&lt;br /&gt;
====Remove Old Packages &amp;amp; Templates====&lt;br /&gt;
&lt;br /&gt;
* Backup your existing /vz/template directory and clear it out.&lt;br /&gt;
* Uninstall vzpkg and any vztmpl-* packages.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Centos &amp;amp; Fedora installs:====&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Remove Old Packages&amp;lt;/u&amp;gt;=====&lt;br /&gt;
If this is an '''existing''' install, uninstall your vzpkg and vztmpl-* packages:&lt;br /&gt;
&lt;br /&gt;
 yum remove vzpkg vztmpl-*&lt;br /&gt;
&lt;br /&gt;
and backup &amp;amp; remove your current template directory:&lt;br /&gt;
&lt;br /&gt;
 tar cjf /some/backup/location/old_templates.tbz /vz/template&lt;br /&gt;
 rm -r /vz/template&lt;br /&gt;
&lt;br /&gt;
If this is a '''new''' install, you should probably review the [http://download.openvz.org/doc/OpenVZ-Users-Guide.pdf OpenVZ User's Guide] and the wiki's [[Quick installation]] page.  The only way you would vary your installation setups is declining to install the default vzpkg package, and instead using vzpkg2 here.&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Download the repository file for your OS&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
For CentOS:&lt;br /&gt;
    wget http://repo.opensource-sw.net/centos/ossw.repo -P /etc/yum.repos.d&lt;br /&gt;
&lt;br /&gt;
For Fedora:&lt;br /&gt;
    wget http://repo.opensource-sw.net/fedora/ossw.repo -P /etc/yum.repos.d&lt;br /&gt;
&lt;br /&gt;
You may wish to edit the repository file, perhaps to add a priorities setting.  &lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Install vzpkg2 and pkg-cacher&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
Once the repository is added in /etc/yum.repos.d, you can now install the new vzpkg2 and pkg-cacher from it:&lt;br /&gt;
&lt;br /&gt;
 yum install vzpkg2 vztmpl2-centos vztmpl2-fedora vztmpl2-debian vztmpl2-ubuntu&lt;br /&gt;
 yum install pkg-cacher-sa&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Configure vzpkg2&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
Open /etc/vz/vzpkg.conf in an editor.  Replace 'hostname' with the hostname or IP of the machine you are installing this on for VZPKG_CACHE_HOST, make sure not to use 'localhost', because this name is what OpenVZ Containers will use to access the pkg-cacher daemon:&lt;br /&gt;
&lt;br /&gt;
 VZPKG_CACHE_HOST=hostname:3142&lt;br /&gt;
&lt;br /&gt;
While you are here, review this file to ensure it makes sense for your setup.  In particular, you will probably have to update the VZPKG_DNS line with IP addresses of DNS servers you use.&lt;br /&gt;
&lt;br /&gt;
 VZPKG_DNS=192.168.1.2,192.168.1.3&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Configure pkg-cacher&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Debian Installs:====&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Remove Old Packages&amp;lt;/u&amp;gt;=====&lt;br /&gt;
If this is an '''existing''' install, uninstall your vzpkg and vztmpl-* packages:&lt;br /&gt;
&lt;br /&gt;
 apt-get erase vzpkg vzctl-ostmpl-*&lt;br /&gt;
&lt;br /&gt;
and backup &amp;amp; remove your current template directory:&lt;br /&gt;
&lt;br /&gt;
 tar cjf /some/backup/location/old_templates.tbz /vz/template&lt;br /&gt;
 rm -r /vz/template&lt;br /&gt;
&lt;br /&gt;
If this is a '''new''' install, you should probably review the [http://download.openvz.org/doc/OpenVZ-Users-Guide.pdf OpenVZ User's Guide] and the wiki's [[Installation on Debian]] page.  The only way you would vary your installation setups is declining to install the default vzpkg package, and instead using vzpkg2 here.&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Add the deb repositories to your /etc/apt/sources.list:&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
Add the following lines to your /etc/apt/sources.list:&lt;br /&gt;
&lt;br /&gt;
Etch:&lt;br /&gt;
    deb http://repo.opensource-sw.net/debian/ etch openvz&lt;br /&gt;
    deb-src http://repo.opensource-sw.net/debian/ etch openvz&lt;br /&gt;
&lt;br /&gt;
Sarge:&lt;br /&gt;
    deb http://repo.opensource-sw.net/debian/ sarge openvz&lt;br /&gt;
    deb-src http://repo.opensource-sw.net/debian/ sarge openvz&lt;br /&gt;
&lt;br /&gt;
Then do:&lt;br /&gt;
    apt-get update&lt;br /&gt;
    apt-get install pkg-cacher-sa vzpkg2&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Adding New Templates:&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
At the time of writing the OS templates were only available in RPM format.  To be able to install them, install yum:&lt;br /&gt;
&lt;br /&gt;
    apt-get install yum&lt;br /&gt;
   &lt;br /&gt;
Then fetch the templates and install them:&lt;br /&gt;
&lt;br /&gt;
    wget http://repo.opensource-sw.net/centos/5/i386/vztmpl2-centos-0.9.0-1.noarch.rpm &lt;br /&gt;
    wget http://repo.opensource-sw.net/centos/5/i386/vztmpl2-fedora-0.9.0-1.noarch.rpm&lt;br /&gt;
    wget http://repo.opensource-sw.net/centos/5/i386/vztmpl2-debian-0.9.0-1.noarch.rpm&lt;br /&gt;
 &lt;br /&gt;
    rpm -i --nodeps vztmpl2-*.rpm&lt;br /&gt;
&lt;br /&gt;
Then move the templates to where Debian expects them:&lt;br /&gt;
&lt;br /&gt;
    mv /vz/template/* /var/lib/vz/template/&lt;br /&gt;
&lt;br /&gt;
Edit the /var/lib/vz/template/{centos,fedora,debian}/config/vzpkg.conf files as well to reference where Debian expects them.  Change the line:&lt;br /&gt;
    baseurl=file:///vz/template/$OS_NAME/$OS_VER/$OS_ARCH/vz-addons/&lt;br /&gt;
to:&lt;br /&gt;
    baseurl=file:///var/lib/vz/template/$OS_NAME/$OS_VER/$OS_ARCH/vz-addons/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Configure vzpkg2&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
Open /etc/vz/vzpkg.conf in an editor.  Replace 'hostname' with the hostname or IP of the machine you are installing this on for VZPKG_CACHE_HOST, make sure not to use 'localhost', because this name is what OpenVZ Containers will use to access the pkg-cacher daemon:&lt;br /&gt;
&lt;br /&gt;
 VZPKG_CACHE_HOST=hostname:3142&lt;br /&gt;
&lt;br /&gt;
While you are here, review this file to ensure it makes sense for your setup.  In particular, you will probably have to update the VZPKG_DNS line with IP addresses of DNS servers you use.&lt;br /&gt;
&lt;br /&gt;
 VZPKG_DNS=192.168.1.2,192.168.1.3&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Configure pkg-cacher&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Source===&lt;br /&gt;
&lt;br /&gt;
The source for the new vzpkg2 and templates is available on http://git.opensource-sw.net.  In order to clone the updated source use the command:&lt;br /&gt;
 git clone http://git.opensource-sw.net/git/vzpkg  &lt;br /&gt;
&lt;br /&gt;
The templates are available using:&lt;br /&gt;
 git clone http://git.opensource-sw.net/git/vztmpl&lt;/div&gt;</summary>
		<author><name>BurnMage</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Install_vzpkg2_and_pkg-cacher&amp;diff=6712</id>
		<title>Install vzpkg2 and pkg-cacher</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Install_vzpkg2_and_pkg-cacher&amp;diff=6712"/>
		<updated>2008-11-20T18:55:48Z</updated>

		<summary type="html">&lt;p&gt;BurnMage: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Introduction ===&lt;br /&gt;
&lt;br /&gt;
2008/11/19: This is still unfinished, a work in progress, give me a couple days or email me through wiki if you have questions or concerns -BurnMage&lt;br /&gt;
&lt;br /&gt;
Robert Nelson has created a couple new utilities to make managing and updating templates and containers easier, vzpkg2 pkg-cacher.  So far they will create and update a large range of containers, including both 32bit and 64bit of the following:&lt;br /&gt;
    &lt;br /&gt;
* Centos 4 and 5,&lt;br /&gt;
* Fedora 7, 8 and 9,&lt;br /&gt;
* Debian Sarge and Etch,&lt;br /&gt;
* Ubuntu Feisty, Gutsy and Hardy.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Pkg-cacher is a transparent caching proxy daemon optimized for Debian and RPM packages.  It is based on [http://www.nick-andrew.net/projects/apt-cacher/ apt-cacher], available with Debian.  This version has been modified to understand RedHat RPM repositories.  It also adds support for the HTTP Range header and deals correctly with files which have the same name but different content on different distributions or in some cases different versions of the same distribution.&lt;br /&gt;
&lt;br /&gt;
Robert has setup repositories for Fedora, Centos and Debian.&lt;br /&gt;
&lt;br /&gt;
The source for the new vzpkg2 and templates is available on http://git.opensource-sw.net.  In order to clone the updated source use the command:&lt;br /&gt;
 git clone http://git.opensource-sw.net/git/vzpkg  &lt;br /&gt;
&lt;br /&gt;
The templates are available using:&lt;br /&gt;
 git clone http://git.opensource-sw.net/git/vztmpl&lt;br /&gt;
&lt;br /&gt;
===Installation===&lt;br /&gt;
&lt;br /&gt;
====Remove Old Packages &amp;amp; Templates====&lt;br /&gt;
&lt;br /&gt;
* Backup your existing /vz/template directory and clear it out.&lt;br /&gt;
* Uninstall vzpkg and any vztmpl-* packages.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Centos &amp;amp; Fedora installs:====&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Remove Old Packages&amp;lt;/u&amp;gt;=====&lt;br /&gt;
If this is an '''existing''' install, uninstall your vzpkg and vztmpl-* packages:&lt;br /&gt;
&lt;br /&gt;
 yum remove vzpkg vztmpl-*&lt;br /&gt;
&lt;br /&gt;
and backup &amp;amp; remove your current template directory:&lt;br /&gt;
&lt;br /&gt;
 tar cjf /some/backup/location/old_templates.tbz /vz/template&lt;br /&gt;
 rm -r /vz/template&lt;br /&gt;
&lt;br /&gt;
If this is a '''new''' install, you should probably review the [http://download.openvz.org/doc/OpenVZ-Users-Guide.pdf OpenVZ User's Guide] and the wiki's [[Quick installation]] page.  The only way you would vary your installation setups is declining to install the default vzpkg package, and instead using vzpkg2 here.&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Download the repository file for your OS&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
For CentOS:&lt;br /&gt;
    wget http://repo.opensource-sw.net/centos/ossw.repo -P /etc/yum.repos.d&lt;br /&gt;
&lt;br /&gt;
For Fedora:&lt;br /&gt;
    wget http://repo.opensource-sw.net/fedora/ossw.repo -P /etc/yum.repos.d&lt;br /&gt;
&lt;br /&gt;
You may wish to edit the repository file, perhaps to add a priorities setting.  &lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Install vzpkg2 and pkg-cacher&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
Once the repository is added in /etc/yum.repos.d, you can now install the new vzpkg2 and pkg-cacher from it:&lt;br /&gt;
&lt;br /&gt;
 yum install vzpkg2 vztmpl2-centos vztmpl2-fedora vztmpl2-debian vztmpl2-ubuntu&lt;br /&gt;
 yum install pkg-cacher-sa&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Configure vzpkg2&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
Open /etc/vz/vzpkg.conf in an editor.  Replace 'hostname' with the hostname or IP of the machine you are installing this on for VZPKG_CACHE_HOST, make sure not to use 'localhost', because this name is what OpenVZ Containers will use to access the pkg-cacher daemon:&lt;br /&gt;
&lt;br /&gt;
 VZPKG_CACHE_HOST=hostname:3142&lt;br /&gt;
&lt;br /&gt;
While you are here, review this file to ensure it makes sense for your setup.  In particular, you will probably have to update the VZPKG_DNS line with IP addresses of DNS servers you use.&lt;br /&gt;
&lt;br /&gt;
 VZPKG_DNS=192.168.1.2,192.168.1.3&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Configure pkg-cacher&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Debian Installs:====&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Remove Old Packages&amp;lt;/u&amp;gt;=====&lt;br /&gt;
If this is an '''existing''' install, uninstall your vzpkg and vztmpl-* packages:&lt;br /&gt;
&lt;br /&gt;
 apt-get erase vzpkg vzctl-ostmpl-*&lt;br /&gt;
&lt;br /&gt;
and backup &amp;amp; remove your current template directory:&lt;br /&gt;
&lt;br /&gt;
 tar cjf /some/backup/location/old_templates.tbz /vz/template&lt;br /&gt;
 rm -r /vz/template&lt;br /&gt;
&lt;br /&gt;
If this is a '''new''' install, you should probably review the [http://download.openvz.org/doc/OpenVZ-Users-Guide.pdf OpenVZ User's Guide] and the wiki's [[Installation on Debian]] page.  The only way you would vary your installation setups is declining to install the default vzpkg package, and instead using vzpkg2 here.&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Add the deb repositories to your /etc/apt/sources.list:&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
Add the following lines to your /etc/apt/sources.list:&lt;br /&gt;
&lt;br /&gt;
Etch:&lt;br /&gt;
    deb http://repo.opensource-sw.net/debian/ etch openvz&lt;br /&gt;
    deb-src http://repo.opensource-sw.net/debian/ etch openvz&lt;br /&gt;
&lt;br /&gt;
Sarge:&lt;br /&gt;
    deb http://repo.opensource-sw.net/debian/ sarge openvz&lt;br /&gt;
    deb-src http://repo.opensource-sw.net/debian/ sarge openvz&lt;br /&gt;
&lt;br /&gt;
Then do:&lt;br /&gt;
    apt-get update&lt;br /&gt;
    apt-get install pkg-cacher-sa vzpkg2&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Adding New Templates:&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
At the time of writing the OS templates were only available in RPM format.  To be able to install them, install yum:&lt;br /&gt;
&lt;br /&gt;
    apt-get install yum&lt;br /&gt;
   &lt;br /&gt;
Then fetch the templates and install them:&lt;br /&gt;
&lt;br /&gt;
    wget http://repo.opensource-sw.net/centos/5/i386/vztmpl2-centos-0.9.0-1.noarch.rpm &lt;br /&gt;
    wget http://repo.opensource-sw.net/centos/5/i386/vztmpl2-fedora-0.9.0-1.noarch.rpm&lt;br /&gt;
    wget http://repo.opensource-sw.net/centos/5/i386/vztmpl2-debian-0.9.0-1.noarch.rpm&lt;br /&gt;
 &lt;br /&gt;
    rpm -i --nodeps vztmpl2-*.rpm&lt;br /&gt;
&lt;br /&gt;
Then move the templates to where Debian expects them:&lt;br /&gt;
&lt;br /&gt;
    mv /vz/template/* /var/lib/vz/template/&lt;br /&gt;
&lt;br /&gt;
Edit the /var/lib/vz/template/{centos,fedora,debian}/config/vzpkg.conf files as well to reference where Debian expects them.  Change the line:&lt;br /&gt;
    baseurl=file:///vz/template/$OS_NAME/$OS_VER/$OS_ARCH/vz-addons/&lt;br /&gt;
to:&lt;br /&gt;
    baseurl=file:///var/lib/vz/template/$OS_NAME/$OS_VER/$OS_ARCH/vz-addons/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Configure vzpkg2&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
Open /etc/vz/vzpkg.conf in an editor.  Replace 'hostname' with the hostname or IP of the machine you are installing this on for VZPKG_CACHE_HOST, make sure not to use 'localhost', because this name is what OpenVZ Containers will use to access the pkg-cacher daemon:&lt;br /&gt;
&lt;br /&gt;
 VZPKG_CACHE_HOST=hostname:3142&lt;br /&gt;
&lt;br /&gt;
While you are here, review this file to ensure it makes sense for your setup.  In particular, you will probably have to update the VZPKG_DNS line with IP addresses of DNS servers you use.&lt;br /&gt;
&lt;br /&gt;
 VZPKG_DNS=192.168.1.2,192.168.1.3&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Configure pkg-cacher&amp;lt;/u&amp;gt;=====&lt;/div&gt;</summary>
		<author><name>BurnMage</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Install_vzpkg2_and_pkg-cacher&amp;diff=6711</id>
		<title>Install vzpkg2 and pkg-cacher</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Install_vzpkg2_and_pkg-cacher&amp;diff=6711"/>
		<updated>2008-11-20T18:53:28Z</updated>

		<summary type="html">&lt;p&gt;BurnMage: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Introduction ===&lt;br /&gt;
&lt;br /&gt;
2008/11/19: This is still unfinished, a work in progress, give me a couple days or email me through wiki if you have questions or concerns -BurnMage&lt;br /&gt;
&lt;br /&gt;
Robert Nelson has created a couple new utilities to make managing and updating templates and containers easier, vzpkg2 pkg-cacher.  So far they will create and update a large range of containers, including both 32bit and 64bit of the following:&lt;br /&gt;
    &lt;br /&gt;
* Centos 4 and 5,&lt;br /&gt;
* Fedora 7, 8 and 9,&lt;br /&gt;
* Debian Sarge and Etch,&lt;br /&gt;
* Ubuntu Feisty, Gutsy and Hardy.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Pkg-cacher is a transparent caching proxy daemon optimized for Debian and RPM packages.  It is based on [http://www.nick-andrew.net/projects/apt-cacher/ apt-cacher], available with Debian.  This version has been modified to understand RedHat RPM repositories.  It also adds support for the HTTP Range header and deals correctly with files which have the same name but different content on different distributions or in some cases different versions of the same distribution.&lt;br /&gt;
&lt;br /&gt;
Robert has setup an RPM repository for Fedora and CentOS installs, but when this document was written there were no repositories for Ubuntu or Debian setup yet. FIXME&lt;br /&gt;
&lt;br /&gt;
The source for the new vzpkg2 and templates is available on http://git.opensource-sw.net.  In order to clone the updated source use the command:&lt;br /&gt;
 git clone http://git.opensource-sw.net/git/vzpkg  &lt;br /&gt;
&lt;br /&gt;
The templates are available using:&lt;br /&gt;
 git clone http://git.opensource-sw.net/git/vztmpl&lt;br /&gt;
&lt;br /&gt;
===Installation===&lt;br /&gt;
&lt;br /&gt;
====Remove Old Packages &amp;amp; Templates====&lt;br /&gt;
&lt;br /&gt;
* Backup your existing /vz/template directory and clear it out.&lt;br /&gt;
* Uninstall vzpkg and any vztmpl-* packages.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Centos &amp;amp; Fedora installs:====&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Remove Old Packages&amp;lt;/u&amp;gt;=====&lt;br /&gt;
If this is an '''existing''' install, uninstall your vzpkg and vztmpl-* packages:&lt;br /&gt;
&lt;br /&gt;
 yum remove vzpkg vztmpl-*&lt;br /&gt;
&lt;br /&gt;
and backup &amp;amp; remove your current template directory:&lt;br /&gt;
&lt;br /&gt;
 tar cjf /some/backup/location/old_templates.tbz /vz/template&lt;br /&gt;
 rm -r /vz/template&lt;br /&gt;
&lt;br /&gt;
If this is a '''new''' install, you should probably review the [http://download.openvz.org/doc/OpenVZ-Users-Guide.pdf OpenVZ User's Guide] and the wiki's [[Quick installation]] page.  The only way you would vary your installation setups is declining to install the default vzpkg package, and instead using vzpkg2 here.&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Download the repository file for your OS&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
For CentOS:&lt;br /&gt;
    wget http://repo.opensource-sw.net/centos/ossw.repo -P /etc/yum.repos.d&lt;br /&gt;
&lt;br /&gt;
For Fedora:&lt;br /&gt;
    wget http://repo.opensource-sw.net/fedora/ossw.repo -P /etc/yum.repos.d&lt;br /&gt;
&lt;br /&gt;
You may wish to edit the repository file, perhaps to add a priorities setting.  &lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Install vzpkg2 and pkg-cacher&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
Once the repository is added in /etc/yum.repos.d, you can now install the new vzpkg2 and pkg-cacher from it:&lt;br /&gt;
&lt;br /&gt;
 yum install vzpkg2 vztmpl2-centos vztmpl2-fedora vztmpl2-debian vztmpl2-ubuntu&lt;br /&gt;
 yum install pkg-cacher-sa&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Configure vzpkg2&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
Open /etc/vz/vzpkg.conf in an editor.  Replace 'hostname' with the hostname or IP of the machine you are installing this on for VZPKG_CACHE_HOST, make sure not to use 'localhost', because this name is what OpenVZ Containers will use to access the pkg-cacher daemon:&lt;br /&gt;
&lt;br /&gt;
 VZPKG_CACHE_HOST=hostname:3142&lt;br /&gt;
&lt;br /&gt;
While you are here, review this file to ensure it makes sense for your setup.  In particular, you will probably have to update the VZPKG_DNS line with IP addresses of DNS servers you use.&lt;br /&gt;
&lt;br /&gt;
 VZPKG_DNS=192.168.1.2,192.168.1.3&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Configure pkg-cacher&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Debian Installs:====&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Remove Old Packages&amp;lt;/u&amp;gt;=====&lt;br /&gt;
If this is an '''existing''' install, uninstall your vzpkg and vztmpl-* packages:&lt;br /&gt;
&lt;br /&gt;
 apt-get erase vzpkg vzctl-ostmpl-*&lt;br /&gt;
&lt;br /&gt;
and backup &amp;amp; remove your current template directory:&lt;br /&gt;
&lt;br /&gt;
 tar cjf /some/backup/location/old_templates.tbz /vz/template&lt;br /&gt;
 rm -r /vz/template&lt;br /&gt;
&lt;br /&gt;
If this is a '''new''' install, you should probably review the [http://download.openvz.org/doc/OpenVZ-Users-Guide.pdf OpenVZ User's Guide] and the wiki's [[Installation on Debian]] page.  The only way you would vary your installation setups is declining to install the default vzpkg package, and instead using vzpkg2 here.&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Add the deb repositories to your /etc/apt/sources.list:&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
Add the following lines to your /etc/apt/sources.list:&lt;br /&gt;
&lt;br /&gt;
Etch:&lt;br /&gt;
    deb http://repo.opensource-sw.net/debian/ etch openvz&lt;br /&gt;
    deb-src http://repo.opensource-sw.net/debian/ etch openvz&lt;br /&gt;
&lt;br /&gt;
Sarge:&lt;br /&gt;
    deb http://repo.opensource-sw.net/debian/ sarge openvz&lt;br /&gt;
    deb-src http://repo.opensource-sw.net/debian/ sarge openvz&lt;br /&gt;
&lt;br /&gt;
Then do:&lt;br /&gt;
    apt-get update&lt;br /&gt;
    apt-get install pkg-cacher-sa vzpkg2&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Adding New Templates:&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
At the time of writing the OS templates were only available in RPM format.  To be able to install them, install yum:&lt;br /&gt;
&lt;br /&gt;
    apt-get install yum&lt;br /&gt;
   &lt;br /&gt;
Then fetch the templates and install them:&lt;br /&gt;
&lt;br /&gt;
    wget http://repo.opensource-sw.net/centos/5/i386/vztmpl2-centos-0.9.0-1.noarch.rpm &lt;br /&gt;
    wget http://repo.opensource-sw.net/centos/5/i386/vztmpl2-fedora-0.9.0-1.noarch.rpm&lt;br /&gt;
    wget http://repo.opensource-sw.net/centos/5/i386/vztmpl2-debian-0.9.0-1.noarch.rpm&lt;br /&gt;
 &lt;br /&gt;
    rpm -i --nodeps vztmpl2-*.rpm&lt;br /&gt;
&lt;br /&gt;
Then move the templates to where Debian expects them:&lt;br /&gt;
&lt;br /&gt;
    mv /vz/template/* /var/lib/vz/template/&lt;br /&gt;
&lt;br /&gt;
Edit the /var/lib/vz/template/{centos,fedora,debian}/config/vzpkg.conf files as well to reference where Debian expects them.  Change the line:&lt;br /&gt;
    baseurl=file:///vz/template/$OS_NAME/$OS_VER/$OS_ARCH/vz-addons/&lt;br /&gt;
to:&lt;br /&gt;
    baseurl=file:///var/lib/vz/template/$OS_NAME/$OS_VER/$OS_ARCH/vz-addons/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Configure vzpkg2&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
Open /etc/vz/vzpkg.conf in an editor.  Replace 'hostname' with the hostname or IP of the machine you are installing this on for VZPKG_CACHE_HOST, make sure not to use 'localhost', because this name is what OpenVZ Containers will use to access the pkg-cacher daemon:&lt;br /&gt;
&lt;br /&gt;
 VZPKG_CACHE_HOST=hostname:3142&lt;br /&gt;
&lt;br /&gt;
While you are here, review this file to ensure it makes sense for your setup.  In particular, you will probably have to update the VZPKG_DNS line with IP addresses of DNS servers you use.&lt;br /&gt;
&lt;br /&gt;
 VZPKG_DNS=192.168.1.2,192.168.1.3&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Configure pkg-cacher&amp;lt;/u&amp;gt;=====&lt;/div&gt;</summary>
		<author><name>BurnMage</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Install_vzpkg2_and_pkg-cacher&amp;diff=6704</id>
		<title>Install vzpkg2 and pkg-cacher</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Install_vzpkg2_and_pkg-cacher&amp;diff=6704"/>
		<updated>2008-11-20T04:06:44Z</updated>

		<summary type="html">&lt;p&gt;BurnMage: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Introduction ===&lt;br /&gt;
&lt;br /&gt;
Robert Nelson has created a couple new utilities to make managing and updating templates and containers easier, vzpkg2 pkg-cacher.  So far they will create and update a large range of containers, including both 32bit and 64bit of the following:&lt;br /&gt;
    &lt;br /&gt;
* Centos 4 and 5,&lt;br /&gt;
* Fedora 7, 8 and 9,&lt;br /&gt;
* Debian Sarge and Etch,&lt;br /&gt;
* Ubuntu Feisty, Gutsy and Hardy.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Pkg-cacher is a transparent caching proxy daemon optimized for Debian and RPM packages.  It is based on [http://www.nick-andrew.net/projects/apt-cacher/ apt-cacher], available with Debian.  This version has been modified to understand RedHat RPM repositories.  It also adds support for the HTTP Range header and deals correctly with files which have the same name but different content on different distributions or in some cases different versions of the same distribution.&lt;br /&gt;
&lt;br /&gt;
Robert has setup an RPM repository for Fedora and CentOS installs, but when this document was written there were no repositories for Ubuntu or Debian setup yet.&lt;br /&gt;
&lt;br /&gt;
===Installation===&lt;br /&gt;
&lt;br /&gt;
====Remove Old Packages &amp;amp; Templates====&lt;br /&gt;
&lt;br /&gt;
* Backup your existing /vz/template directory and clear it out.&lt;br /&gt;
* Uninstall vzpkg and any vztmpl-* packages.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Centos &amp;amp; Fedora installs:====&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Remove Old Packages&amp;lt;/u&amp;gt;=====&lt;br /&gt;
If this is an '''existing''' install, uninstall your vzpkg and vztmpl-* packages:&lt;br /&gt;
&lt;br /&gt;
 yum remove vzpkg vztmpl-*&lt;br /&gt;
&lt;br /&gt;
and backup &amp;amp; remove your current template directory:&lt;br /&gt;
&lt;br /&gt;
 tar cjf /some/backup/location/old_templates.tbz /vz/template&lt;br /&gt;
 rm -r /vz/template&lt;br /&gt;
&lt;br /&gt;
If this is a '''new''' install, you should probably review the [http://download.openvz.org/doc/OpenVZ-Users-Guide.pdf OpenVZ User's Guide] and the wiki's [[Quick installation]] page.  The only way you would vary your installation setups is declining to install the default vzpkg package, and instead using vzpkg2 here.&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Download the repository file for your OS&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
For CentOS:&lt;br /&gt;
    wget http://repo.opensource-sw.net/ossw_centos.repo -P /etc/yum.repos.d&lt;br /&gt;
&lt;br /&gt;
For Fedora:&lt;br /&gt;
    wget http://repo.opensource-sw.net/ossw_fedora.repo -P /etc/yum.repos.d&lt;br /&gt;
&lt;br /&gt;
You may wish to edit the repository file, perhaps to add a priorities setting.  &lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Install vzpkg2 and pkg-cacher&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
Once the repository is added in /etc/yum.repos.d, you can now install the new vzpkg2 and pkg-cacher from it:&lt;br /&gt;
&lt;br /&gt;
 yum install vzpkg2 vztmpl2-centos vztmpl2-fedora vztmpl2-debian vztmpl2-ubuntu&lt;br /&gt;
 yum install pkg-cacher&lt;br /&gt;
&lt;br /&gt;
Open /etc/vz/vzpkg.conf in an editor.  Replace 'hostname' with the hostname or IP of the machine you are installing this on for VZPKG_CACHE_HOST, make sure not to use 'localhost', because this name is what OpenVZ Containers will use to access the pkg-cacher daemon:&lt;br /&gt;
&lt;br /&gt;
 VZPKG_CACHE_HOST=hostname:3142&lt;br /&gt;
&lt;br /&gt;
While you are here, review this file to ensure it makes sense for your setup.  In particular, you will probably have to update the VZPKG_DNS line with IP addresses of DNS servers you use.&lt;br /&gt;
&lt;br /&gt;
 VZPKG_DNS=192.168.1.2,192.168.1.3&lt;br /&gt;
&lt;br /&gt;
===Source===&lt;br /&gt;
&lt;br /&gt;
The source for the new vzpkg2 and templates is available on http://git.opensource-sw.net.  In order to clone the updated source use the command:&lt;br /&gt;
 git clone http://git.opensource-sw.net/git/vzpkg  &lt;br /&gt;
&lt;br /&gt;
The templates are available using:&lt;br /&gt;
 git clone http://git.opensource-sw.net/git/vztmpl&lt;/div&gt;</summary>
		<author><name>BurnMage</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Install_vzpkg2_and_pkg-cacher&amp;diff=6703</id>
		<title>Install vzpkg2 and pkg-cacher</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Install_vzpkg2_and_pkg-cacher&amp;diff=6703"/>
		<updated>2008-11-20T00:27:16Z</updated>

		<summary type="html">&lt;p&gt;BurnMage: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Introduction ===&lt;br /&gt;
&lt;br /&gt;
Robert Nelson has created a couple new utilities to make managing and updating templates and containers easier, vzpkg2 pkg-cacher.  So far they will create and update a large range of containers, including both 32bit and 64bit of the following:&lt;br /&gt;
    &lt;br /&gt;
* Centos 4 and 5,&lt;br /&gt;
* Fedora 7, 8 and 9,&lt;br /&gt;
* Debian Sarge and Etch,&lt;br /&gt;
* Ubuntu Feisty, Gutsy and Hardy.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Pkg-cacher is a transparent caching proxy daemon optimized for Debian and RPM packages.  It is based on [http://www.nick-andrew.net/projects/apt-cacher/ apt-cacher], available with Debian.  This version has been modified to understand RedHat RPM repositories.  It also adds support for the HTTP Range header and deals correctly with files which have the same name but different content on different distributions or in some cases different versions of the same distribution.&lt;br /&gt;
&lt;br /&gt;
Robert has setup an RPM repository for Fedora and CentOS installs, but when this document was written there were no repositories for Ubuntu or Debian setup yet.&lt;br /&gt;
&lt;br /&gt;
The source for the new vzpkg2 and templates is available on http://git.opensource-sw.net.  In order to clone the updated source use the command:&lt;br /&gt;
 git clone http://git.opensource-sw.net/git/vzpkg  &lt;br /&gt;
&lt;br /&gt;
The templates are available using:&lt;br /&gt;
 git clone http://git.opensource-sw.net/git/vztmpl&lt;br /&gt;
&lt;br /&gt;
===Installation===&lt;br /&gt;
&lt;br /&gt;
====Remove Old Packages &amp;amp; Templates====&lt;br /&gt;
&lt;br /&gt;
* Backup your existing /vz/template directory and clear it out.&lt;br /&gt;
* Uninstall vzpkg and any vztmpl-* packages.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Centos &amp;amp; Fedora installs:====&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Remove Old Packages&amp;lt;/u&amp;gt;=====&lt;br /&gt;
If this is an '''existing''' install, uninstall your vzpkg and vztmpl-* packages:&lt;br /&gt;
&lt;br /&gt;
 yum remove vzpkg vztmpl-*&lt;br /&gt;
&lt;br /&gt;
and backup &amp;amp; remove your current template directory:&lt;br /&gt;
&lt;br /&gt;
 tar cjf /some/backup/location/old_templates.tbz /vz/template&lt;br /&gt;
 rm -r /vz/template&lt;br /&gt;
&lt;br /&gt;
If this is a '''new''' install, you should probably review the [http://download.openvz.org/doc/OpenVZ-Users-Guide.pdf OpenVZ User's Guide] and the wiki's [[Quick installation]] page.  The only way you would vary your installation setups is declining to install the default vzpkg package, and instead using vzpkg2 here.&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Download the repository file for your OS&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
For CentOS:&lt;br /&gt;
    wget http://repo.opensource-sw.net/ossw_centos.repo -P /etc/yum.repos.d&lt;br /&gt;
&lt;br /&gt;
For Fedora:&lt;br /&gt;
    wget http://repo.opensource-sw.net/ossw_fedora.repo -P /etc/yum.repos.d&lt;br /&gt;
&lt;br /&gt;
You may wish to edit the repository file, perhaps to add a priorities setting.  &lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Install vzpkg2 and pkg-cacher&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
Once the repository is added in /etc/yum.repos.d, you can now install the new vzpkg2 and pkg-cacher from it:&lt;br /&gt;
&lt;br /&gt;
 yum install vzpkg2 vztmpl2-centos vztmpl2-fedora vztmpl2-debian vztmpl2-ubuntu&lt;br /&gt;
 yum install pkg-cacher&lt;br /&gt;
&lt;br /&gt;
Open /etc/vz/vzpkg.conf in an editor.  Replace 'hostname' with the hostname or IP of the machine you are installing this on for VZPKG_CACHE_HOST, make sure not to use 'localhost', because this name is what OpenVZ Containers will use to access the pkg-cacher daemon:&lt;br /&gt;
&lt;br /&gt;
 VZPKG_CACHE_HOST=hostname:3142&lt;br /&gt;
&lt;br /&gt;
While you are here, review this file to ensure it makes sense for your setup.  In particular, you will probably have to update the VZPKG_DNS line with IP addresses of DNS servers you use.&lt;br /&gt;
&lt;br /&gt;
 VZPKG_DNS=192.168.1.2,192.168.1.3&lt;/div&gt;</summary>
		<author><name>BurnMage</name></author>
		
	</entry>
</feed>