Skip to content

Point a machine at your repository with the Client setup page

What you'll learn:

  • What the Configuration client page gives you, and what it does not do
  • How to connect a Debian/Ubuntu machine, and what the errors you are most likely to meet mean
  • How to connect an RPM machine (AlmaLinux, Rocky, Fedora…), and what its signature settings protect
  • What Isolation réseau really changes on a machine, and the two precautions to take before you run it
  • What the other tabs and the other package formats are for

Time: ~30 minutes
Prerequisites: A distribution that holds at least one package, see Upload a package in the interface or Bring a package from the internet, and a machine you can run sudo on. This tutorial ran the commands in fresh Ubuntu 22.04 and AlmaLinux 9 containers against this instance. Use your own distribution.


What does this page do?

Clients → Configuration client writes the commands that connect a machine to your repository, with your server's address already filled in. You copy them, run them on the machine, and apt, dnf or apk then install from Repod.

It changes nothing on Repod and nothing on a machine by itself: it only displays text. To follow what a machine installs, register it, see Add your first machine. To install the packages in the first place, see Install a package and its dependencies from a client machine.

The Client setup page for Ubuntu 22.04: the distribution menu, the three tabs, the command that imports the key and the command that adds the source

Figure 1 — The distribution (1), the tabs (2), the key import (3) and the source line (4).

  1. Distribution cible decides everything: the format (shown at the top right: DEB, RPM, APK) and the codename written into the commands. Pick the one the machine runs, not the one you would like it to run.
  2. The tabs are 1. Connexion au dépôt, 2. Isolation réseau and 3. Mises à jour automatiques. Alpine has only the first.
  3. Step 1 imports the key that signs the repository.
  4. Step 2 declares the repository as a source. The address ends in the port of the repository, not the port of the web interface.

Step 1 — Connect a Debian or Ubuntu machine

Choose your distribution, then run the commands of the Connexion au dépôt tab in order:

  1. The key: curl … depot.gpg | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/depot-interne.gpg
  2. The source: a line deb [signed-by=…] http://<host>:<port>/repos <codename> main written to /etc/apt/sources.list.d/depot-interne.list
  3. sudo apt update, then sudo apt install <package>

To check the result, apt-cache policy | grep <host> must print the repository with its priority.

Do I have to check the key first?

The page does not, and it should matter to you: a key fetched over plain HTTP proves nothing by itself. Install a package and its dependencies from a client machine shows how to compare the fingerprint with the one in Administration → Paramètres before you trust it.

Why does step 1 say command not found?

A minimal image (a container, a cloud template) has neither curl nor gpg. The first command then fails with gpg: command not found and nothing is imported. Install them first, from whatever source the machine still has:

sudo apt install -y curl gnupg ca-certificates

Do this before the isolation of Step 3: once only Repod remains, you can only install what Repod holds.

What do the errors mean?

These are the real messages, produced on purpose:

apt update says Cause and fix
NO_PUBKEY … / The repository … is not signed The key is not imported. Run step 1 again, and check that the signed-by= path in the source line is the file you created
404 Not Found / does not have a Release file The codename does not exist in Repod (a typo, or a distribution never created). Check Distributions
No error, but apt install finds nothing The codename exists but holds no package yet. Import or upload one, see the prerequisites
Certificate verification failed: The certificate is NOT trusted The source line points to the web interface (port 80 redirected to HTTPS, with a self-signed certificate). Use the port of the repository shown on the page
E: Package '…' has no installation candidate The package is not in Repod. A machine that uses only Repod only sees what you published, see Step 3

Step 2 — Connect an RPM machine

Choose an RPM distribution (AlmaLinux, Rocky, Oracle Linux, CentOS Stream, Fedora, or openSUSE for Zypper).

The Client setup page for AlmaLinux 9: the .repo file with its baseurl, the signature settings and the key address

Figure 2 — The distribution (1), the repository address (2), the signature settings (3) and the key (4).

The file /etc/yum.repos.d/depot-interne.repo has four settings that matter:

Line Meaning
baseurl=http://<host>:8080/<codename>/x86_64/ The RPM repository. It is served in plain HTTP on its own port, never HTTPS
gpgcheck=0 dnf does not check the signature of each package
repo_gpgcheck=1 dnf does check the signature of the repository metadata (the package list)
gpgkey=http://<host>:<port>/repos/dists/depot.gpg The key that signs that metadata, the same file as for APT

