- SourcesList
- Commonly used package sources
- Editing software sources
- Precautions
- Using a graphical program
- Using a text editor
- sources.list format
- Archive type
- Repository URL
- Distribution
- Component
- Example sources.list
- Using Tor with Apt
- CD-ROM
- Name Resolution
- Debug Symbol Packages
- More information
- ru SourcesList
- /etc/apt/sources.list
- Тип архива
- URL Репозитория
- Дистрибутив
- Компонент
- Пример sources.list
- Используем Tor вместе с Apt
- CD-ROM
- Проблемы с разрешением доменных имен
- Debug Symbol Packages
- Подробнее
- sources.list(5) — Linux man page
- Description
- the Repomd and Repomd-src Types
- the Rpm and Rpm-src Types
- the Rpm-dir and Rpm-src-dir Types
- Uri Specification
- Examples
- ℹ️ Как настроить sources.list в Debian 10
- Новые возможности Debian 10 Buster
- Что такое APT-менеджер и его sources.list
- Содержимое и разделы файла Debian sources.list
- Тип архива
- URL репозитория
- Распределение
- Составная часть
- Добавление пользовательских репозиториев
- Импорт ключей apt
- Использование Apt с Tor
- Заключение
- SourcesList
Apt downloads packages from one or more software repositories (sources) and installs them onto your computer.
A repository is generally a network server, such as the official DebianStable repository. Local directories or CD/DVD are also accepted.
The specific repositories (package sources) configured on your machine affect:
- What software packages are available for download
- What versions of packages are available
- Who packages the software
Commonly used package sources
DebianStable: official Debian repository for the current release
StableProposedUpdates: official Debian repository for upcoming point releases (security and important bug fixes every
StableUpdates: official Debian repository for changes that cannot wait for the next point release, packages are also added to StableProposedUpdates for inclusion in the next point release
DebianSecurity: official Debian repository for frequent security updates
DebianBackports: more recent versions of some packages, compatible with DebianStable.
DebianTesting: current development state of the next stable Debian distribution
DebianUnstable: rolling development version containing the latest packages
DebianExperimental: development version containing the experimental/alpha/beta/untested packages
Editing software sources
Precautions
Being able to change the repositories used by your package management system is a powerful feature but this power comes with some responsibility. Users are cautioned that it is possible to break your system (in a way that could be difficult or impossible to cleanly fix) by adding third-party repositories, or repositories for a Debian version that does not match your current version — these repository create a risk of conflicting package versions, creating what’s sometimes called a «Franken-Debian» system. The whole concept behind a Debian stable release is that the Debian developers have picked a set of software and their versions that function nicely together. While this software is patched to fix security issues, the software is frequently not the latest version. It takes some experience to know how the repos may be changed without risk of breaking your system. Users of all levels are advised to change repos cautiously.
Using a graphical program
Some programs allow configuring Apt sources through a graphical interface. For example:
Applications menu > Settings > Software and updates (software-properties-gtk package)
Using a text editor
The main Apt sources configuration file is at /etc/apt/sources.list. You can edit this files (as root) using your favorite text editor.
To add custom sources, creating separate files under /etc/apt/sources.list.d/ is preferred.
sources.list format
The entries in this file normally follow this format:
Archive type
The first word on each line, deb or deb-src, indicates the type of archive. Deb indicates that the archive contains binary packages (deb), the pre-compiled packages that we normally use. Deb-src indicates source packages, which are the original program sources plus the Debian control file (.dsc) and the diff.gz containing the changes needed for packaging the program.
Repository URL
The next entry on the line is a URL to the repository that you want to download the packages from. The main list of Debian repository mirrors is located here.
Distribution
The ‘distribution’ can be either the release code name / alias (jessie, stretch, buster, sid) or the release class (oldstable, stable, testing, unstable) respectively. If you mean to be tracking a release class then use the class name, if you want to track a Debian point release, use the code name. Avoid using stable in your sources.list as that results in nasty surprises and broken systems when the next release is made; upgrading to a new release should be a deliberate, careful action and editing a file once every two years is not a burden.
For example, if you always want to help test the testing release, use ‘testing’. If you are tracking bookworm and want to stay with it from testing to end of life, use ‘bookworm’.
Component
main consists of DFSG-compliant packages, which do not rely on software outside this area to operate. These are the only packages considered part of the Debian distribution.
contrib packages contain DFSG-compliant software, but have dependencies not in main (possibly packaged for Debian in non-free).
non-free contains software that does not comply with the DFSG.
Example sources.list
Below is an example of a sources.list for Debian 11/Bullseye.
If you also need the contrib and non-free components, add contrib non-free after main. For example, for Debian 11/Bullseye:
If you also need the Backports, contrib, and non-free components, add bullseye-backports lines. For example, for Debian 11/Bullseye:
You can instead use https://. in all of the above lines to use the repositories over encrypted HTTPS connections if the according mirror supports HTTPS. (Users of Debian 9/Stretch or older releases will need to install the apt-transport-https package first. The security.debian.org hosts currently do not have publicly verifiable SSL certificates on HTTPS and hence cannot be used with HTTPS at the moment.)
You can use a GNOME tool to edit your sources.list file. Access it through Menu → System → Administration → Software Sources.
Using Tor with Apt
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.
Here is an example sources.list using the onion services for Debian 11/Bullseye:
CD-ROM
If you’d rather use your CD-ROM for installing packages or updating your system automatically with APT, you can put it in your /etc/apt/sources.list. To do so, you can use the apt-cdrom program like this:
with the Debian CD-ROM in the drive.
You can use -d for the directory of the CD-ROM mount point or add a non-CD mount point (i.e. a USB keydrive).
Name Resolution
On occasion name resolution can break. For example, below is from a S/390x Port running in a QEMU Chroot:
You can temporarily work around it by obtaining the IP address from another machine, and then using the IP address rather than the URI:
Debug Symbol Packages
To debug a crash you often need the related debug symbol files. For most Debian packages these are in dbgsym packages. These are available from a separate archive.
Here is an example entry for your sources.list for Debian 11/Bullseye dbgsym packages:
The same if you running testing.
And one more example if you are using the unstable distribution.
More information
A list of UnofficialRepositories to get extra software ( Skype, Opera, Google )
DebianRepository/UseThirdParty — Instructions to use to a third-party repository
Источник
- ru
- SourcesList
/etc/apt/sources.list
Как часть своей работы, Apt использует файл содержащий список ‘источников’ из которых могут быть скачаны пакеты. Этот файл /etc/apt/sources.list.
Содержимое этого файла обычно имеет следующий формат (приведенные ниже данные являются вымышленными и не должны использоваться):
Тип архива
Первое слово в каждой строке, deb или deb-src, указывает тип архива. Deb указывает что архив содержит бинарные пакеты (deb), пре-компилированные пакеты для нормального использования. Deb-src указывает что это архив пакетов с иходным кодом, который содержит оригинальные исходные коды программ плюс контрольный файл Debian (.dsc) и diff.gz содержащий изменения и необходимый для пакетирования программы.
URL Репозитория
Следующая запись в строке это адрес (URL) репозитория с которого вы хотите скачивать пакеты. Основной список зеркал репозитория Debian находитсяздесь.
Дистрибутив
‘distribution’ может быть либо кодовое имя / псевдоним релиза (jessie, stretch, buster, sid), либо класс релиза (stable, oldstable, testing, unstable). Если вы имеете в виду отслеживание класса релиза, а затем хотите использовать название релиза, или же если вы просто хотите отслеживать цикл релизов Debian, то используйте кодовое имя.
Например, если у вас есть система работающая на Debian 11.1 «bullseye» и вы не хотите обновляться когда выйдет Debian «bookworm», в таком случае нужно использовать «bullseye» вместо «bookworm». Если вы всегда хотите помогать с тестированием дистрибутива, то используйте «testing». Если вы отслеживаете цикл «bookworm» и хотите оставаться на нём от тестирования и до конца его жизни, используйте «bookworm».
Компонент
main состоит из DFSG-compliant пакетов, которым не требуется другое ПО из других зон. Эти пакеты считаются частью дистрибуции Debian
contrib пакеты содержат DFSG-compliant ПО, но у них зависимостей из зоны main (возможно упакованы в non-free).
non-free содержит ПО, которое не соответствует DFSG.
Пример sources.list
Ниже приведен пример файла sources.list для Debian 9/Stretch.
Если вы хотите подключить репозиторий с несвободными компонентами системы, то добавьте contrib non-free после main:
Для редактирования вашего файла sources.list, вы можете воспользоваться утилитой software-properties-gtk. Расположенной в Menu → System → Administration → Software Sources.
Используем Tor вместе с Apt
Apt может получать и загружать обновления через Tor. Для этого вам нужно установить пакеты tor и apt-transport-tor. Затем вы можете использовать официальные onion-ресурсы в Debian.
Ниже приведен пример файла sources.list использующий onion-ресурсы в Debian 9/Stretch:
CD-ROM
Если вы хотите использовать CD-ROM для установки пакетов или автоматического обновления системы через APT, то можно записать его в /etc/apt/sources.list. Для этого можно использовать программу apt-cdrom, например:
Можно использовать -d для каталога точки монтирования CD-ROM или добавить точку монтирования не-CD (т.е. USB накопитель).
Проблемы с разрешением доменных имен
Если у вас сломалось/не работает разрешение имён. Например, ниже запущен порт S/390x в QEMU Chroot:
Вы можете временно обойти эту проблему, указав IP адрес репозитория (получив его с другой машны):
Debug Symbol Packages
Для отладки аварийных остановок работы программ часто требуются соответствующие файлы символов отладки. Для большинства пакетов Debian они находятся в пакетах dbgsym. Они доступны из отдельного архива.
Ниже приведен пример файла sources.list для dbgsym-пакетов Debian 9/Stretch:
Подробнее
Список неофициальных репозиториев, что-бы получить дополнительные программы ( Skype, Opera, Google )
Источник
sources.list(5) — Linux man page
Description
The package resource list is used to locate archives of the package distribution system in use on the system. This control file is located in /etc/apt/sources.list and additionally any files ending with «.list» in /etc/apt/sources.list.d are included.
The source list is designed to support any number of active sources and a variety of source media. The file lists one source per line, with the most preferred source listed first. The format of each line is: type uri args. The first item, type, determines the format for args. uri is a Universal Resource Identifier (URI), which is a superset of the more specific and well-known Universal Resource Locator, or URL. The rest of the line can be marked as a comment by using a #.
The generic format of sources.list entry is: type baseuri distribution [component comp2 . ]
Type is one of the types explained below. Baseuri is the URI to the root of the given distribution. Distribution points to a given distribution name, version and architecture. The splitting of URI into baseuri and distribution parts should be done in a way that allows pointing the baseuri to another mirror without touching distribution. Some types additionally support a component-entry.
The following variable substitutions are done on sources.list entries: $(ARCH) is substituted with the base architecture of the system.
$(VERSION) is substituted with the distribution version if configured automatically via Apt::DistroVerPkg or manually via the Apt::DistroVersion configuration option.
the Repomd and Repomd-src Types
Repomd repositories do not support a concept of «components»!
the Rpm and Rpm-src Types
At least one component must be specified for rpm and rpm-src repositories.
the Rpm-dir and Rpm-src-dir Types
At least one component must be specified for rpm and rpm-src repositories. rpm-dir and rpm-src-dir only accept file:// uri’s!
Uri Specification
Examples
Local mirror (local disk, NFS mounted etc) of Fedora Core at /var/www/html/fedora/
repomd file:/var/www/html fedora/linux/core/$(VERSION)/$(ARCH)/
Источник
ℹ️ Как настроить sources.list в Debian 10
Debian является одним из самых популярных дистрибутивов Linux всех времен, и теперь он получил новую версию Debian 10 Buster.
В Debian появилось много производных, наиболее популярным из которых является Ubuntu.
Дистрибутив Debian Linux широко используется из-за его основного управления пакетами – APT и формата пакетов .deb.
Каждое приложение, системная утилита или игра в Debian распространяется в виде пакета.
Вы можете установить эти пакеты в вашу систему, используя APT (автоматически или вручную).
В этом руководстве мы кратко рассмотрим новые возможности Debian 10, познакомимся с менеджером пакетов APT и узнаем, как настроить его файл sources.list на Debian 10 Buster.
Давайте посмотрим, каковы новые функции и самые важные изменения.
Новые возможности Debian 10 Buster
Наиболее важные функции нового Debian 10 Buster:
- GNOME Desktop 3.30
- Linux Kernel 4.19.0-5
- OpenJDK 11.0
- AppArmor Enabled by Default
- Nodejs 10.15.2
- NFtables заменяет iptables
- Поддержка множества плат ARM 64 и ARMHF SBC
- Mailman 3
- Bash 5.0
- Debian implementing /usr/merge
- Secure-boot поддержка
- Calameres Live-установщик образов Debian-Live
Что такое APT-менеджер и его sources.list
APT – менеджер пакетов, используемый в Debian и его производных.
APT расшифровывается как Advanced Package Tool и представляет собой набор инструментов для управления пакетами Debian и, следовательно, всеми приложениями, установленными в вашей системе Debian.
APT используется для установки, обновления или удаления приложений и пакетов.
APT способен разрешать проблемы с зависимостями и извлекать запрошенные пакеты из репозиториев пакетов.
Он делегирует фактическую установку и удаление пакетов dpkg – низкоуровневому инструменту Debian Package.
APT в основном используется инструментами командной строки, но есть и инструменты с графическим интерфейсом.
Файл /etc/apt/sources.list в Debian содержит список «источников», из которых можно получить пакеты.
Файл sources.list может отличаться в зависимости от различных факторов (с какой среды был установлен Debian, был ли он обновлен с предыдущего выпуска и т. д.)
Это список, который мы имеем в нашей системе:
Теперь мы обсудим содержимое этого файла и его различных разделов.
Содержимое и разделы файла Debian sources.list
Разделы файла sources.list следующие:
- Тип архива
- URL репозитория
- распределение
- Составная часть
Теперь мы подробно рассмотрим каждый из этих разделов.
Тип архива
Первая запись в каждой строке – deb или deb-src представляет тип архивов репозитория.
deb означает, что репозиторий в указанном URL-адресе содержит предварительно скомпилированные пакеты.
Это пакеты, установленные по умолчанию при использовании менеджеров пакетов, таких как apt-get, aptitude, synaptic и т. д.
deb-src указывает исходные пакеты с управляющим файлом Debian (.dsc) и diff.gz, содержащий изменения, необходимые для упаковки программы.
URL репозитория
Следующий раздел в строке ввода – это URL-адрес хранилища, из которого будут загружаться пакеты.
Вы можете найти основной список репозиториев Debian из зеркал исходников Debian Worldwide.
Распределение
Дистрибутивом может быть либо кодовое имя релиза / псевдоним (jessie, stretch, buster, sid) или класс релиза (old stable, stable, testing, unstable) соответственно.
Если вы собираетесь отслеживать класс выпуска, используйте имя класса, если вы хотите отслеживать выпуск версии Debian, используйте кодовое имя.
Составная часть
Обычно в Debian можно использовать три компонента, а именно:
- main – содержит пакеты, которые являются частью дистрибутива Debian. Эти пакеты соответствуют DFSG.
- contrib – Пакеты здесь совместимы с DFSG, но содержат пакеты, которых нет в основном хранилище.
- non-free – содержит пакеты программного обеспечения, которые не соответствуют требованиям DFSG.
Как мы видим в следующем файле sources.list на Debian 10 Buster, что в строках были перечислены все три типа компонентов:
Если ваш файл sources.list отличается, вы должны будете добавить разделы contrib и non-free после main, чтобы все пакеты были перечислены.
Если это так в вашей системе, вы можете отредактировать файл /etc/apt/sources.list с помощью nano, vim или любого другого редактора, чтобы внести изменения.
Мы рассмотрим это в следующем разделе статьи.
Если вам также нужны компоненты Backports, contrib и non-free, добавьте строки buster-backports.
Например, для Debian 10 Buster:
Вместо этого вы можете использовать https:// … во всех приведенных выше URL-адресах, чтобы использовать репозитории через зашифрованные соединения HTTPS.
(Пользователи Debian 9 Stretch или более ранних выпусков должны сначала установить пакет apt-transport-https.)
Если ваш sources.list содержит все разделы, мы можем запустить обновление пакета, используя apt-get.
Это обеспечит синхронизацию вашего индекса apt.
Затем вы можете установить новые пакеты из репозитория.
В некоторых случаях вы можете получить ошибки в репозиториях при обновлении списков пакетов.
В этом случае используйте apt, а не apt-get. apt предпочтительнее apt-get для интерактивного использования.
Если это не решает проблему, тогда второй вариант – использовать –allow-releaseinfo-change
Добавление пользовательских репозиториев
Не всегда рекомендуется добавлять пользовательские и сторонние репозитории в файл /etc/apt/sources.list.
Вместо этого вы можете создать файл в каталоге /etc/apt/sources.list.d.
Например, чтобы установить docker-ce на Debian 10 Buster из его репозитория upstream, вы должны сделать следующее:
Вы можете использовать инструмент GNOME для редактирования вашего файла sources.list.
Доступ к нему осуществляется через Меню → Система → Администрирование → Источники программного обеспечения.
Другой способ – использовать команду apt, используемую для добавления сторонних репозиториев:
Затем вы можете перейти к обновлению apt-cache и установить пакет docker-ce с помощью apt-get.
Это рекомендуемый способ добавления любого другого стороннего репозитория.
Вы заметите, что это не сработает, потому что в вашей системе нет ключа GPG репозитория Docker.
Мы рассмотрим это далее.
Импорт ключей apt
При работе с репозиториями apt и sources.list в какой-то момент вам необходимо импортировать ключи GPG.
Обычно это делается с помощью команды apt-key с синтаксисом:
# apt-key adv —keyserver [server-address] —recv-keys Linux package source list
Или вы можете загрузить ключ GPG напрямую и установить его из текущего каталога.
В качестве примера, чтобы загрузить ключи GPG репозитория Docker, вы должны запустить:
Для проверки правильности установки ключа выполните следующее:
После этого вы запустите:
Использование Apt с Tor
Если вы обеспокоены вопросами конфиденциальности или небезопасной передачи данных, вы можете использовать Tor с репозиториями Debian в вашем файле sources.list.
Apt может получать и загружать обновления через Tor.
Чтобы это сработало, вам нужно установить пакеты tor и apt-transport-tor.
Затем вы можете использовать официальные onion сервисы, предоставляемые Debian.
Заключение
Мы видите, как мы можем манипулировать репозиториями файлов и пакетов sources.list в Debian Linux.
Это обновленная статья для нового выпуска Debian – Debian 10 Buster.
Источник