# Debian / Ubuntu

This guide covers repository-based installation on Debian, Ubuntu, and derivatives (such as Linux Mint).

## Prerequisites

* Linux kernel 4.18+ (for eBPF support)
* Root or sudo access
* Outbound HTTPS access to `packages.linuxguard.io`

> **Note**: See [Prerequisites](/how-to-guides/how-to/prerequisites.md) for full system requirements.

## Repository Setup

The recommended installation method uses the official LinuxGuard APT repository. This ensures you receive automatic updates and can easily manage the agent through your package manager.

### Step 1: Install Prerequisites

Install required packages for repository configuration:

```bash
sudo apt install curl ca-certificates gnupg
```

### Step 2: Import GPG Key

Create the keyrings directory and import the LinuxGuard signing key:

```bash
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://packages.linuxguard.io/gpg/linuxguard.asc | \
  sudo gpg --dearmor -o /etc/apt/keyrings/linuxguard.gpg
```

### Step 3: Add Repository

Add the LinuxGuard repository to your system:

```bash
echo "deb [signed-by=/etc/apt/keyrings/linuxguard.gpg arch=$(dpkg --print-architecture)] \
  https://packages.linuxguard.io/apt stable main" | \
  sudo tee /etc/apt/sources.list.d/linuxguard.list
```

### Step 4: Install Agent

Update the package index and install the agent:

```bash
sudo apt update
sudo apt install linuxguard-agent
```

The agent service will be installed but not started until enrollment.

## Direct Download

If repository setup is not possible, you can download and install the package directly:

```bash
curl -fsSL -o linuxguard-agent.deb \
  https://packages.linuxguard.io/apt/pool/linuxguard-agent_latest_$(dpkg --print-architecture).deb
sudo dpkg -i linuxguard-agent.deb
```

## Verification

After installation, verify the agent is correctly installed:

### Check Agent Binary

Confirm the agent binary is in your PATH:

```bash
which linuxguard-agent
```

Expected output:

```
/usr/bin/linuxguard-agent
```

### Verify Agent User

Confirm the agent user and group were created:

```bash
id linuxguard
```

Expected output:

```
uid=999(linuxguard) gid=999(linuxguard) groups=999(linuxguard)
```

> **Note**: The UID/GID numbers may vary depending on your system.

### Check Service Status

Verify the agent service is installed:

```bash
sudo systemctl status linuxguard-agent
```

Expected output:

```
○ linuxguard-agent.service - LinuxGuard Security Agent
     Loaded: loaded (/lib/systemd/system/linuxguard-agent.service; disabled; preset: enabled)
     Active: inactive (dead)
```

The service is inactive until you complete enrollment.

## Troubleshooting

### Repository Not Found

If `apt update` fails to find the LinuxGuard repository, verify the repository file exists:

```bash
cat /etc/apt/sources.list.d/linuxguard.list
```

The file should contain the repository configuration with the correct architecture.

### GPG Key Errors

If you encounter GPG signature verification errors, verify the key was imported correctly:

```bash
ls -l /etc/apt/keyrings/linuxguard.gpg
```

If the file is missing, repeat Step 2 of the repository setup.

### Package Conflicts

If installation fails due to conflicting packages, check for unofficial or third-party LinuxGuard packages:

```bash
apt list --installed | grep linuxguard
```

Remove any unofficial packages before installing from the official repository.

> **Note**: See the [Troubleshooting Guide](/troubleshooting.md) for additional help.

***

**Next Step**: [Configuration →](/how-to-guides/how-to/configuration.md)

**Related**: [Installation Overview](/how-to-guides/how-to/installation.md) | [Prerequisites](/how-to-guides/how-to/prerequisites.md) | [Troubleshooting](/troubleshooting.md)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.linuxguard.io/how-to-guides/how-to/installation/debian-ubuntu.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