Why is gpgcheck at 0?

The .rpm files in your repository keep the signature of their publisher (AlmaLinux, Docker…), not Repod's. Checking them with Repod's key would fail. Repod signs the list of packages, and repo_gpgcheck=1 makes sure that list was not altered. To also check each package, add the publishers' keys to gpgkey= and set gpgcheck=1.

Then sudo dnf clean all and sudo dnf install <package>. On the first run dnf asks to import the keys: the file holds every key of the repository's keyring (four here), so you see four prompts.

dnf repolist does not prove the address is right

dnf repolist only lists the repositories declared: it does not contact the server. A wrong address shows up on the next dnf list available or dnf install. Test with one of these.

On older versions of Repod the page wrote https:// in this address behind an HTTPS interface, and dnf failed with SSL connect error … wrong version number. If you copied such a file, change https to http.


Step 3 — Understand what "Isolation réseau" does

The second tab turns a machine that may use Repod into one that can only use Repod: it disables the public sources, then blocks the public repositories in the firewall.

The Isolation réseau tab: a red warning, then the first step with its command that disables the public sources

Figure 3 — The warning (1), the step title (2) and the command (3).

Why would I do that?

So that nobody, by habit or by mistake, installs a package that skipped your checks. A package that did not go through Repod has not been scanned and has no decision.

What changes, and what to check first

  1. The public sources are disabled. sources.list and every other .list or .sources file become <name>.backup. They are moved, not deleted, so you can undo it by renaming them. Third-party sources (Docker, a vendor) go too: if the machine depends on them, import those packages into Repod first.
  2. The firewall blocks the public mirrors (UFW, or iptables). Rules are written with host names, resolved once to addresses: a mirror that changes address is not blocked any more. Treat this as a second barrier, not the only one, as the page says: a network firewall is the right place.
  3. The machine can only install what Repod holds. apt install nano works because nano was imported; apt install cowsay fails with no installation candidate. Import what the machine needs before you isolate it.

Do not lock yourself out

The script enables UFW. If SSH is not allowed, new SSH connections are refused and you lose access to a remote machine. The commands on the page now run sudo ufw allow OpenSSH first. If you use an older copy, add it yourself, and keep a console or a second session open the first time.

How do I check it worked?

Step 4 of the tab: the public mirror must refuse (Connection refused or timed out) and curl http://<host>:<port>/repos/dists/depot.gpg must answer 200 OK. apt-cache policy must list only Repod.


Step 4 — The other tabs and the other formats

  • 3. Mises à jour automatiques configures unattended-upgrades (APT) or dnf-automatic (RPM) so the machine applies updates from Repod only. Run the dry-run command the tab gives (unattended-upgrades --dry-run --debug) before you let it apply anything, and read the log it prints. This tutorial did not run this tab: check the result on a test machine first.
  • Alpine (apk): one tab, the command that imports the key signing the index, then the repository line to add to /etc/apk/repositories, with a Dockerfile example.
  • openSUSE (zypper): the page uses --no-gpgcheck.
  • Maven, PyPI and npm are not in this page: they are build tools, not machines. The blue banner links to Dépôts applicatifs → Connexion, see First Maven, npm and PyPI package.

Troubleshooting

Symptom Cause and fix
The commands show localhost or the wrong port The page derives the address from the one you used in the browser, with the default ports 80 (APT) and 8080 (RPM). If your ports differ, an administrator must set REACT_APP_REPO_URL and REACT_APP_RPM_REPO_URL when the interface is built
The machine cannot reach the repository Test from it: curl -I http://<host>:<port>/repos/dists/depot.gpg. A firewall or a different network between the two is the usual cause
apt asks for a user name and password The distribution is restricted, see Manage users, roles and groups
A package is on the page Paquets but the machine does not see it Its status is not published (en révision, quarantaine…), see Find, inspect and manage the packages in your repository

What you've accomplished

You can connect a Debian, Ubuntu or RPM machine to your repository, read the errors apt and dnf give when something is wrong, tell what the signature settings protect, and isolate a machine without locking yourself out.

Next steps