Install in any folder arch manjaro

Installing Golf without root access (for instance in a home directory of a user) can be helpful if you have no root permissions, or if you just want to test locally before installing Golf on your system.

To install Golf locally without root access, first decide which directory you'd like to install it. It can be any directory you can read/write access to. In this case, we'll use $HOME/.app/golf directory as an example.

Set the Golf root directory:
GG_ROOT="$HOME/.app/golf"

Get wget and tar (some distros don't have it by default; you do need root access for this, or if not, ask your System Administrator to perform these tasks):
sudo pacman -Sy --noconfirm wget tar

Download Golf source code and extract it:
wget "https://github.com/golf-lang/golf/archive/refs/heads/main.tar.gz" -O main.tar.gz
tar xvfz main.tar.gz
cd golf-main

Install dependencies (you do need root access for this, or if not, ask your System Administrator to perform these tasks):
sudo pacman -Sy --noconfirm debugedit
makepkg -s --noconfirm --nobuild --noextract

Then compile the source:
make -j$(nproc) GG_LOCAL=1 DESTDIR="$GG_ROOT"

And install Golf:
make GG_LOCAL=1 DESTDIR="$GG_ROOT" install

In order for the installation to take effect, you must update paths (so executables and other files, such as man pages, are found):
export GG_ROOT="$HOME/.app/golf"
export PATH="$GG_ROOT/usr/bin":$PATH
export C_INCLUDE_PATH="$GG_ROOT/usr/include":$C_INCLUDE_PATH
export MANPATH=$GG_ROOT/usr/share/man/:$MANPATH
mandb

To make these path settings permanent, add the above exports to the end of your $HOME/.bashrc file so it runs when you start a new session (or in any other file you execute before working with Golf).

You've installed Golf!

To test, type in command line:
gg -g

If you see the path you choose for GG_ROOT above, it's working!

A few notes due to the fact that root access isn't used for this Golf installation:

Here's how to uninstall.
See also
Install golf
install-arch-manjaro  
install-debian  
install-fedora-redhat-rocky-alma-centos-amazon-mageia  
install-from-source-arch-manjaro  
install-from-source-debian-ubuntu-raspbian  
install-from-source-fedora-redhat-rocky-alma-centos-amazon-mageia  
install-from-source-opensuse  
install-in-any-folder-arch-manjaro  
install-in-any-folder-debian-ubuntu-raspbian  
install-in-any-folder-fedora-redhat-rocky-alma-centos-amazon-mageia  
install-in-any-folder-opensuse  
install-opensuse  
install-raspbian  
install-ubuntu  
uninstall  
See all
documentation


Copyright (c) 2019-2025 Gliim LLC. All contents on this web site is "AS IS" without warranties or guarantees of any kind.