installation.rst 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  1. .. include:: global.rst.inc
  2. .. _installation:
  3. Installation
  4. ============
  5. |project_name| requires:
  6. * Python_ >= 3.2
  7. * OpenSSL_ >= 1.0.0
  8. * libacl_ (that pulls in libattr_ also)
  9. * liblz4_
  10. * some python dependencies, see install_requires in setup.py
  11. General notes
  12. -------------
  13. You need to do some platform specific preparation steps (to install libraries
  14. and tools) followed by the generic installation of |project_name| itself:
  15. Below, we describe different ways to install |project_name|.
  16. - **dist package** - easy and fast, needs a distribution and platform specific
  17. binary package (for your Linux/*BSD/OS X/... distribution).
  18. - **wheel** - easy and fast, needs a platform specific borgbackup binary wheel,
  19. which matches your platform [OS and CPU]).
  20. - **pypi** - installing a source package from pypi needs more installation steps
  21. and will compile stuff - try this if there is no binary wheel that works for
  22. you.
  23. - **git** - for developers and power users who want to have the latest code or
  24. use revision control (each release is tagged).
  25. **Python 3**: Even though this is not the default Python version on many systems,
  26. it is usually available as an optional install.
  27. Virtualenv_ can be used to build and install |project_name| without affecting
  28. the system Python or requiring root access.
  29. Important:
  30. If you install into a virtual environment, you need to **activate**
  31. the virtual env first (``source borg-env/bin/activate``).
  32. Alternatively, directly run ``borg-env/bin/borg`` (or symlink that into some
  33. directory that is in your PATH so you can just run ``borg``).
  34. Using a virtual environment is optional, but recommended except for the most
  35. simple use cases.
  36. The llfuse_ python package is also required if you wish to mount an
  37. archive as a FUSE filesystem. Only FUSE >= 2.8.0 can support llfuse.
  38. You only need **Cython** to compile the .pyx files to the respective .c files
  39. when using |project_name| code from git. For |project_name| releases, the .c
  40. files will be bundled, so you won't need Cython to install a release.
  41. Platform notes
  42. --------------
  43. FreeBSD: You may need to get a recent enough OpenSSL version from FreeBSD ports.
  44. Mac OS X: You may need to get a recent enough OpenSSL version from homebrew_.
  45. Mac OS X: You need OS X FUSE >= 3.0.
  46. Installation (dist package)
  47. ---------------------------
  48. Some Linux, BSD and OS X distributions might offer a ready-to-use
  49. `borgbackup` package (which can be easily installed in the usual way).
  50. As |project_name| is still relatively new, such a package might be not
  51. available for your system yet. Please ask package maintainers to build a
  52. package or, if you can package / submit it yourself, please help us with
  53. that!
  54. If a package is available, it might be interesting for you to check its version
  55. and compare that to our latest release and review the change log (see links on
  56. our web site).
  57. Debian Jessie / Ubuntu 14.04 preparations (wheel)
  58. -------------------------------------------------
  59. .. parsed-literal::
  60. # Python stuff we need
  61. apt-get install python3 python3-pip
  62. # Libraries we need (fuse is optional)
  63. apt-get install openssl libacl1 liblz4-1 fuse
  64. Installation (wheel)
  65. --------------------
  66. This uses the latest binary wheel release.
  67. .. parsed-literal::
  68. # Check https://github.com/borgbackup/borg/issues/147 for the correct
  69. # platform-specific binary wheel, download and install it:
  70. # system-wide installation, needs sudo/root permissions:
  71. sudo pip install borgbackup.whl
  72. # home directory installation, no sudo/root needed:
  73. pip install --user borgbackup.whl
  74. Debian Jessie / Ubuntu 14.04 preparations (git/pypi)
  75. ----------------------------------------------------
  76. .. parsed-literal::
  77. # Python 3.x (>= 3.2) + Headers, Py Package Installer, VirtualEnv
  78. apt-get install python3 python3-dev python3-pip python-virtualenv
  79. # we need OpenSSL + Headers for Crypto
  80. apt-get install libssl-dev openssl
  81. # ACL support Headers + Library
  82. apt-get install libacl1-dev libacl1
  83. # lz4 super fast compression support Headers + Library
  84. apt-get install liblz4-dev liblz4-1
  85. # if you do not have gcc / make / etc. yet
  86. apt-get install build-essential
  87. # optional: FUSE support - to mount backup archives
  88. # in case you get complaints about permission denied on /etc/fuse.conf:
  89. # on ubuntu this means your user is not in the "fuse" group. just add
  90. # yourself there, log out and log in again.
  91. apt-get install libfuse-dev fuse pkg-config
  92. # optional: for unit testing
  93. apt-get install fakeroot
  94. Korora / Fedora 21 preparations (git/pypi)
  95. ------------------------------------------
  96. .. parsed-literal::
  97. # Python 3.x (>= 3.2) + Headers, Py Package Installer, VirtualEnv
  98. sudo dnf install python3 python3-devel python3-pip python3-virtualenv
  99. # we need OpenSSL + Headers for Crypto
  100. sudo dnf install openssl-devel openssl
  101. # ACL support Headers + Library
  102. sudo dnf install libacl-devel libacl
  103. # lz4 super fast compression support Headers + Library
  104. sudo dnf install lz4-devel
  105. # optional: FUSE support - to mount backup archives
  106. sudo dnf install fuse-devel fuse pkgconfig
  107. # optional: for unit testing
  108. sudo dnf install fakeroot
  109. Cygwin preparations (git/pypi)
  110. ------------------------------
  111. Please note that running under cygwin is rather experimental, stuff has been
  112. tested with CygWin (x86-64) v2.1.0.
  113. You'll need at least (use the cygwin installer to fetch/install these):
  114. ::
  115. python3 python3-setuptools
  116. python3-cython # not needed for releases
  117. binutils gcc-core
  118. libopenssl openssl-devel
  119. liblz4_1 liblz4-devel # from cygwinports.org
  120. git make openssh
  121. You can then install ``pip`` and ``virtualenv``:
  122. ::
  123. easy_install-3.4 pip
  124. pip install virtualenv
  125. And now continue with the generic installation (see below).
  126. In case that creation of the virtual env fails, try deleting this file:
  127. ::
  128. /usr/lib/python3.4/__pycache__/platform.cpython-34.pyc
  129. Installation (pypi)
  130. -------------------
  131. This uses the latest (source package) release from PyPi.
  132. .. parsed-literal::
  133. virtualenv --python=python3 borg-env
  134. source borg-env/bin/activate # always before using!
  135. # install borg + dependencies into virtualenv
  136. pip install 'llfuse<0.41' # optional, for FUSE support
  137. # 0.41 and 0.41.1 have unicode issues at install time
  138. pip install borgbackup
  139. Note: we install into a virtual environment here, but this is not a requirement.
  140. Installation (git)
  141. ------------------
  142. This uses latest, unreleased development code from git.
  143. While we try not to break master, there are no guarantees on anything.
  144. .. parsed-literal::
  145. # get |project_name| from github, install it
  146. git clone |git_url|
  147. virtualenv --python=python3 borg-env
  148. source borg-env/bin/activate # always before using!
  149. # install borg + dependencies into virtualenv
  150. pip install sphinx # optional, to build the docs
  151. pip install 'llfuse<0.41' # optional, for FUSE support
  152. # 0.41 and 0.41.1 have unicode issues at install time
  153. cd borg
  154. pip install -r requirements.d/development.txt
  155. pip install -e . # in-place editable mode
  156. # optional: run all the tests, on all supported Python versions
  157. fakeroot -u tox
  158. Note: as a developer or power user, you always want to use a virtual environment.