Skip to content

Installation guide for Ubuntu/Debian #1018

Open

Description

@AntonVolkovMIR

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

Activity

  1. extrawurst commented on Nov 29, 2021

    @extrawurst
    Collaborator

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

  2. added
    help wanted
    on Nov 29, 2021
  3. extrawurst commented on Dec 1, 2021

    @extrawurst
    Collaborator

    @boydjohnson mentioned interest in working on this: #903 (comment)

  4. modified the milestone: v0.19 on Dec 1, 2021
  5. extrawurst commented on Dec 5, 2021

    @extrawurst
    Collaborator

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

  6. jasonfharris commented on Jan 3, 2022

    @jasonfharris

    +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.

  7. WilliamTambellini commented on Mar 9, 2022

    @WilliamTambellini

    +1

  8. frixaco commented on Apr 19, 2022

    @frixaco

    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
    
  9. lonix1 commented on Apr 20, 2022

    @lonix1

    @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).

  10. stale commented on Oct 20, 2022

    @stale

    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.

  11. added
    dormant
    and removed
    dormant
    on Oct 20, 2022
  12. jewel109 commented on Oct 28, 2022

    @jewel109

    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]

  13. creeloper27 commented on Mar 16, 2023

    @creeloper27

    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

  14. stale commented on Sep 17, 2023

    @stale

    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.

  15. added
    dormant
    on Sep 17, 2023
  16. robozb commented on Sep 19, 2023

    @robozb

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

  17. removed
    dormant
    on Sep 19, 2023
  18. fredngo commented on Oct 7, 2023

    @fredngo

    Not dormant

  19. taikulawo commented on Oct 27, 2023

    @taikulawo

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

  20. nielsbaltodanomatrix commented on Dec 11, 2023

    @nielsbaltodanomatrix

    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

  21. garam-kim1 commented on Apr 19, 2024

    @garam-kim1

    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
    
  22. creeloper27 commented on Apr 20, 2024

    @creeloper27

    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.

  23. montoner0 commented on Jan 3, 2025

    @montoner0

    For those who want to have their own .deb package which could be installed with dpkg

    #!/bin/bash
    
    # Change $(uname -m) to a proper architecture if it doesn't work for you
    ARCHITECTURE=$(uname -m)
    
    url=$(curl -s https://api.github.com/repos/gitui-org/gitui/releases/latest | grep -wo "https.*gitui.*linux.*${ARCHITECTURE}.*gz")
    
    if [[ $url =~ /v(([[:digit:]]+\.){2}[[:digit:]]+)/ ]] ; then
      ver=${BASH_REMATCH[1]}
      pkgarch=$(dpkg --print-architecture)
      pkgdir=gitui-$ver-$pkgarch
      bindir=$pkgdir/usr/local/bin
    
      mkdir -p $bindir
    
      curl -Ls $url | tar xz --one-top-level=$bindir
    
      mkdir -p $pkgdir/DEBIAN
      cat >$pkgdir/DEBIAN/control <<EOL
    Package: gitui
    Version: $ver
    Architecture: $pkgarch
    Maintainer: Foo Bar
    Description: TUI Git client
    EOL
    
      dpkg-deb --build --root-owner-group $pkgdir
    else
      echo No version found in the url $url
      exit 1
    fi
    
    
  24. 0hiru commented on Jun 22, 2025

    @0hiru

    The GitHub repository URL and architecture-specific filenames have changed, so I've updated the script with some improvements of my own.

    Install

    #!/bin/bash
    
    # Simple gitui installation script for Ubuntu
    # Downloads and installs to /usr/local/bin
    
    set -e  # Exit on any error
    
    # Architecture mapping
    MACHINE_ARCH=$(uname -m)
    case $MACHINE_ARCH in
        x86_64)
            GITHUB_ARCH="x86_64"
            ;;
        aarch64|arm64)
            GITHUB_ARCH="aarch64"
            ;;
        armv7l)
            GITHUB_ARCH="armv7"
            ;;
        armv6l|arm)
            GITHUB_ARCH="arm"
            ;;
        *)
            echo "❌ Unsupported architecture: $MACHINE_ARCH"
            echo "Supported: x86_64, aarch64, armv7l, armv6l, arm"
            exit 1
            ;;
    esac
    
    echo "🔍 Architecture: $MACHINE_ARCH -> $GITHUB_ARCH"
    
    # Get download URL
    echo "📡 Fetching latest release..."
    url=$(curl -sL https://api.github.com/repos/gitui-org/gitui/releases/latest | \
          grep -o "https://github.com/gitui-org/gitui/releases/download/.*/gitui-linux-${GITHUB_ARCH}.tar.gz")
    
    if [[ -z "$url" ]]; then
        echo "❌ Could not find download URL for $GITHUB_ARCH"
        exit 1
    fi
    
    echo "📥 Download URL: $url"
    
    # Create temp directory
    TEMP_DIR=$(mktemp -d)
    cd "$TEMP_DIR"
    
    echo "⬇️  Downloading gitui..."
    curl -L "$url" -o gitui.tar.gz
    
    echo "📦 Extracting..."
    tar -xzf gitui.tar.gz
    
    # Verify binary exists
    if [[ ! -f "gitui" ]]; then
        echo "❌ gitui binary not found after extraction"
        exit 1
    fi
    
    # Test binary
    echo "🧪 Testing binary..."
    ./gitui --version
    
    # Check if already installed
    if command -v gitui >/dev/null 2>&1; then
        CURRENT_VERSION=$(gitui --version 2>/dev/null || echo "unknown")
        echo "⚠️  gitui is already installed: $CURRENT_VERSION"
        read -p "Replace with new version? (y/N): " -n 1 -r
        echo
        if [[ ! $REPLY =~ ^[Yy]$ ]]; then
            echo "Installation cancelled"
            rm -rf "$TEMP_DIR"
            exit 0
        fi
    fi
    
    # Install to /usr/local/bin
    echo "📥 Installing to /usr/local/bin..."
    sudo cp gitui /usr/local/bin/
    sudo chmod 755 /usr/local/bin/gitui
    sudo chown root:root /usr/local/bin/gitui
    
    # Cleanup
    cd /
    rm -rf "$TEMP_DIR"
    
    # Verify installation
    echo "✅ Installation complete!"
    echo "📋 Installed version: $(gitui --version)"
    echo "📍 Location: $(which gitui)"
    echo "💡 Usage: Run 'gitui' in any git repository"

    To uninstall:

    sudo rm /usr/local/bin/gitui

    Key changes:

    • Updated repository: extrawurst/gitui → gitui-org/gitui
    • Auto-detect architecture (supports x86_64, aarch64, armv7l, arm)
    • Added error handling and progress feedback
    • Safe installation with existing version check

    Tested on Ubuntu 22.04 LTS with gitui v0.27.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedlinux

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions