Bazaar is implemented in Python, therefore it should work on any system where a supported version of Python is installed (2.4, 2.5, 2.6, or 2.7). The core module of Bazaar consists of bzrlib
, a Python library that implements the core functionality of Bazaar, and bzr
, the command-line interface. Bazaar is highly extensible, and a wide selection of official and unofficial plugins exist enriching its functionality. For the purpose of this book, the most important plugins to include are:
On Windows and Mac OS X, the official installer includes the core module and a good selection of commonly used plugins by default. On GNU/Linux and other systems, the core module and each plugin are packaged separately, and you must install them individually.
Visit the official download page to find the right installer and installation instructions for your system at http://wiki.bazaar.canonical.com/Download.
Here, we explain only the most typical and simple installation options. For more advanced scenarios, please refer to the download page for details.
Most modern
GNU/Linux distributions include Bazaar in their official binary repositories, in the package bzr
. This package typically includes only the core functionality of Bazaar, and plugins are found in separate packages. The most important plugin we will use throughout the book is the Bazaar Explorer plugin, usually in the package bzr-explorer
.
You can discover other plugins with additional functionality in packages starting with bzr-
in their name.
Use your favorite package manager tool, or the following command:
$ sudo apt-get install bzr bzr-explorer
Downloading the example code
You can download the example code files for all Packt books you have purchased from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.
Use your favorite package manager tool, or the following command:
$ sudo yum install bzr bzr-explorer
Use your favorite package manager tool, or the following command:
$ sudo zypper install bzr bzr-explorer
Keep in mind that generally it is recommended to install Bazaar using the official binary repository of your distribution, in order to benefit from the advanced package management features of your operating system, such as automatic security update notifications and software upgrades.
Pip is the next generation Python package management tool. The benefit of using pip to install Bazaar is that it provides the latest stable, and unstable versions of Bazaar, whereas the official binary repository of your operating system may be a bit out of date. If you prefer to have the latest version, then using pip can be a good option. Another potential benefit of using pip is that it allows you to install Bazaar inside your home directory rather than system-wide, thus it makes it possible to install Bazaar even if you don't have administrator rights in a system.
If you don't already have pip, you can install it using the graphical or the command-line package manager of your distribution; for example, in Ubuntu:
$ sudo apt-get install pip
If you don't have administrator rights, another way to install pip is using easy_install
, which is the legacy package manager utility of Python:
$ easy_install --user pip
Once you have pip, you can install Bazaar system-wide to make it available to all users, as follows:
$ sudo pip install bzr bzr-explorer
Or install only for your user (into ~/.local/
), as follows:
$ pip install --user bzr bzr-explorer
To discover other Bazaar plugins with additional functionality, search for packages starting with bzr-
in their name, as follows:
$ pip search bzr-
The download page offers different types of the Bazaar installers, such as standalone or Python-based at http://wiki.bazaar.canonical.com/WindowsDownloads.
The standalone installer includes all the dependencies of Bazaar, most notably a Python interpreter. This installer is about 20 MB in size, and will use between 50 MB to 70 MB disk space on your computer, depending upon the components and plugins you select during installation. If you are not sure which installer to choose, then choose this one.
The Python-based installers assume that you already have a specific version of Python installed. This can be a good option if you want to save disk space. However, these installers do not include some dependencies of Bazaar, and you will have to install them by yourself. See the following documentation for details:
http://wiki.bazaar.canonical.com/BzrWin32Installer#bzr-dependencies
Depending upon the type of installer you choose, there may be different releases of Bazaar available. It is recommended that you pick up the latest stable release.
During installation, you can choose the components to install. The default selection includes the Bazaar Explorer, the documentation, and a good set of additional plugins. You may simply accept the defaults for now. If you want to install additional components later, simply run the installer again:
If you prefer to install Bazaar using Cygwin, you can use the standard Cygwin installer setup.exe
file and look for the package bzr
.
The download
site offers dmg
packages for recent versions of Mac OS X; it is recommended to choose the latest stable release of Bazaar:
http://wiki.bazaar.canonical.com/MacOSXDownloads
At the time of this writing, the latest platform is Snow Leopard; there are no installers specifically for Lion or Mountain Lion. If your Mac OS X is Lion or above, use the Snow Leopard installer.
During installation, you can choose the components to install. By default, all the components and plugins are selected, including the Bazaar Explorer and documentation, which will take up about 50 MB disk space on your computer. If you deselect some components now, you can install them later by running the installer again:
The download page explains more advanced installation options, such as using Homebrew, MacPorts, Fink, or source.
If you want to install Bazaar in a shared hosting environment, where you have shell access, then the easiest way may be using Python package management tools such as pip
or easy_install
.
pip
is the next generation Python package manager. If it is not installed in your shared hosting environment, you can try to install it with easy_install
:
$ easy_install --user pip
Before installing Bazaar itself, it is recommended to install pyrex
and paramiko
:
$ pip install --user pyrex $ pip install --user paramiko
At the time of this writing, when installing Bazaar with pip, it chooses the latest beta release instead of the latest stable release. If that is not what you want, you can specify the version like this:
$ pip install --user bzr==2.5 bzr-explorer
18.118.27.119