How to Configure sources.list on Debian 11

How to Configure sources.list on Debian 11 Хостинг

Содержимое файла sources. list

Each active line in the /etc/apt/sources.list file represents a package source (repository) and is made of at least three parts separated by spaces. For a complete description of the file format and the accepted entry compositions see .

Пример 6.1. Example entry format in /etc/apt/sources.list

Первое поле показывает тип источника:

база пакетов (репозиторий) скомпилированных пакетов

package source (repository) of source packages

The second field gives the base URL of the source. Combined with the filenames listed in the Packages.xz files, it must give a full and valid URL. This can consist in a Debian mirror or in any other package archive set up by a third party. The URL can start with file:// to indicate a local source installed in the system’s file hierarchy, with http:// or https:// to indicate a source accessible from a web server, or with ftp:// or ftps:// for a source available on an FTP server. The URL can also start with cdrom: for CD-ROM/DVD/Blu-ray disc based installations, although this is less frequent, since network-based installation methods are eventually more common. More methods like ssh:// or tor+http(s):// are supported and are either described in or their respective package documentation.

The syntax of the last field depends on the structure of the repository. In the simplest case, you can simply indicate a subdirectory (with a required trailing slash) of the desired source. This is often a simple “./” which refers to the absence of a subdirectory. The packages are then directly at the specified URL. But in the most common case, the repositories will be structured like a Debian mirror, with multiple distributions, each having multiple components. In those cases, name the chosen distribution by its “codename” — see the list in sidebar Брюс Перенс, скандальный лидер — or by the corresponding “suite” (oldoldstable, oldstable, stable, testing, unstable) and then the components to enable. A typical Debian mirror provides the components main, contrib, and non-free.

Записи cdrom описывают CD/DVD-ROMs, которые у вас есть. В противоположность другим записям, CD-ROM не всегда доступны, поскольку диск должен быть вставлен в привод и поскольку только один диск может быть прочитан за раз. Поэтому эти источники управляются несколько другим путём и добавляются с помощью программы apt-cdrom, которая обычно выполняется с параметром add. После запуска данная программа просит пользователя вставить диск в привод, а затем просматривает содержимое диска, ища файлы Packages. Затем она использует эти файлы для обновления база данных доступных пактов (подобная операция обычно выполняется с помощью команды apt update). После этого APT может просить вставить диск, если ей требуется один из этих пакетов.

Хранилища для пользователей стабильных версий

Здесь представлен стандартный файл sources.list для систем, базирующихся на версии Debian :

Пример 6.2. Файл /etc/apt/sources.list для пользователей Debian Stable

# Security updates
deb http://security.debian.org/ bullseye-security main contrib non-free
deb-src http://security.debian.org/ bullseye-security main contrib non-free

## Debian mirror

# Base repository
deb https://deb.debian.org/debian bullseye main contrib non-free
deb-src https://deb.debian.org/debian bullseye main contrib non-free

# Stable updates
deb https://deb.debian.org/debian bullseye-updates main contrib non-free
deb-src https://deb.debian.org/debian bullseye-updates main contrib non-free

# Stable backports
deb https://deb.debian.org/debian bullseye-backports main contrib non-free
deb-src https://deb.debian.org/debian bullseye-backports main contrib non-free

This file lists all sources of packages associated with the version of Debian (the current suite as of this writing). In the example above, we opted to name “bullseye” explicitly instead of using the corresponding “stable“ aliases (stable, stable-updates, stable-backports) because we don’t want to have the underlying distribution changed outside of our control when the next stable release comes out.

Обратите внимание, что когда требуемая версия пакета доступна на нескольких хранилищах, первый из списка в файле sources.list будет использован. Из-за этого неофициальные источники обычно добавляют в конец файла.

В качестве примечания следует отметить, что большая часть сказанного в этом разделе о версии также относится и к версии , которая является просто более старой версией , поддерживаемой параллельно текущей.

Security updates

The server can also host security updates for but this doesn’t happen very often since those updates tend to reach that suite via the regular flow of updates coming from .

Stable updates

Stable updates are not essential for security, but are considered important enough to bring them to users before the next stable version is released.

version of Firefox () or cryptographic keyrings like .

Intended Updates

After the release, the distribution is updated approximately once every 2 months. The proposed-updates repository is where pending updates are prepared (under the supervision of the Stable Release Managers).

Security updates and stable updates documented in the official section are always included in the repository, but here package maintainers also have the opportunity to fix significant bugs that do not require immediate release.

