Working with Debian
Introduction
As of version 3.6.0, it is now possible to manage Debian packages using RepoForge.io. This document is a quick start guide for how to manage Debian packages in RepoForge.io.
Need a deeper dive? Follow the tutorial Managing Debian packages in a private APT repository on the RepoForge.io blog.
Pushing Debian packages to RepoForge.io
This guide assumes that you already have a valid Debian package file, e.g. my-package_1.0.0_arm64.deb, that you would like to upload to RepoForge.
Step 1 - Get your unique Debian RepoForge.io URL
You can retrieve your URL from the RepoForge.io dashboard - simply login, click on Debian > Push package (or choose Debian on the Get started page). You'll see your unique URL:

You'll need to replace the RepoForge.io URLs used in the below examples with your own URL.
Step 2 - POST your Debian package to your URL
You'll need an access token with the Debian - Full access role (or your RepoForge.io user credentials, if your user has that role). The simplest way to upload is with curl:
curl -u __token__:${MY_REPOFORGE_TOKEN} \
-F content=@my-package_1.0.0_arm64.deb \
https://api.repoforge.io/debian/my-repoforge-hash/Or, if you'd rather script it, the below example using Python's requests module works too:
import requests
with open("my-package_1.0_all.deb", "rb") as f:
response = requests.post(
"https://api.repoforge.io/debian/my-repoforge-hash/",
files={"content": f},
auth=("__token__", "${MY_REPOFORGE_TOKEN}")
)
assert response.status_code == 200Once you've run the above command, refresh the Debian page of the dashboard, and you should be able to see your newly-created package:

And that's it! Your package is now available in RepoForge.io, ready for you to use
Installing Debian packages saved in RepoForge.io
Once you've created your package, you'll presumably need to deploy it somewhere. To do this, you'll need to:
- Download the RepoForge.io public key to your target.
- Add your RepoForge.io Debian repository as an
aptsource. - Add your credentials so your target can authenticate reqeuests to RepoForge.io properly.
For the sake of this example, I am using Ubuntu version 20.04. Other distros/versions may behave slightly differently, although the main principal is the same.
Step 0 - A few prerequisites
There are few dependencies that your linux distro will need to be able to complete this process, so let's start by installing them:
apt-get update && apt-get install wget gpg gnupg ca-certificates nano -ySome of the above packages may already be installed on your system
We have installed 5 things here:
wget, which we'll us to download the RepoForge.io public key latergpg,gnupgandca-certificates, which will allowaptto sign requests to RepoForge.ionano, which we'll use to edit some configuration files later. Feel free to use your own preferred editor
Step 1 - Download the RepoForge.io public key to your target.
In the version of Ubuntu being used here, the GPG certificates trusted by apt are all stored at /etc/apt/trusted.gpg.d/, so we'll download the RepoForge.io public key here, too:
cd /etc/apt/trusted.gpg.d/
wget https://api.repoforge.io/debian/my-repoforge-hash/repoforge.public.keyStep 2 - Add your RepoForge.io Debian repository as an apt source.
Next, we can add a new apt src. First, we'll cd into the folder where your apt repos are stored, which in the case of Ubuntu is /etc/apt/sources.list.d/ then create a new apt source file for RepoForge.io:
cd /etc/apt/sources.list.d/
nano repoforge.list
# then add the below content to your file:
deb [signed-by=/etc/apt/trusted.gpg.d/repoforge.public.key] https://api.repoforge.io/debian/my-repoforge-hash/raiDf1l/ my-package mainThe signed-by variable is a path to the public key you downloaded earlier.
Step 3 - Add your RepoForge.io credentials
By default, all packages uploaded to RepoForge are private. You will therefore have to set your credentials on the target machine so that apt knows how to authenticate requests to RepoForge.io.
On Ubuntu, apt auth credentials are stored in the /etc/apt/auth.conf.d/ path:
cd /etc/apt/auth.conf.d/
nano repoforge
# add the below content to the file
machine https://api.repoforge.io
login __token__
password your-access-tokenThe token needs the Debian - Read only role (or Debian - Full access). You can use your RepoForge.io email address and password as login and password instead, if you prefer.
Step 4 - Install the package
Finally, we should be able to install the new package like this:
apt-get update && apt-get install my-package