Search⌘ K
AI Features

Repository Management with Aptly

Explore how to create and manage Debian repositories using Aptly. Learn to add packages, create snapshots, publish repositories with GPG signing, and update published data effectively. This lesson helps you master repository setup, integrity checks, and advanced Aptly features for efficient Debian package management.

Creating an Aptly repository

Aptly is part of the standard Debian and Ubuntu repositories, so usually we can install it easily:

$ apt install aptly

Then, we can create our first Aptly repository with a command like this:

$ aptly repo create -distribution=bullseye \
-component=main \
-architectures=amd64,all \
my-repo
Creating an Aptly repository

Here, my-repo is the name for our fictitious repository.

By default, Aptly creates a $HOME/.aptly.conf configuration file in JSON format and puts all of its files in the $HOME/.aptly/ directory. We can specify an alternative config file with aptly -config=<yourpath> <subcommand>.

Adding a Debian package to a repository

We can add Debian packages to our repo with:

$ aptly repo add <repo-name> <.deb-file>
Adding a Debian package to a repository

So in our example, this might be:

$ aptly repo add
...