Anyone can use this repository to test those updates before their official publication. The extract below uses the bullseye-proposed-updates alias which is both more explicit and more consistent since buster-proposed-updates also exists (for the updates):

deb https://deb.debian.org/debian bullseye-proposed-updates main contrib non-free

Stable software with backward compatibility

The stable-backports repository contains “backward compatible packages”. This definition refers to a package of some existing software that has been recompiled for an obsolete distribution, usually .

Backports from stable-backports are only created from packages available in . This ensures that all installed backports will be upgradable to the corresponding stable version once the next stable release of Debian is available.

Even though this repository provides newer versions of packages, APT will not install them unless you give explicit instructions to do so (or unless you have already done so with a former version of the given backport):

$ sudo apt-get install package/bullseye-backports
$ sudo apt-get install -t bullseye-backports package

Repositories for version users /

Here is the standard sources.list file for a system running a version or Debian:

Example 6.3. /etc/apt/sources.list file for Debian users /

#Unstable
deb https://deb.debian.org/debian unstable main contrib non-free
deb-src https://deb.debian.org/debian unstable main contrib non-free

# testing
deb https://deb.debian.org/debian testing main contrib non-free
deb-src https://deb.debian.org/debian testing main contrib non-free

# Testing security updates
deb http://security.debian.org/ testing-security main contrib non-free
deb-src http://security.debian.org/ testing-security main contrib non-free

# Stable
deb https://deb.debian.org/debian stable main contrib non-free
deb-src https://deb.debian.org/debian stable main contrib non-free

# Stable security updates
deb http://security.debian.org/ stable-security main contrib non-free
deb-src http://security.debian.org/ stable-security main contrib non-free

With this sources.list file APT will install packages from the suite. If that is not desired, use the APT::Default-Release setting (see Section 6.2.3, «Updating the System») to instruct APT to pick packages from another suite (most likely in this case).

Читайте также:  Освоение записи SPF: важные советы и рекомендации для достижения успеха

The inclusion of is more debatable but it often gives access to some packages, which have been removed from the development versions. It also ensures that you get the latest updates for packages, which have not been modified since the last stable release.

Vault

is usually used by those who are not afraid to break their system and then restore it. This distribution allows you to import a package that the user wants to try out or needs to work with. This just shows Debian’s approach to such packages, since adding this repository to the APT sources.list file does not result in the packages being used all the time. Here is the line to be added:

deb https://deb.debian.org/debian experimental main contrib non-free

Using Alternate Mirrors

The sources.list examples in this chapter refer to package repositories hosted on deb.debian.org. Those URLs will redirect you to servers which are close to you and which are managed by Content Delivery Networks (

But when you don’t know which mirror is best for you, this list is of not much use. Fortunately for you, Debian maintains DNS entries of the form ftp.country-code.debian.org (e.g. ftp.us.debian.org for the USA, ftp.fr.debian.org for France, etc.) which are covering many countries and which are pointing to one (or more) of the best mirrors available within that country.

As an alternative to deb.debian.org, there used to be httpredir.debian.org. This service would identify a mirror close to you (among the list of official mirrors, using GeoIP mainly) and would redirect APT’s requests to that mirror. This service has been deprecated due to reliability concerns and now httpredir.debian.org provides the same CDN-based service as deb.debian.org.

Неофициальные ресурсы

) service — by programmers who make their creation available to all, and even by Debian developers who offer pre-versions of their package online.

The mentors.debian.net site is interesting (although it only provides source packages), since it gathers packages created by candidates to the status of official Debian developer or by volunteers who wish to create Debian packages without going through that process of integration. These packages are made available without any guarantee regarding their quality; make sure that you check their origin and integrity and then test them before you consider using them in production.

Устанавливая пакет, вы даёте права администратора (root) его создателю, поскольку содержимое сценариев инициализации выполняется под этим пользователем. Официальные пакеты Debian создаются добровольцами, которые были прошли рассмотрение и включение в сообщество, и которые могут подписывать свои пакеты, так что их происхождение и целостность могут быть проверены.

In general, be wary of a package whose origin you don’t know and which isn’t hosted on one of the official Debian servers: evaluate the degree to which you can trust the creator, and check the integrity of the package.

Прокси-кэш для пакетов Debian

В случае, когда целая сеть машин настроена на использование одного удалённого сервера для загрузки одних и тех же пакетов, каждый администратор знает, что полезно иметь промежуточный прокси -сервер, работающий как локальный кэш для данной сети (смотри вставку Кэш).

