Debian Packaging: From Source to Repository

Installing and Updating Syspeek

A practical Debian packaging course lesson covering installing and updating syspeek.

Installing and Updating Syspeek

We have built Syspeek, created a local APT repository with aptly, and published signed repository metadata.

In this final lesson, we will configure a Debian client to trust the repository, install Syspeek through APT, and understand how users receive future updates.

Learning Objectives

  • Install a repository signing key on a client.
  • Configure an APT source using signed-by.
  • Refresh package indexes.
  • Install and inspect Syspeek through APT.
  • Understand how package upgrades are delivered.

1. Make the Repository Available

Your published aptly directory must be accessible to the client through a web server.

For this example, assume the repository is available at:

1
https://packages.example.org/debian

This is a placeholder URL. Replace it with the real hostname and path where you publish your repository.

Do not configure a client with this example address unless you have actually deployed the repository there.

2. Install the Repository Public Key

Copy the public key to the client using a trusted method.

For example, if the file is named syspeek-archive-key.asc, convert it to a keyring file:

1
2
3
gpg --dearmor \
    < syspeek-archive-key.asc \
    | sudo tee /usr/share/keyrings/syspeek-archive-keyring.gpg > /dev/null

Set appropriate read permissions:

1
sudo chmod 0644 /usr/share/keyrings/syspeek-archive-keyring.gpg

The keyring file contains the public key used by APT to verify repository metadata.

Verify the fingerprint before trusting the key. Do not rely solely on a key downloaded from the same untrusted location as the repository.

3. Add the APT Source

Create a source-list file:

1
sudo nano /etc/apt/sources.list.d/syspeek.list

Add one line:

1
deb [signed-by=/usr/share/keyrings/syspeek-archive-keyring.gpg] https://packages.example.org/debian trixie main

Replace the URL and suite with the actual published repository location and distribution.

The signed-by option restricts this source to the specified keyring instead of trusting the key globally for every repository.

4. Update Package Indexes

Run:

1
sudo apt update

APT should retrieve the Release metadata and package indexes and verify the repository signature.

If verification fails, check:

  • The repository URL.
  • The distribution and component names.
  • Whether the signing key is installed correctly.
  • Whether the published metadata is signed by the corresponding private key.
  • Whether the system clock is correct.

Do not work around signature errors by disabling authentication.

5. Install Syspeek

Install the package:

1
sudo apt install syspeek

Run it:

1
2
syspeek
syspeek --version

Check package information:

1
apt show syspeek

Check the installed package version:

1
dpkg-query -W -f='${Package} ${Version} ${Architecture}\n' syspeek

6. Publish an Update

Imagine that we have developed Syspeek version 0.2.0.

The release workflow would be:

  1. Update the application source.
  2. Update debian/changelog.
  3. Build and test the package.
  4. Add the new package to the aptly repository.
  5. Create a new snapshot.
  6. Publish the updated snapshot.
  7. Ensure the repository metadata is signed.

For example, after building the new .deb:

1
aptly repo add syspeek-repo ../syspeek_0.2.0-1_amd64.deb

Create a new snapshot:

1
2
aptly snapshot create syspeek-0.2.0 \
    from repo syspeek-repo

The exact publication command depends on whether you are publishing a new distribution or updating an existing published repository. Follow aptly’s snapshot-switching workflow for an existing publication rather than trying to publish over it blindly.

7. Upgrade the Client

Once the repository publishes the new version, the client can retrieve it:

1
2
sudo apt update
sudo apt upgrade

Or upgrade only Syspeek:

1
sudo apt install --only-upgrade syspeek

Check the installed version:

1
syspeek --version

APT compares available package versions with installed versions and selects an upgrade when a newer eligible version is available.

8. Remove the Package and Repository

To remove Syspeek:

1
sudo apt remove syspeek

To remove the repository source:

1
2
sudo rm /etc/apt/sources.list.d/syspeek.list
sudo apt update

If the repository key is no longer needed by any source, remove it:

1
sudo rm /usr/share/keyrings/syspeek-archive-keyring.gpg

Removing the source does not automatically remove packages already installed from it.

9. The Complete Workflow

We have now completed the full journey:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
Go source code
      |
      v
Debian packaging metadata
      |
      v
Build binary package
      |
      v
Test and validate
      |
      v
Create aptly repository
      |
      v
Publish signed metadata
      |
      v
Configure APT client
      |
      v
Install and upgrade Syspeek

10. What We Learned

We configured a client to trust a repository-specific key, added an APT source, installed Syspeek, and reviewed the upgrade workflow.

We have completed the practical journey from a small Go program to a package distributed through a signed APT repository.

Final Exercises

  1. Install Syspeek on a clean Debian virtual machine using only the APT repository.
  2. Publish a second version and upgrade the client.
  3. Verify the repository signature and key fingerprint.
  4. Document the release process so another maintainer can reproduce it.
  5. Review the Debian Policy and aptly documentation for areas you want to explore further.

Course Completed

Congratulations! You have completed the Debian Packaging course.

You have learned how to:

  • Understand the internal structure of Debian packages.
  • Prepare a packaging environment.
  • Create Debian packaging metadata.
  • Build and test a Go application as a Debian package.
  • Work with source packages and signatures.
  • Create and publish an APT repository with aptly.
  • Install and update your own package through APT.

The next step is to apply the same workflow to a real application with external dependencies, more complex installation requirements, and a release process suitable for long-term maintenance.