extrawurst / gitui

Blazing 💥 fast terminal-ui for git written in rust 🦀
MIT License
18.48k stars 569 forks source link

Installation guide for Ubuntu/Debian #1018

Open AntonVolkovMIR opened 2 years ago

AntonVolkovMIR commented 2 years ago

Please add the way of how to install your software on Debian or Ubuntu:

  1. Create .deb package
  2. Host it to the apt package manager.
  3. Add the installation step for Ubuntu from apt package management. Like for fedora:

Ubuntu

 sudo apt install gitui
extrawurst commented 2 years ago

I am no Linux user. Need help here and please review #903 aswell

extrawurst commented 2 years ago

@boydjohnson mentioned interest in working on this: https://github.com/extrawurst/gitui/pull/903#issuecomment-983550822

extrawurst commented 2 years ago

Does https://github.com/sassman/rust-deb-builder help anyhow? It seems desirable to have deb files in releases (see CD.yml).

jasonfharris commented 2 years ago

+1 for the feature request. Actually I would say installation on all platforms should likely be as easy as a shell command. Eg starship and brew are installed via:

sh -c "$(curl -fsSL https://starship.rs/install.sh)"
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

If this calls through to apt or dnf or other package managers that is fine but having a simple up to date install is nice.

WilliamTambellini commented 2 years ago

+1

frixaco commented 2 years ago

As a temporary solution, here's an install script for Ubuntu (installed at /usr/local/bin):

curl -s curl -s https://api.github.com/repos/extrawurst/gitui/releases/latest | grep -wo "https.*linux.*gz" | wget -qi -
tar xzvf gitui-linux-musl.tar.gz
rm gitui-linux-musl.tar.gz
sudo chmod +x gitui
sudo mv gitui /usr/local/bin
gitui
lonix1 commented 2 years ago

@frixaco Thank you, that works.

@extrawurst I see the docs already have entries for other distributions - maybe his script can be added there, for now (until gitui is in the ubuntu/debian package repo, or there is an official PPA).

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had any activity half a year. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.

jewel109 commented 1 year ago

As a temporary solution, here's an install script for Ubuntu (installed at /usr/local/bin):

curl -s curl -s https://api.github.com/repos/extrawurst/gitui/releases/latest | grep -wo "https.*linux.*gz" | wget -qi -
tar xzvf gitui-linux-musl.tar.gz
rm gitui-linux-musl.tar.gz
sudo chmod +x gitui
sudo mv gitui /usr/local/bin
gitui

This script showing me this . could u help please!

invalid path
please run gitui inside of a non-bare git repository

PS: I have solved . Ectually I have runned gitui from a repository having no git initialized. so that's happen. [now inner me is lauging . what a silly mistake i have done]

creeloper27 commented 1 year ago

As a temporary solution, here's an install script for Ubuntu (installed at /usr/local/bin):

curl -s curl -s https://api.github.com/repos/extrawurst/gitui/releases/latest | grep -wo "https.*linux.*gz" | wget -qi -
tar xzvf gitui-linux-musl.tar.gz
rm gitui-linux-musl.tar.gz
sudo chmod +x gitui
sudo mv gitui /usr/local/bin
gitui

This script has 3 minor flaws, it doesn't give ownership of the file to root and leaves behind the gitui-linux-aarch64.tar.gz, gitui-linux-arm.tar.gz and gitui-linux-armv7.tar.gz files, it also downloads the builds for all unnecessary architectures, here is an improved version that (from my testing on my local machine at least) fixes all these problems (plus a few tweaks and comments) (this is still missing some basic logging, checks and is not as efficent and as well written as it could be):

