Exercise: Repository Management Using NGINX

Serve the Debian packages using NGINX and install those packages from the repository.

We'll cover the following

Task

In this exercise, you are required to create an Aptly repository with two packages in it. You are required to publish and serve it using NGINX. You can then install and use the packages from the repository served by the web server.

Note: We have already installed aptly and created these two packages 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.

In order to complete the task, you need to perform the following steps:

  1. Generate a private GnuPG key.

  2. Create an Aptly repository, and add the packages hello-debian_0.1_amd64.deb and hello-debian-data_0.1_all.deb to it.

  3. Create a snapshot of the repository and publish it.

  4. Serve your repository with NGINX using the following command (we have already configured the NGINX server for you in the code editor below):

    $ service nginx restart
    
  5. Fetch the information about the packages from the served repository using the apt-get update command.

  6. Create a new directory called test.

  7. Inside the test directory, use apt-get to install the packages hello-debian-data and the hello-debian.

    $ apt-get install <package-name>
    

    If your packages are installed successfully, typing hello will display the following message:

    "Hurrah! We have served and installed packages successfully".
    

Get hands-on with 1200+ tech skills courses.