installation.rst 7.9 KB

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