<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://tech.uvoo.io/index.php?action=history&amp;feed=atom&amp;title=Repo_debian</id>
	<title>Repo debian - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://tech.uvoo.io/index.php?action=history&amp;feed=atom&amp;title=Repo_debian"/>
	<link rel="alternate" type="text/html" href="https://tech.uvoo.io/index.php?title=Repo_debian&amp;action=history"/>
	<updated>2026-05-10T16:54:47Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.2</generator>
	<entry>
		<id>https://tech.uvoo.io/index.php?title=Repo_debian&amp;diff=5636&amp;oldid=prev</id>
		<title>Busk: Created page with &quot;To resolve the &quot;repository is not signed&quot; error, you need to generate a GPG key, use it to sign your repository's `Release` file, and then add the public key to your host's tr...&quot;</title>
		<link rel="alternate" type="text/html" href="https://tech.uvoo.io/index.php?title=Repo_debian&amp;diff=5636&amp;oldid=prev"/>
		<updated>2025-08-24T18:42:29Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;To resolve the &amp;quot;repository is not signed&amp;quot; error, you need to generate a GPG key, use it to sign your repository&amp;#039;s `Release` file, and then add the public key to your host&amp;#039;s tr...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;To resolve the &amp;quot;repository is not signed&amp;quot; error, you need to generate a GPG key, use it to sign your repository's `Release` file, and then add the public key to your host's trusted keys.&lt;br /&gt;
&lt;br /&gt;
Here’s the step-by-step process.&lt;br /&gt;
&lt;br /&gt;
-----&lt;br /&gt;
&lt;br /&gt;
### 1\. Generate a GPG Key&lt;br /&gt;
&lt;br /&gt;
First, generate a GPG key pair on the machine where you build the repository. This key will be used for signing.&lt;br /&gt;
&lt;br /&gt;
1.  Run the key generation command:&lt;br /&gt;
&lt;br /&gt;
    ```bash&lt;br /&gt;
    gpg --full-generate-key&lt;br /&gt;
    ```&lt;br /&gt;
&lt;br /&gt;
2.  Follow the prompts. Reasonable defaults are usually fine:&lt;br /&gt;
&lt;br /&gt;
      * Select **(1) RSA and RSA**.&lt;br /&gt;
      * For key size, enter **4096**.&lt;br /&gt;
      * Set an expiration period (e.g., `1y` for one year) or choose `0` for no expiration.&lt;br /&gt;
      * Enter your real name and email address.&lt;br /&gt;
      * Enter a secure passphrase.&lt;br /&gt;
&lt;br /&gt;
3.  List your keys to find the **Key ID**. You will need this for the signing script.&lt;br /&gt;
&lt;br /&gt;
    ```bash&lt;br /&gt;
    gpg --list-secret-keys --keyid-format=long&lt;br /&gt;
    ```&lt;br /&gt;
&lt;br /&gt;
    The output will look similar to this. Your Key ID is the long string of characters after `rsa4096/`.&lt;br /&gt;
&lt;br /&gt;
    ```&lt;br /&gt;
    /home/user/.gnupg/pubring.kbx&lt;br /&gt;
    -----------------------------&lt;br /&gt;
    sec   rsa4096/A1B2C3D4E5F6G7H8 2025-08-24 [SC] [expires: 2026-08-24]&lt;br /&gt;
          XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&lt;br /&gt;
    uid                 [ultimate] Your Name &amp;lt;your.email@example.com&amp;gt;&lt;br /&gt;
    ssb   rsa4096/1A2B3C4D5E6F7G8H 2025-08-24 [E]&lt;br /&gt;
    ```&lt;br /&gt;
&lt;br /&gt;
    In this example, the Key ID is `A1B2C3D4E5F6G7H8`.&lt;br /&gt;
