Difference between revisions of "Installing pmbootstrap"
HenriDellal (talk | contribs) (Useless edit that adds conplexity) |
|||
Line 17: | Line 17: | ||
== Installing automatically == | == Installing automatically == | ||
− | === | + | === Latest release with pip === |
pmbootstrap is up on [https://pypi.org/project/pmbootstrap/ pypi] now, so it can be installed with: | pmbootstrap is up on [https://pypi.org/project/pmbootstrap/ pypi] now, so it can be installed with: | ||
<syntaxhighlight lang="shell-session"> | <syntaxhighlight lang="shell-session"> | ||
Line 35: | Line 35: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | === | + | === Latest development version from git === |
==== Download pmbootstrap ==== | ==== Download pmbootstrap ==== | ||
<syntaxhighlight lang="shell-session"> | <syntaxhighlight lang="shell-session"> | ||
Line 82: | Line 82: | ||
== Tab completion == | == Tab completion == | ||
− | |||
[https://en.wikipedia.org/wiki/Command-line_completion 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. | [https://en.wikipedia.org/wiki/Command-line_completion 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. | ||
Revision as of 16:52, 20 December 2020
apk add pmbootstrap
)!Contents
Requirements
python
>=3.6openssl
or alternative(likelibressl
)- 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
pmaports.git
pmbootstrap will automatically clone the pmaports.git repository during pmbootstrap init
to the work dir of your choice, and afterwards you can look up the full path with pmbootstrap config aports
. See git workflow for more information.
Installing automatically
Latest release with pip
pmbootstrap is up on pypi now, so it can be installed with:
$ pip3 install --user pmbootstrap
You may need to reload your configuration by running source ~/.profile
.
That's it. The steps below are for alternative methods of installing pmbootstrap
. Read on at #Tab completion if you are interested.
Updating
Updating to the latest version of pmbootstrap can be done like this:
$ pip3 install --user --upgrade pmbootstrap
Latest development version from git
Download pmbootstrap
$ git clone https://gitlab.com/postmarketOS/pmbootstrap.git
Install
$ cd pmbootstrap && python3 setup.py install
Installing manually
This setup is useful for hacking on pmbootstrap code, because you are directly running the code from your git tree. No need to run setup.py after each change.
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 -p ~/.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
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
Alternatively you can use your distro package manager to install argcomplete
, for example in Ubuntu:
$ sudo apt install python-argcomplete
in Gentoo:
$ sudo emerge dev-python/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