Вы можете настроить APT для использования в качестве «стандартного» прокси (смотри Раздел 6.2.4, «Параметры конфигурации» для стороны APT-а и Раздел 11.6, «HTTP/FTP Proxy» для второй стороны — прокси), но экосистема Debian предлагает лучшие опции для решения этой проблемы. Специальные программы, представленные в этом разделе, является более быстрыми, чем простой прокси-кэш, потому что они зависят от специальных структур хранилищ APT (например они знают, когда отдельные файлы являются устаревшими или нет, и таким образом устанавливают время, в течение которого они хранятся).

и работают как обычные прокси-кэш серверы. Файл APTsources.list остаётся неизменным, но APT настраивается для использования их как прокси для исходящих запросов.

, с другой стороны, действует как HTTP сервер, который “отражает” любое число хранилищ на своих URL верхнего уровня . Пути между теми директориями верхнего уровня и удалёнными URL хранилищ находятся в файле /etc/approx/approx.conf:

# Sample sources.list pointing to a local approx server
deb http://localhost:9999/security bullseye-security main contrib non-free
deb http://localhost:9999/debian bullseye main contrib non-free

Filling in the sources. list File

Example 6.1. Example entry format in /etc/apt/sources.list

The first field indicates the source type:

package source (repository) of binary packages

The syntax of the last field depends on the structure of the repository. In the simplest case, you can simply indicate a subdirectory (with a required trailing slash) of the desired source. This is often a simple “./” which refers to the absence of a subdirectory. The packages are then directly at the specified URL. But in the most common case, the repositories will be structured like a Debian mirror, with multiple distributions, each having multiple components. In those cases, name the chosen distribution by its “codename” — see the list in sidebar Bruce Perens, a controversial leader — or by the corresponding “suite” (oldoldstable, oldstable, stable, testing, unstable) and then the components to enable. A typical Debian mirror provides the components main, contrib, and non-free.

The cdrom entries describe the CD/DVD-ROMs you have. Contrary to other entries, a CD-ROM is not always available since it has to be inserted into the drive and since only one disc can be read at a time. For those reasons, these sources are managed in a slightly different way, and need to be added with the apt-cdrom program, usually executed with the add parameter. The latter will then request the disc to be inserted in the drive and will browse its contents looking for Packages files. It will use these files to update its database of available packages (this operation is usually done by the apt update command). From then on, APT can require the disc to be inserted if it needs one of its packages.

Repositories for Users

Here is a standard sources.list for a system running the version of Debian:

Note that when the desired version of a package is available on several repositories, the first one listed in the sources.list file will be used. For this reason, non-official sources are usually added at the end of the file.

As a side note, most of what this section says about applies equally well to since the latter is just an older that is maintained in parallel.

Security Updates

The security and stable updates documented in the former sections are always included in this repository, but there is more too, because package maintainers also have the opportunity to fix important bugs that do not deserve an immediate release.

Stable Backports

The stable-backports repository hosts “package backports”. The term refers to a package of some recent software which has been recompiled for an older distribution, generally for .

Repositories for / Users

Here is a standard sources.list for a system running the or version of Debian:

With this sources.list file APT will install packages from the suite. If that is not desired, use the APT::Default-Release setting (see Section 6.2.3, “System Upgrade”) to instruct APT to pick packages from another suite (most likely in this case).

The Repository

Installing a package means giving root rights to its creator, because they decide on the contents of the initialization scripts which are run under that identity. Official Debian packages are created by volunteers who have been co-opted and reviewed and who can seal their packages so that their origin and integrity can be checked.

Читайте также:  Партнерская программа на хостинг для веб-мастеров и веб-студий

Caching Proxy for Debian Packages

You can configure APT to use a «standard» proxy (see Section 6.2.4, “Configuration Options” for the APT side, and Section 11.6, “HTTP/FTP Proxy” for the proxy side), but the Debian ecosystem offers better options to solve this problem. The dedicated software presented in this section are smarter than a plain proxy cache because they can rely on the specific structure of APT repositories (for instance they know when individual files are obsolete or not, and thus adjust the time during which they are kept).

and work like usual proxy cache servers. A PT’s sources.list is left unchanged, but APT is configured to use them as proxy for outgoing requests.

, on the other hand, acts like an HTTP server that “mirrors” any number of remote repositories in its top-level URLs. The mapping between those top-level directories and the remote URLs of the repositories is stored in /etc/approx/approx.conf:

