If you'd like to use jq on your Debian system without installing it from the Debian repository, there are several alternative methods you can use:
✅ Option 1: Download and Use the Precompiled Binary
This is the most straightforward method.
1. Download the binary
wget https://github.com/jqlang/jq/releases/download/jq-1.6/jq-linux64
You can check for newer versions at https://github.com/jqlang/jq/releases
2. Make it executable:
chmod +x jq-linux64
3. (Optional) Rename and move it to a directory in your PATH:
sudo mv jq-linux64 /usr/local/bin/jq
Now you can run:
jq --version
Which should output something like:
jq-1.6
✅ Option 2: Install Using go install (if Go is installed)
If you have Go installed, you can build jq from source using Go.
1. Install with go:
go install github.com/jqlang/jq@latest
2. Add $GOPATH/bin to your PATH if not already set:
export PATH=$PATH:$(go env GOPATH)/bin
Or add that line to your shell config file (~/.bashrc, ~/.zshrc, etc.)
Now run:
jq --version
✅ Option 3: Build from Source (Advanced)
If you prefer full control or need customizations.
1. Install dependencies:
sudo apt-get update
sudo apt-get install -y libonig-dev autoconf automake libtool
2. Clone the repo:
git clone https://github.com/jqlang/jq.git
cd jq
3. Bootstrap and configure:
autoreconf -i
./configure
4. Build:
make
5. Install locally or copy binary:
sudo make install
Or just use the built binary directly:
./jq --version
Summary
| Method | Description | Notes |
|---|
| 📥 Precompiled Binary | Fast and easy | Recommended |
🛠️ go install | Requires Go installed | Good for developers |
| 🧱 Build from Source | Full control | More complex |
Let me know which method you're comfortable with, or I can guide you through one step-by-step.