How To Install aptly on Debian 9

In this tutorial we learn how to install aptly on Debian 9. aptly is Swiss army knife for Debian repository management

Introduction

In this tutorial we learn how to install aptly on Debian 9.

What is aptly

aptly is:

It offers several features making it easy to manage Debian package repositories:

  • make mirrors of remote Debian/Ubuntu repositories, limiting by components/architectures
  • take snapshots of mirrors at any point in time, fixing state of repository at some moment of time
  • publish snapshot as Debian repository, ready to be consumed by apt
  • controlled update of one or more packages in snapshot from upstream mirror, tracking dependencies
  • merge two or more snapshots into one

There are three methods to install aptly on Debian 9. We can use apt-get, apt and aptitude. In the following sections we will describe each method. You can choose one of them.

Install aptly Using apt-get

Update apt database with apt-get using the following command.

sudo apt-get update

After updating apt database, We can install aptly using apt-get by running the following command:

sudo apt-get -y install aptly

Install aptly Using apt

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install aptly using apt by running the following command:

sudo apt -y install aptly

Install aptly Using aptitude

If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Debian. Update apt database with aptitude using the following command.

sudo aptitude update

After updating apt database, We can install aptly using aptitude by running the following command:

sudo aptitude -y install aptly

How To Uninstall aptly on Debian 9

To uninstall only the aptly package we can use the following command:

sudo apt-get remove aptly

Uninstall aptly And Its Dependencies

To uninstall aptly and its dependencies that are no longer needed by Debian 9, we can use the command below:

sudo apt-get -y autoremove aptly

Remove aptly Configurations and Data

To remove aptly configuration and data from Debian 9 we can use the following command:

sudo apt-get -y purge aptly

Remove aptly configuration, data, and all of its dependencies

We can use the following command to remove aptly configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge aptly

Dependencies

aptly have the following dependencies:

References

Summary

In this tutorial we learn how to install aptly package on Debian 9 using different package management tools: apt, apt-get and aptitude.