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
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
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
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
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
And now we can use repository for update and installation software, executing the command below:
apt update
We are installing software to check that repository work:
apt install dnsutils
Conclusion
This guide provides a comprehensive understanding of repositories and their components, enabling users to effectively manage software sources on their Debian-based systems.