ARCHITECTURE=musl # set the desired build architecture in a environment variable
# "musl" in this case seems to be for the x86-64 (also known as x64, x86_64, AMD64 and Intel 64) architecture)
# If you need the build for another architecture you can swap "musl" with "aarch64", "arm" or "armv7", you can run "/bin/uname -i" to see what architecture your system is using
/bin/curl -s /bin/curl -s https://api.github.com/repos/extrawurst/gitui/releases/latest | /bin/grep -wo "https.*gitui.*linux.*${ARCHITECTURE}.*gz" | /bin/wget -qi - # get the latest builds of gitui (they are archives) (using a regex)
/bin/find . -maxdepth 1 -name "gitui*linux*${ARCHITECTURE}*gz" -exec /bin/tar xzvf {} \;; # find the downloaded build archive exact name and extract everything from it (including the gitui executable) (using a wildcard)
/bin/sudo /bin/chown root:root gitui # set ownership and group ownership of the gitui executable to root
/bin/sudo /bin/chmod u=rwx,g=rx,o=rx gitui # set the permission of the gitui executable to reflect the usual permissions in /usr/local/bin/ (-rwxr-xr-x)
/bin/sudo /bin/mv gitui /usr/local/bin/ # move the gitui executable to /usr/local/bin/
/bin/find . -maxdepth 1 -name "gitui*linux*${ARCHITECTURE}*gz" -exec /bin/rm {} \;; # find the downloaded build archive exact name and remove it (using a wildcard)
/bin/rm gitui 2> /dev/null # rm the gitui executable if something went wrong and is still present in the current directory (and also sopress the output of "rm" if the file is not found because everything worked properly)

In alternative you can also use this shortened and compressed version that also has a few checks:

ARCHITECTURE=musl; /bin/curl -s /bin/curl -s https://api.github.com/repos/extrawurst/gitui/releases/latest | /bin/grep -wo "https.*gitui.*linux.*${ARCHITECTURE}.*gz" | /bin/wget -qi - && /bin/find . -maxdepth 1 -name "gitui*linux*${ARCHITECTURE}*gz" -exec /bin/tar xzvf {} \;; /bin/sudo /bin/chown root:root gitui && /bin/sudo /bin/chmod u=rwx,g=rx,o=rx gitui && /bin/sudo /bin/mv gitui /usr/local/bin/; /bin/find . -maxdepth 1 -name "gitui*linux*${ARCHITECTURE}*gz" -exec /bin/rm {} \;; /bin/rm gitui 2> /dev/null

Then you can call gitui while inside a git repository in your favourite shell. Remember to run this script (or the one liner alternative) again to update gitui in the future.

As a better temporary alternative someone could write a simple wrapper that auto updates gitui every time it's called, if someone wants to do that and/or improve on this script that would be wholesome :D

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had any activity half a year. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.

robozb commented 1 year ago

very sad there isn't a repo for debians of gitui :(

fredngo commented 1 year ago

Not dormant

taikulawo commented 1 year ago

I think debian/ubuntu has most users but there no debian/ubuntu installation guide

nielsbaltodanomatrix commented 10 months ago

As a temporary solution, here's an install script for Ubuntu (installed at /usr/local/bin):

curl -s curl -s https://api.github.com/repos/extrawurst/gitui/releases/latest | grep -wo "https.*linux.*gz" | wget -qi -
tar xzvf gitui-linux-musl.tar.gz
rm gitui-linux-musl.tar.gz
sudo chmod +x gitui
sudo mv gitui /usr/local/bin
gitui

This script has 3 minor flaws, it doesn't give ownership of the file to root and leaves behind the gitui-linux-aarch64.tar.gz, gitui-linux-arm.tar.gz and gitui-linux-armv7.tar.gz files, it also downloads the builds for all unnecessary architectures, here is an improved version that (from my testing on my local machine at least) fixes all these problems (plus a few tweaks and comments) (this is still missing some basic logging, checks and is not as efficent and as well written as it could be):

