Exercise: Repository Management

Create Aptly repositories and add multiple Debian packages to them with the same and different endpoints.

Task

In this exercise, you are required to create and serve Aptly repositories containing two packages that we provide to you in the code editor below.

Note: We have already installed aptly for you in the code editor below. We have given you root access in the code editor so you don’t have to type sudo before each command.

Subtask I: Create private key

  1. Generate a private GnuPG key.

Subtask II: Manage the first repository

  1. Create an Aptly repository named first-repo.

  2. Add the package my-first-package_0.1_amd64.deb to the first-repo repository.

  3. Create a snapshot of the first-repo repository named first-repo-v01, and publish it by specifying packages1 as an endpoint.

Subtask III: Manage the second repository

  1. Create another Aptly repository named second-repo.

  2. First, add the package my-first-package_0.1_amd64.deb to the second-repo repository.

  3. Create a snapshot called second-repo-v01 of this repository and publish it using packages2 as an endpoint.

  4. Now, add the package my-second-package_0.1_amd64.deb to the same repository.

  5. Create a snapshot of the repository named second-repo-v02 and publish it by specifying the same endpoint.

Subtask IV: Serve the repositories

  1. You can serve the repository by starting an HTTP server using the following command. (This is not recommended for production use.)
aptly serve

Get hands-on with 1200+ tech skills courses.