Serverspace Black Friday
JT
September 21, 2023
Updated September 18, 2023

How to manage Debian repositories?

Debian Maintenance

Introduction

In the Debian we have various way to update and download software to our system, that can be single archive with set of dependencies, index and etc. Usually that have format tar.gz or .deb, there are files with open-source code which need compile before using.

But some utilities, packets and software may be have snippet of malicious code, unstable or untrusted. For solve that purposes we have repositories with trusted, verified and stable packets, that we can install and using easily. They represent pack of hierarchy of packets, index, libraries needed for installation and sign for more secure usage.

Highlight!There are some repositories from non-official source, that you can use for at your own risk.

Requirements

  • Root rights;
  • Debian OS;
  • Several knowledge about work OS ;
  • Internet connection.

Manage repositories

For the manage repositories we can use files for configuring our system, for that let's find catalog with label apt and check content:

cd /etc/apt/ && ls -l
List of files
Screenshot №1 — List of files

At the screenshot we can see bunch of different files and directories, that we can use for configuring our repositories. Let's consider all files in the catalog and give them explanation:

  • Sources.list — it's determine list of using repositories, their version and branch of the software, that file combine in it self all list of servers;
  • Sources.list.d — the file using for separated configuring list of repositories, usually that divide by using services;
  • Trusted.gpg — that file contain trusted keys of using repositories;
  • Trusted.gpg.d — the same file as above, but divided by the services.

Consider the file sources.list and add line with repository:

nano /etc/apt/sources.list
deb http://security.debian.org/debian-security bullseye-security main
Repositories list
Screenshot №2 — Repositories list

After that we can update index by the command below:

apt update

Then we can use repository by apt, aptitude and etc command for controlling package in our local machine.

However, we can configuring system separated by the services:

cd /etc/apt/sources.list.d/ && ls
Directory of repo
Screenshot №3 — Directory of repo

Go to text editor and consider the file, in your system may be there isn't needed file and you can create this.

For an existing file we just open it, for empty catalog, we create with .list:

nano mysql.list
Repo list of MySQL
Screenshot №4 — Repo list of MySQL

In that line we can indicate signed-file for repo, link and version of using servers, usually we need to add .gpg file into the system. In the moment of update index package our machine verified public key of our repo and then update all information. That mechanism of electronic signature help to save integrity and verify author of data. We can add key by the command, where key.asc will your public key:

gpg --import key.asc
List of public keys
Screenshot №5 — List of public keys

And now we can use repository for update and installation software, executing the command below:

apt update
Update
Screenshot №6 — Update

We are installing software to check that repository work:

apt install dnsutils
Installation
Screenshot №7 — Installation

Conclusion

This guide provides a comprehensive understanding of repositories and their components, enabling users to effectively manage software sources on their Debian-based systems.

Vote:
5 out of 5
Аverage rating : 5
Rated by: 1
33145 North Miami, FL 2520 Coral Way apt 2-135
+1 302 425-97-76
700 300
ITGLOBAL.COM CORP
700 300

You might also like...

We use cookies to make your experience on the Serverspace better. By continuing to browse our website, you agree to our
Use of Cookies and Privacy Policy.