Repository URL

The next section on the entry line is an URL of the repository from where the packages will be downloaded from. You can find the main list of Debian repositories from Debian Worldwide sources.list mirrors.

Добавление сторонних репозиториев

Добавлять репозитории можно в основной конфиг: /etc/apt/sources.list или создавать отдельные конфиги в каталоге /etc/apt/sources.list.d/. Сам я считаю что правильнее для каждого стороннего репозитория создавать отдельные конфиги.

Например, чтобы подключить репозиторий nginx создайте следующий конфиг. Для Debian:

Или для Ubutnu:

Допустим, мы прописали дополнительный репозиторий для nginx, но как системе понять из какого репозитория брать пакет для установки? Ведь пакеты для nginx есть и в системном репозитории и в репозитории от самого nginx. Чтобы ответить на этот вопрос придумали приоритеты репозиториев.

По нашему примеру для nginx нужно создать следующий файл:

$ sudo nano /etc/apt/preferences.d/99nginx
Package: *
Pin: origin nginx.org
Pin: release o=nginx
Pin-Priority: 900

То-есть Package и Pin это условия для назначения приоритета, а Pin-Priority это действие (назначение приоритета). В нашем примере получается следующее: если имя пакета любое, но владелец репозитория nginx.org и в файле Release прописано «Origin: nginx«, то для таких пакетов ставим приоритет 900.

Priority can be in the following ranges:

Priorities 500 to 990 and 990 to 1000 are very similar. To distinguish them, you need to understand what a target release is. For Ubuntu or Debian, this is the version name of the distribution. For example, for Ubuntu — jammy, and for Debian — bullseye. But this name still needs to be set in this way:

Repository public key

And so, we added the repository, set the priority. Let’s try to apply the changes:

And here we see an error that we do not have enough public key. I gave an example for Debian, but Ubuntu will have a similar situation. The fact is that modern repositories are encrypted using a private key, and in order to use it, we need to install a public key in the system.

To do this, first install the necessary tools:

Attention! The gnupg2 utility for Ubuntu is only available in the universe repository, if you have commented out these sources, then uncomment them. These are the lines:
deb http://ru.archive.ubuntu.com/ubuntu jammy universe
deb http://ru.archive.ubuntu.com/ubuntu jammy-updates universe
And don’t forget to apply the changes by running:
$ sudo apt update

And then download the public key (using wget):

$ wget https://nginx.org/keys/nginx_signing.key

And try again to apply the changes:

Everything went well this time.

By the way, if you want to specify the architecture and public key in the package source, then this is done through a space:

Checking the added repository

Well, to understand from which repository the package will be installed, run the command:

From the output, it becomes clear that the nginx package has not yet been installed on the system, and the package with version 1.20.2 from the http://nginx.org/packages/debian repository is a candidate for installation. The priority for all packages, by the way, became equal to = 990. This happened after we set the target release to = bullseye. Since all the repositories belong to this release, the system stopped looking at the priority I assigned, and assigned this priority to the repositories for bullseye.

Component

There are normally three components which can be used on Debian, namely:

deb http://httpredir.debian.org/debian bullseye main non-free contrib
deb-src http://httpredir.debian.org/debian bullseye main non-free contrib

deb http://deb.debian.org/debian-security/ bullseye-security main contrib non-free
deb-src http://deb.debian.org/debian-security/ bullseye-security main contrib non-free

If your sources.list file differs, you will have to add contrib and non-free sections after main to have all of the packages listed. If this is the case on your system, you can edit the file /etc/apt/sources.list with nano, vim or any other editor to make changes. We will go through that in the next section of the article.

If you also need the Backports, contrib, and non-free components, add bullseye-backports lines. For example, for Debian 11 Bullseye:

deb http://deb.debian.org/debian bullseye-backports main contrib non-free
deb-src http://deb.debian.org/debian bullseye-backports main contrib non-free

If your sources.list contains all of the sections we can run package update using apt. This will ensure your apt index is synchronized. Then you can install new packages from the repository.

In some cases you can get errors with repositories while updating the package lists. In that case use apt rather than apt-get. apt is preferred over apt-get for interactive use.

$ sudo apt update
$ sudo apt upgrade -y

If that doesn’t fix the issue then second option is to use —allow-releaseinfo-change

$ sudo apt-get —allow-releaseinfo-change update

Importing apt keys

