Skip to content

Install a package and its dependencies from a client machine

What you'll learn:

  • What a machine needs to trust and use your repository: the signing key and one source line
  • How to check the key's fingerprint before you trust it
  • How apt resolves a package and its dependencies from Repod, with the real output
  • How to find those downloads in Repod afterwards
  • What the errors you are most likely to meet mean

Time: ~10 minutes
Prerequisites: A package published in a distribution, with its dependencies (see Import packages, which can bring the dependencies along), and a machine you can run sudo on. This tutorial ran on Ubuntu 22.04 (jammy) and installs jq, a JSON tool that needs two other packages. Use your own package and codename.


What happens, and what does not

The machine talks to Repod's APT repository over plain HTTP, like it would to any Debian or Ubuntu mirror. It does not log in to the Repod web interface, it does not need an API token, and Repod does not connect to it: the machine does not have to be registered in Inventory to install packages. Registering it only adds scans, deployments from the interface and the other fleet features.

Two things make it safe:

  • The repository's metadata is signed. The machine only accepts it if it holds the matching public key, which is why you import the key first.
  • A package that failed a check, or that is waiting for a CVE decision, is not published, so it is not in the index the machine reads and apt cannot see it.

Restricted distributions

If an administrator restricted the distribution you use (see Access control), apt also needs credentials. This tutorial uses an open distribution.

In the commands below, 192.168.56.10:8085 is this instance's APT repository: the Repod host and the APT repository port. The port is 80 by default; here it is 8085 because the web interface already uses 80. Replace both with your own. The machine used here has no other source than Repod, so everything it downloads comes from Repod.

The terminal figures reproduce the real output of that machine; only the progress bars are left out.


Step 1 — Check the key before you trust it

The key is served at /repos/dists/depot.gpg. Fetch it without installing it and print its fingerprints:

curl -fsSL http://192.168.56.10:8085/repos/dists/depot.gpg | gpg --show-keys --fingerprint
pub   rsa4096 2026-05-16 [SCEA] [expires: 2028-05-15]
      EC69 47E6 4F8D F85E 504B  71CC 001F 5C8C 2240 D2BD
uid                      Repod APT Repository <repod@localhost>
...
pub   rsa4096 2026-06-07 [SCEA]
      BE4F 7F94 417F 8F60 12D8  8104 D6F5 4815 6DAA 495B
uid                      DepotRPM <depot@local>

The output is shortened: there is one block per key, because depot.gpg holds every key of the repository's keyring (four here). Compare these fingerprints with the ones in Administration → Paramètres, section Clé GPG du dépôt: the key that signs the repository must appear here, with the same fingerprint. If it does not, stop: you are not talking to your Repod.

Fetching a key over plain HTTP proves nothing by itself. This comparison, made against a page you reached through the web interface, is what makes it trustworthy. See GPG signing keys for how the keys are managed.


Step 2 — Trust the key

curl -fsSL http://192.168.56.10:8085/repos/dists/depot.gpg \
  | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/repod.gpg

gpg --dearmor converts the text key into the binary format apt reads. It prints nothing when it works. Check the file exists:

ls -l /etc/apt/trusted.gpg.d/repod.gpg

Step 3 — Add the source

echo "deb http://192.168.56.10:8085/repos jammy main" \
  | sudo tee /etc/apt/sources.list.d/repod.list

The line has three parts after deb: the repository address, the codename (jammy) and the component (main). The codename must be the distribution the package was published in, and it should match your machine's release. lsb_release -cs prints it.


Step 4 — Update, then look at what apt knows

sudo apt update
apt-cache policy jq
apt-cache depends jq

A terminal: apt update fetching InRelease and Packages from Repod, then apt-cache policy and apt-cache depends for jq

Figure 1 — The index downloaded from Repod (1), the candidate version (2), where it comes from (3) and what jq depends on (4).

  1. InRelease is the signed file: apt checked its signature against the key from Step 2. Packages is the list of what the repository holds. Nothing is installed yet.
  2. Candidate: 1.6-2.1+deb12u1 is the version apt would install. (none) here would mean apt does not see the package.
  3. The last line of the version table is the Repod address: this is where the package would come from.
  4. jq depends on libjq1, and on libc6, which is already on every Ubuntu machine. apt-cache depends only shows the first level: libjq1 itself needs another package, which the next step shows.

Step 5 — Install

sudo apt install -y jq

-y answers yes to the confirmation question, so the figure shows the whole run.

A terminal: apt install listing the additional packages libjq1 and libonig5, downloading the three packages from Repod and setting them up

Figure 2 — The additional packages (1), the total (2), the three downloads from Repod (3) and the setup order (4).

  1. You asked for jq; apt adds libjq1 and libonig5 by itself, because jq needs libjq1 and libjq1 needs libonig5.
  2. Three new packages, 369 kB in total.
  3. The three Get: lines are three downloads from Repod, one per file. The dependencies are downloaded first.
  4. They are also set up first: jq is configured last, once what it needs is in place.

No Get: line?

If apt reports nothing to fetch, the files were already in the machine's cache (/var/cache/apt/archives), for example from an earlier install. sudo apt clean empties it, and the next install downloads again.


Step 6 — Use the package

jq --version
echo '{"paquet":"jq","source":"repod"}' | jq .source
dpkg -l jq libjq1 libonig5 | tail -3

A terminal: jq --version, a jq command extracting a field from a JSON document, and dpkg listing the three installed packages

Figure 3 — The three packages are installed (ii) and jq works.

ii at the start of each line means installed and configured.


Step 7 — Find the downloads in Repod

In the web interface, open Administration → Téléchargements and scroll to Activité récente.

The latest downloads table with the three files jq, libjq1 and libonig5 highlighted, with the client address and the apt user agent

Figure 4 — The three files downloaded in Step 5 (1).

Each file is one line: the file name, the address of your machine, the size and the user agent Debian APT-HTTP, which is apt. The %2b in the names is the + of the version, as it appears in the URL. Top paquets téléchargés, above, counts the three packages too.

The page is refreshed from the web server's log every two minutes, so give it a moment. It counts package files only: the InRelease and Packages files from Step 4 do not appear. See See what your machines really download for how to read the whole page.


Troubleshooting

apt update says NO_PUBKEY

The following signatures couldn't be verified because the public key is not
available: NO_PUBKEY A6B0133D8F8B5581
The machine does not hold the key that signed the repository, or Step 2 was skipped. Run Step 2 again. The identifier in the message is the one of the key's signing subkey, so it differs from the Key ID shown in the settings page: both belong to the same key.

After the error, apt keeps using the previous index and does not update from this repository, so a package published since then stays invisible.

Candidate: (none) or Unable to locate package

apt has no package of that name in the repository you added. Check, in this order: the codename in repod.list is the distribution the package was published in; the package is published and not waiting for a CVE decision (look in Décisions CVE); you ran sudo apt update after adding the source.

apt install says some packages have unmet dependencies

Repod holds the package but not everything it needs, and no other source of the machine provides it. Import the missing dependency into the same distribution (see Import packages), run sudo apt update again, then retry. apt-cache depends names the dependencies to look for.

apt update cannot reach the repository

Check the address and the port from the machine with curl -I http://192.168.56.10:8085/repos/dists/depot.gpg. A timeout points to a firewall or a wrong port. The APT repository port is not the one of the web interface.

The package installs, but is not in the statistics

The page refreshes every two minutes. Also check that the machine did not use its own cache (see the tip in Step 5): a file that was not downloaded is not counted.


Next steps