ARCHITECTURE=musl # set the desired build architecture in a environment variable
# "musl" in this case seems to be for the x86-64 (also known as x64, x86_64, AMD64 and Intel 64) architecture)
# If you need the build for another architecture you can swap "musl" with "aarch64", "arm" or "armv7", you can run "/bin/uname -i" to see what architecture your system is using
/bin/curl -s /bin/curl -s https://api.github.com/repos/extrawurst/gitui/releases/latest | /bin/grep -wo "https.*gitui.*linux.*${ARCHITECTURE}.*gz" | /bin/wget -qi - # get the latest builds of gitui (they are archives) (using a regex)
/bin/find . -maxdepth 1 -name "gitui*linux*${ARCHITECTURE}*gz" -exec /bin/tar xzvf {} \;; # find the downloaded build archive exact name and extract everything from it (including the gitui executable) (using a wildcard)
/bin/sudo /bin/chown root:root gitui # set ownership and group ownership of the gitui executable to root
/bin/sudo /bin/chmod u=rwx,g=rx,o=rx gitui # set the permission of the gitui executable to reflect the usual permissions in /usr/local/bin/ (-rwxr-xr-x)
/bin/sudo /bin/mv gitui /usr/local/bin/ # move the gitui executable to /usr/local/bin/
/bin/find . -maxdepth 1 -name "gitui*linux*${ARCHITECTURE}*gz" -exec /bin/rm {} \;; # find the downloaded build archive exact name and remove it (using a wildcard)
/bin/rm gitui 2> /dev/null # rm the gitui executable if something went wrong and is still present in the current directory (and also sopress the output of "rm" if the file is not found because everything worked properly)

In alternative you can also use this shortened and compressed version that also has a few checks:

ARCHITECTURE=musl; /bin/curl -s /bin/curl -s https://api.github.com/repos/extrawurst/gitui/releases/latest | /bin/grep -wo "https.*gitui.*linux.*${ARCHITECTURE}.*gz" | /bin/wget -qi - && /bin/find . -maxdepth 1 -name "gitui*linux*${ARCHITECTURE}*gz" -exec /bin/tar xzvf {} \;; /bin/sudo /bin/chown root:root gitui && /bin/sudo /bin/chmod u=rwx,g=rx,o=rx gitui && /bin/sudo /bin/mv gitui /usr/local/bin/; /bin/find . -maxdepth 1 -name "gitui*linux*${ARCHITECTURE}*gz" -exec /bin/rm {} \;; /bin/rm gitui 2> /dev/null

Then you can call gitui while inside a git repository in your favourite shell. Remember to run this script (or the one liner alternative) again to update gitui in the future.

As a better temporary alternative someone could write a simple wrapper that auto updates gitui every time it's called, if someone wants to do that and/or improve on this script that would be wholesome :D

works in wsl ubuntu 22.04

garam-kim1 commented 6 months ago

Got error and I changed to :

ARCHITECTURE=$(uname -m); curl -s https://api.github.com/repos/extrawurst/gitui/releases/latest | grep -wo "https://github.com/extrawurst/gitui/releases/download/v[0-9]*\.[0-9]*\.[0-9]*/gitui-linux-${ARCHITECTURE}.tar.gz" | wget -qi - && find . -maxdepth 1 -name "gitui*linux*${ARCHITECTURE}*gz" -exec tar xzvf {} \;; sudo chown root:root gitui && sudo chmod u=rwx,g=rx,o=rx gitui && sudo mv gitui /usr/local/bin/; find . -maxdepth 1 -name "gitui*linux*${ARCHITECTURE}*gz" -exec rm {} \;; rm gitui 2> /dev/null
creeloper27 commented 6 months ago

Got error and I changed to :

ARCHITECTURE=$(uname -m); curl -s https://api.github.com/repos/extrawurst/gitui/releases/latest | grep -wo "https://github.com/extrawurst/gitui/releases/download/v[0-9]*\.[0-9]*\.[0-9]*/gitui-linux-${ARCHITECTURE}.tar.gz" | wget -qi - && find . -maxdepth 1 -name "gitui*linux*${ARCHITECTURE}*gz" -exec tar xzvf {} \;; sudo chown root:root gitui && sudo chmod u=rwx,g=rx,o=rx gitui && sudo mv gitui /usr/local/bin/; find . -maxdepth 1 -name "gitui*linux*${ARCHITECTURE}*gz" -exec rm {} \;; rm gitui 2> /dev/null

I'm guessing that $(uname -m) is evaluating to x86_64 which is not a valid architecture in this case, as I mentioned in my original comment:

# "musl" in this case seems to be for the x86-64 (also known as x64, x86_64, AMD64 and Intel 64) architecture)`

You need to swap $(uname -m) for musl, the end result should look like this: ARCHITECTURE=musl;

Idealy my original script could get updated to use $(uname -m) to automatically detect the system architecture and swap it for the appropriate corrisponding name.