When working with apt and sources.list repositories, at some point you are required to import GPG keys. This is usually done using the command apt-key, with syntax:

Or you can download the GPG key directly and install it from the current directory. As an example, to download docker repository GPG keys, you’ll run:

After that you’ll run:

$ sudo apt-get update
$ sudo apt-get install docker-ce

New features of Debian 11 Bullseye

The most important features of new Debian 11 Bullseye are:

  • PHP 7.4
  • Python 3.9

Adding repository from GUI

alternative, you can add the package repository from Debian Gui. I am using Debian 11 with the Gnome Desktop environment.

From the Desktop search for ‘Software & Updates’


How to Configure sources.list on Debian 11

In ‘Software & Updates’, choose the second tab ‘Other Software’


How to Configure sources.list on Debian 11

choose ‘Other Software’

Click ‘Add’ button, then add the APT line and click the ‘Add Source’ button to update the /etc/apt/sources.list file.


How to Configure sources.list on Debian 11

Add APT Line

Вариант использования официальных репозиториев

Для того чтобы уменьшить вероятность поломки вашей системы из-за непроверенных обновлений, можно немного сократить количество репозиториев в системах Debian и в Ubuntu.

Вообще в Debian дан список самых безопасных репозиториев по умолчанию. Можем лишь закомментировать репозитории с исходниками, так как скорее всего вам они пока не понадобятся. Напомню, что такие строки начинаются со слова deb-src. А если понадобятся вы их просто раскомментируете. После правки у нас осталось 3 источника пакетов:

Ubuntu при установке прописала намного больше своих репозиториев. Но их тоже можно свести к трем. Например, я считаю нужным отключить universe, multiverse и jammy-backports репозитории на сервере. После правки список репозиториев также состоит из 3-ёх строк:

Читайте также:  Подробный обзор хостинга ISPserver — отзывы экспертов и пользователей

Чтобы применить изменения, выполните на обоих системах команду:

Эта команда подключится к каждому репозиторию, посмотрит какие пакеты можно обновить и из каких источников. И сохранит локальных кэш. После выполнения этой команды система будет знать какие пакеты из каких репозиториев можно получить, а также версии этих пакетов. Но если в репозиторий добавят более новую версию какого-нибудь пакета, то система об этом узнает лишь после следующего выполнения этой команды.

А если хотите обновить систему, то выполните команду:

Эта команда уже скачивает все обновления и устанавливает их.

Кстати утилита apt — это и есть менеджер пакетов. Рассмотрим её и другие менеджеры пакетов в следующих статьях.

Contents and sections of Debian sources. list file

We will now go into detail about each of these sections.

Archive type

The first entry on each line — deb or deb-src represents the type of repository archives.

What is APT manager and it’s sources. list

APT is the package manager used in Debian and its derivatives. A PT stands for Advanced Package Tool and it is a set of tools for managing Debian packages, and therefore all of the applications installed on your Debian system. APT is used to install, update or remove applications and packages.

APT is capable of resolving dependency problems and retrieving requested packages from package repositories. It delegates the actual installation and removal of packages to dpkg — low level core Debian Package tool. A PT is mainly used by its command-line tools, but there are also GUI tools available.

This is the list we want on our system:

$ cat /etc/apt/sources.list

deb http://httpredir.debian.org/debian bullseye main non-free contrib
deb-src http://httpredir.debian.org/debian bullseye main non-free contrib

deb http://deb.debian.org/debian-security/ bullseye-security main contrib non-free
deb-src http://deb.debian.org/debian-security/ bullseye-security main contrib non-free

We will now discuss the contents of this file and it’s different sections.

Конфиги со списком репозиториев

Пакетные менеджеры, которые умеют устанавливать пакеты из репозиториев, должны знать адреса репозиториев. И эти адреса записываются в конфиг — /etc/apt/sources.list. А также можно создавать дополнительные конфиги с расширением .list в каталоге /etc/apt/sources.list.d/. Всё это справедливо и для Debian и для Ubuntu.

Если помните, в процессе установки систем мы выбирали репозиторий:

Этот файл состоит из строк, а строки состоят из следующих столбцов:

Классы релизов в Debian

Рассматривая выше ветки репозиториев Debian мы увидели следующее:

Но, помимо кодовых имён версий системы, в названиях веток, можно использовать специальные классы релизов:

То есть вы можете изменить свои репозитории на testing, и быть на острие прогресса:

