How to Install Aptly on Ubuntu Server
Aptly is a popular Debian package management tool that allows you to manage your package repositories easily. In this tutorial, we will show you how to install Aptly on an Ubuntu server.
Prerequisites
Before you begin, you must have the following:
- A server running Ubuntu 20.04
- Sudo privileges to install packages and edit system files.
Step 1: Update the System
Before installing Aptly, ensure that the Ubuntu system is up to date by running the following command:
sudo apt update
sudo apt upgrade
Step 2: Add Aptly Repository
Then, add the Aptly repository to your system by running the following commands.
sudo apt install curl
curl https://repo.aptly.info/key.asc | sudo apt-key add -
echo "deb https://repo.aptly.info/ squeeze main" | sudo tee /etc/apt/sources.list.d/aptly.list
Step 3: Install Aptly
Now that the repository has been added, update your system and install Aptly using the following command.
sudo apt update
sudo apt install aptly
Step 4: Configure Aptly
After installing, you can now start configuring Aptly using its configuration file located at /etc/aptly.conf.
For example, to enable the serve API, uncomment the following lines in the configuration file:
{
"api": {
"serve": {
"listen": ":8080"
}
}
}
Step 5: Use Aptly
With Aptly installed and configured, it's time to start using it. You can begin by creating the first local repository.
sudo aptly repo create -distribution=<distribution> <name>
For example:
sudo aptly repo create -distribution=focal my_repo
Conclusion
That's it. You have now installed and configured Aptly on your Ubuntu server. You can now manage your package repositories easily using Aptly.