&lt;br /&gt;
-----&lt;br /&gt;
&lt;br /&gt;
### 2\. Update Your Repository Script to Sign the Release&lt;br /&gt;
&lt;br /&gt;
Modify your script to sign the `Release` file using the GPG key you just created. This generates the `InRelease` and `Release.gpg` files that APT expects.&lt;br /&gt;
&lt;br /&gt;
Replace `YOUR_KEY_ID` with the actual Key ID from the previous step.&lt;br /&gt;
&lt;br /&gt;
```bash&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
set -eux&lt;br /&gt;
NAME=&amp;quot;$1&amp;quot;&lt;br /&gt;
GPG_KEY_ID=&amp;quot;A1B2C3D4E5F6G7H8&amp;quot; # &amp;lt;-- REPLACE THIS&lt;br /&gt;
DEB_FILE=&amp;quot;$NAME.deb&amp;quot;&lt;br /&gt;
REPO_ROOT=&amp;quot;$NAME&amp;quot;&lt;br /&gt;
DISTRIBUTION=&amp;quot;stable&amp;quot;&lt;br /&gt;
COMPONENT=&amp;quot;main&amp;quot;&lt;br /&gt;
ARCHITECTURE=&amp;quot;amd64&amp;quot;&lt;br /&gt;
POOL_DIR=&amp;quot;${REPO_ROOT}/pool/${COMPONENT}&amp;quot;&lt;br /&gt;
DIST_DIR=&amp;quot;${REPO_ROOT}/dists/${DISTRIBUTION}&amp;quot;&lt;br /&gt;
BINARY_DIR=&amp;quot;${DIST_DIR}/${COMPONENT}/binary-${ARCHITECTURE}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
mkdir -p &amp;quot;${POOL_DIR}&amp;quot;&lt;br /&gt;
cp &amp;quot;${DEB_FILE}&amp;quot; &amp;quot;${POOL_DIR}/&amp;quot;&lt;br /&gt;
&lt;br /&gt;
pushd &amp;quot;${REPO_ROOT}&amp;quot; &amp;gt; /dev/null&lt;br /&gt;
&lt;br /&gt;
mkdir -p &amp;quot;${BINARY_DIR}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
apt-ftparchive packages &amp;quot;pool&amp;quot; &amp;gt; &amp;quot;${BINARY_DIR}/Packages&amp;quot;&lt;br /&gt;
gzip -9c &amp;quot;${BINARY_DIR}/Packages&amp;quot; &amp;gt; &amp;quot;${BINARY_DIR}/Packages.gz&amp;quot;&lt;br /&gt;
&lt;br /&gt;
apt-ftparchive release &amp;quot;${DIST_DIR}&amp;quot; &amp;gt; &amp;quot;${DIST_DIR}/Release&amp;quot;&lt;br /&gt;
&lt;br /&gt;
gpg --default-key &amp;quot;${GPG_KEY_ID}&amp;quot; -abs -o &amp;quot;${DIST_DIR}/Release.gpg&amp;quot; &amp;quot;${DIST_DIR}/Release&amp;quot;&lt;br /&gt;
gpg --default-key &amp;quot;${GPG_KEY_ID}&amp;quot; --clearsign -o &amp;quot;${DIST_DIR}/InRelease&amp;quot; &amp;quot;${DIST_DIR}/Release&amp;quot;&lt;br /&gt;
&lt;br /&gt;
popd &amp;gt; /dev/null&lt;br /&gt;
```&lt;br /&gt;
&lt;br /&gt;
Now, when you run this script, it will create the necessary signature files in your repository directory.&lt;br /&gt;
&lt;br /&gt;
-----&lt;br /&gt;
&lt;br /&gt;
### 3\. Make the Public Key Available&lt;br /&gt;
&lt;br /&gt;
Export the public part of your GPG key so client machines can download and trust it.&lt;br /&gt;
&lt;br /&gt;
1.  Export the key to a file. Replace `YOUR_KEY_ID` with your Key ID.&lt;br /&gt;
    ```bash&lt;br /&gt;
    gpg --armor --export YOUR_KEY_ID &amp;gt; public.key&lt;br /&gt;
    ```&lt;br /&gt;
2.  Copy this `public.key` file to your web server so it's downloadable. A good location would be the root of your repository. For example: `http://repo.example.com/uctl-agent/public.key`.&lt;br /&gt;
&lt;br /&gt;
-----&lt;br /&gt;
&lt;br /&gt;
### 4\. Configure Client Hosts&lt;br /&gt;
&lt;br /&gt;
On each machine that uses this repository, you need to download the public key and update the `sources.list` entry.&lt;br /&gt;
&lt;br /&gt;
1.  Download the public key and store it in the APT keyrings directory.&lt;br /&gt;
&lt;br /&gt;
    ```bash&lt;br /&gt;
    sudo mkdir -p /etc/apt/keyrings&lt;br /&gt;
    curl -fsSL http://repo.example.com/uctl-agent/public.key | sudo gpg --dearmor -o /etc/apt/keyrings/uctl-agent.gpg&lt;br /&gt;
    ```&lt;br /&gt;
&lt;br /&gt;
2.  Modify your `/etc/apt/sources.list.d/uctl-agent.list` file to tell APT where to find the key for this specific repository using the `signed-by` option.&lt;br /&gt;
&lt;br /&gt;
    ```&lt;br /&gt;
    deb [arch=amd64 signed-by=/etc/apt/keyrings/uctl-agent.gpg] http://repo.example.com/uctl-agent/1.0/ubuntu stable main&lt;br /&gt;
    ```&lt;br /&gt;
&lt;br /&gt;
3.  Finally, run `apt update`. The error should now be gone.&lt;br /&gt;
&lt;br /&gt;
    ```bash&lt;br /&gt;
    sudo apt update&lt;br /&gt;
    ```&lt;/div&gt;</summary>
		<author><name>Busk</name></author>
	</entry>
</feed>