### Это только пример, существует большая вероятность что система очень скоро повредится из за непроверенных обновлений ###
deb http://deb.debian.org/debian/ testing main
deb-src http://deb.debian.org/debian/ testing main
deb http://security.debian.org/debian-security testing-security main
deb-src http://security.debian.org/debian-security testing-security main
deb http://deb.debian.org/debian/ testing-updates main
deb-src http://deb.debian.org/debian/ testing-updates main

Using Apt with Tor

If you’re concerned with privacy issues, or unsecure data transfer, you can use Tor with Debian repositories in your sources.list file. Apt can retrieve and download updates through Tor. For this to work you need to install the tor and apt-transport-tor packages. You can then use the official onion services provided by Debian.

deb tor+http://vwakviie2ienjx6t.onion/debian bullseye main
deb-src tor+http://vwakviie2ienjx6t.onion/debian bullseye main

deb tor+http://sgvtcaew4bxjd7ln.onion/debian-security bullseye-security main
deb-src tor+http://sgvtcaew4bxjd7ln.onion/debian-security bullseye-security main

deb tor+http://vwakviie2ienjx6t.onion/debian bullseye-updates main
deb-src tor+http://vwakviie2ienjx6t.onion/debian bullseye-updates main

Note: Debian less support https due to the fact that Debian package distribution has a mechanism to verify packages using GPG. The package signature scheme helps better than https in this case. You can use https mirror but make sure you have installed apt-transport-https package installed.

Adding repository from terminal

You can add a package repository to Debian 2 ways from the shell: manually or using apt. The package repository information is stored in the file named /etc/apt/sources.list. And also can be stored in any file inside the directory /etc/apt/sources.list.d/.

Add repository manually

To add a repository manually you have to edit the /etc/apt/sources.list file. The entries in this file have a syntax as:

Archive-Type Repository-URL Distribution Component1 Component2 Component3

Archive Type — The first word of the line can be deb or deb-src. Deb indicates the archive holds the .deb packages and deb-src indicates the archive has the source packages.

Repository URL — This entry is the URL of the repository from where the package is to download.

Distribution — This can be either the release code name, alias (such as bullseye) or the release class (oldstable, stable, testing, unstable) respectively.

Component — This can be main, contrib, or non-free. The main contains DFSG compliant package part of Debian distribution. The contrib contains the DFSG compliant package which has dependencies not in the main. The non-free contains packages that don’t comply with DFSG.

For example, let’s add the VirtualBox repository to Debian Bullseye. First open /etc/apt/sources.list file to edit.

Now you can add the package repository line to the file.

Below is the /etc/apt/sources.list file from my Debian 11 system, it contains some of the official Debian repository which was added during the Debian installation and you can also see the newly added repository.


How to Configure sources.list on Debian 11

Instead of adding to /etc/apt/sources.list file, you can also create custom source file with .list extension inside /etc/apt/sources.list.d/ directory and add the repository in that file. This also works.

Once the apt repository is added, make sure to update the package index:

Add repository using add-apt-repository

The add-apt-repository is a Python script used to add a regular APT repository or PPA. This utility is included in the software-properties-common package.

For example, you need to install Docker from the official repository. First, update the package index and install all the dependencies.

sudo apt install apt-transport-https ca-certificates curl gnupg-agent software-properties-common

Import the repository GPG key:

Now add the Docker repository using add-apt-repository:

This will add the repository information to the etc/apt/sources.list file.

Next, update the package index and then install the docker package.

sudo apt update
apt-cache policy docker-ce

To remove the enabled repository, type:

The add-apt-repository also allows adding PPA Repository. P PA stands for Personal Package Archive, which allows developers to create their own repositories.

For example to add the PPA repository for libreoffice, type:

sudo add-apt-repository ppa:libreoffice/libreoffice-7-0

Once PPA is added, you can install the respective package using apt.

Adding custom repositories

$ sudo vim /etc/apt/sources.list

Add the content:

Another way is to use the apt command used for adding third-party repositories:

You can then proceed to update apt-cache and install docker-ce package with apt-get. This is the recommended way to add any other third party repository.

You’ll notice this wont work because you don’t have the GPG key of the docker repository on your system. We’ll cover that next.

Distribution

The distribution can be either the release code name / alias (jessie, stretch, buster, bullseye, sid) or the release class (old stable, stable, testing, unstable) respectively. If you intend to track a release class then use the class name, if you want to track a Debian point release, use the code name.

Оцените статью
Хостинги