Jump to content

Installing pmbootstrap: Difference between revisions

From postmarketOS Wiki
No edit summary
add requirements
Line 1: Line 1:
== Requirements ==
* <code>python</code> >=3.4
* Depending on the installation method:
** <code>pip3</code> (possibly shipped with Python)
** <code>git</code>
Alpine Linux users also need to install <code>coreutils</code> and <code>procps</code>:
<syntaxhighlight lang="shell-session">
$ apk add python3 coreutils procps
</syntaxhighlight>
== Installing automatically ==
== Installing automatically ==
=== Latest release with pip ===
=== Latest release with pip ===
Line 18: Line 29:
</syntaxhighlight>
</syntaxhighlight>


== Installing Manually ==
== Installing manually ==
==== Download pmbootstrap ====
==== Download pmbootstrap ====
<syntaxhighlight lang="shell-session">
<syntaxhighlight lang="shell-session">

Revision as of 13:14, 27 February 2019

Requirements

  • python >=3.4
  • Depending on the installation method:
    • pip3 (possibly shipped with Python)
    • git

Alpine Linux users also need to install coreutils and procps:

$ apk add python3 coreutils procps

Installing automatically

Latest release with pip

pmbootstrap is up on pypi now, so it can be installed with:

$ pip3 install --user pmbootstrap

That's it. The steps below are for alternative methods of installing pmbootstrap. Read on at #Tab completion if you are interested.

Latest development version from git

Download pmbootstrap

$ git clone https://gitlab.com/postmarketOS/pmbootstrap.git

Install

$ python3 "$PWD/pmbootstrap/setup.py" install

Installing manually

Download pmbootstrap

$ git clone https://gitlab.com/postmarketOS/pmbootstrap.git

Create a link

If the directory ~/.local/bin does not already exist, create it with:

$ mkdir --parents ~/.local/bin

Create a symbolic link in ~/.local/bin named pmbootstrap:

$ ln -s "$PWD/pmbootstrap/pmbootstrap.py" ~/.local/bin/pmbootstrap

Test installation

To test that pmbootstrap is installed correctly, open a new terminal and run:

$ pmbootstrap --version

If this returns something like pmbootstrap: command not found instead of a version number, ensure that the following lines are in ~/.profile (zsh: ~/.zprofile):

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/.local/bin" ] ; then
    PATH="$HOME/.local/bin:$PATH"
fi

Then open a new terminal and try again.

Tab completion

Note Make sure you have created and tested the symlink as described above!

Tab completion is an optional feature that saves you time by automatically filling in the rest of a command when you press the tab key. You can also see a list of possible commands by double pressing the tab key.

Install argcomplete with:

$ pip3 install --user argcomplete

Next, do one of the following depending on the shell you use.

Bash

Add the following line to ~/.bashrc:

eval "$(register-python-argcomplete pmbootstrap)"

Then reload your configuration by opening a new terminal or by running source ~/.bashrc.

Zsh

Add the following lines to ~/.zshrc:

autoload bashcompinit
bashcompinit
eval "$(register-python-argcomplete pmbootstrap)"

Then reload your configuration by opening a new terminal or by running source ~/.zshrc.

See also

  • !1656 implement bash tab completion