- Что такое репозитории в Linux – подробное описание для начинающих
- Что такое пакет в Linux?
- Как устанавливаются программы в Linux?
- Что такое репозиторий в Linux?
- Какие бывают репозитории в Linux?
- Как работать с репозиториями в Linux?
- Official repositories
- Contents
- Stable repositories
- extra
- community
- multilib
- Enabling multilib
- Disabling multilib
- Testing repositories
- testing
- community-testing
- multilib-testing
- gnome-unstable
- kde-unstable
- Disabling testing repositories
- Staging repositories
- Historical background
Что такое репозитории в Linux – подробное описание для начинающих
Всем привет! Сегодня я расскажу о том, что такое репозитории в Linux, для чего они нужны, какие виды репозиториев бывают, а также покажу, как работать с этими репозиториями, и какие инструменты для этого используются.
Чтобы понять, что такое репозитории в Linux и для чего они нужны, нужно немного разобраться в архитектуре самой операционной системы Linux, в частности, как устанавливаются программы (пакеты).
Углубляться в дебри мы не будем, но саму концепцию рассмотрим.
На заметку! Новичкам рекомендую почитать мою книгу «Linux для обычных пользователей» – в ней я подробно рассказываю про основы операционной системы Linux и как пользоваться этой системой без командной строки
Давайте обо всем по порядку.
Что такое пакет в Linux?
В Windows программы обычно распространяются в виде exe файлов или в каком-нибудь специально упакованном формате. В Linux программы распространяются в виде пакетов.
Пакет в Linux – это своего рода дистрибутив программы, набор необходимых файлов, которые необходимы для работы этой программы, упакованный в специальный формат.
Существуют два популярных формата пакетов:
- DEB – формат файлов пакетов, использующихся в дистрибутиве Debian и во всех основанных на нем дистрибутивах, таких как: Ubuntu, Linux Mint и другие;
- RPM – менеджер пакетов, использующийся в дистрибутиве Red Hat, а также во многих других популярных дистрибутивах, таких как: openSUSE, CentOS, Mageia и других.
Как устанавливаются программы в Linux?
Все программы, а точнее пакеты, устанавливаются в систему с использованием централизованного метода, т.е. из единой точки, такой точкой может быть либо инструмент с графическим интерфейсом, часто его называют «Менеджер приложений», либо традиционный для Linux способ, утилиты командной строки (терминала).
Процесс установки программ с использованием такого подхода предполагает простой выбор программы, которую необходимо установить, и ее установка одним кликом, все остальное сделает менеджер приложений.
Ярким примером использования такой концепции представлен на всех смартфонах (ведь Android это Linux!), где для установки приложения Вы просто открываете менеджер программ (например, Play Маркет), находите нужную программу, и нажимаете установить и все!
Таким образом, в большинстве случаев для установки программ в Linux не требуется предварительно искать и скачивать с интернета дистрибутив программы, как например в Windows, достаточно запустить менеджер приложений, найти интересующее приложение и запустить установку.
Что такое репозиторий в Linux?
Если нам не нужно самостоятельно скачивать дистрибутивы программ с интернета, то как тогда они попадают на компьютер?
И чтобы сразу внести ясность, на компьютерах пакеты программ не хранятся, менеджер скачивает их автоматически во время установки.
А откуда тогда менеджер скачивает все эти пакеты? А скачивает он их со специальных серверов в интернете (поэтому для установки программ в Linux требуется интернет), которые называются – репозиториями.
Репозитории – это сервера в интернете, на которых хранятся файлы пакетов приложений Linux и другая сопутствующая информация.
Практически у каждого дистрибутива Linux есть свой репозиторий, который содержит только совместимые и поддерживаемые конкретным дистрибутивом пакеты, соответственно, при установке приложений из официальных репозиториев Вы всегда устанавливаете только проверенные и стабильные версии программ.
Официальный репозиторий дистрибутива по умолчанию подключен, и когда Вы пытаетесь найти и установить программу, «Менеджер приложений» считывает информацию о доступных пакетах в репозитории и выдает ее Вам.
Таким образом, когда открываете менеджер приложений, он обращается к репозитоирию, узнает, какие пакеты есть, и выдает этот список Вам, а Вы, соответственно, выбираете и нажимаете кнопку установить, а все остальное делает менеджер.
Существуют, конечно, и нюансы при работе с таким подходом установки программ, например, что программа, которая Вас интересует, должна находиться в репозиториях конкретного дистрибутива Linux, который установлен на компьютере, в противном случае ее придётся искать в интернете, иными словами, делать ровно то же самое, что и в Windows. Однако популярные дистрибутивы Linux содержат в своих стандартных репозиториях тысячи программ на любой вкус, которые могут удовлетворить потребности даже продвинутого пользователя Linux, не говоря уж о начинающем.
Какие бывают репозитории в Linux?
Репозитории бывают как основные, т.е. официально поддерживаемые, так и дополнительные, которые можно подключить в случае возникновения необходимости (например, программы, которую Вы искали, нет в официальном репозитории).
Обычно у дистрибутива несколько официальных репозиториев, в каждом из которых хранятся пакеты, в зависимости от определенных свойств, так, например, в Ubuntu есть следующие типы официальных репозиториев:
- Main – здесь расположено основное, полностью бесплатное программное обеспечение;
- Restricted – проприетарное программное обеспечение, официально поддерживаемое дистрибутивом;
- Universe – бесплатное программное обеспечение, официально поддерживаемое сообществом дистрибутива;
- Multiverse – проприетарное программное обеспечение, не поддерживаемое дистрибутивом.
Если программы, которую Вы искали, нет в официальном репозитории, то Вы можете подключить дополнительный, в котором есть нужная Вам программа.
Например, дополнительные репозитории в Ubuntu и основанных на нем дистрибутивах называются PPA-репозитории.
PPA (Personal Package Archive) – это персональный репозиторий разработчика конкретной программы, где он хранит пакеты своих программ, которые еще не включены в основной репозиторий дистрибутива.
Как работать с репозиториями в Linux?
Если репозиторий – это некий сервер в интернете, на котором хранятся программы, то, чтобы к нему обратиться за необходимой нам программой, мы должны знать адрес этого сервера. Один из самых удобных способов обращения к ресурсам в интернете – это использовать веб протоколы взаимодействия, таким образом, по факту адрес репозитория выглядит, как обычный URL-адрес сайта.
Для того чтобы система знала и помнила, куда обращаться за пакетами (программами), она хранит все адреса репозиториев в специальном файле sources.list, который расположен в каталоге в /etc/apt. И вся работа с репозиториями в Linux заключается в добавлении и удалении адресов репозиториев.
Таким образом, если обобщить весь этот процесс, то, когда мы пытаемся установить программу, система предварительно считывает список доступных пакетов во всех подключенных репозиториях. И если такая программа есть, система устанавливает ее, если нужного пакета нет, то, соответственно, не устанавливает. И нам в этом случае, если мы хотим установить программу, необходимо подключить нужный репозиторий, т.е. добавить адрес этого репозитория.
Работать с репозиториями в Linux можно несколькими способами, в частности новички могут использовать удобный графический интерфейс, а более продвинутые пользователи Linux обычно пользуются специальными командами в терминале Linux.
В любом случае весь процесс работы с репозиториями сводится к редактированию файла sources.list (а также созданию дополнительных подобных файлов), который, кстати, Вы можете отредактировать и обычными утилитами для работы с текстовыми файлами.
Обычно компонент с графическим интерфейсом для работы с репозиториями называется «Источники приложений», он доступен из основного меню операционной системы.
Например, в Linux Mint он выглядит следующим образом
Для управления репозиториями в терминале используется команда add-apt-repository, так, например, для добавления PPA-репозитория команда будет выглядеть следующим образом.
где, ppa:atareao/telegram – это PPA-репозиторий для установки программы Telegram.
Более подробно про то, как добавлять и удалять репозитории в Linux, я расскажу в следующих материалах. Поэтому следите за выходом новых статей в моих группах в социальных сетях: ВКонтакте, Facebook, Одноклассники, Twitter и Tumblr. Подписывайтесь, и Вы не пропустите выход нового материала!
На сегодня это все, надеюсь, материал был Вам полезен и интересен, удачи Вам, пока!
Источник
Official repositories
A software repository is a storage location from which software packages are retrieved for installation.
Arch Linux official repositories contain essential and popular software, readily accessible via pacman. They are maintained by package maintainers.
Packages in the official repositories are constantly upgraded: when a package is upgraded, its old version is removed from the repository. There are no major Arch releases: each package is upgraded as new versions become available from upstream sources. Each repository is always coherent, i.e. the packages that it hosts always have reciprocally compatible versions.
Contents
Stable repositories
This repository can be found in . /core/os/ on your favorite mirror.
core contains packages for:
as well as dependencies of the above (not necessarily makedepends) and the base meta package.
core has fairly strict quality requirements. Developers/users need to signoff on updates before package updates are accepted. For packages with low usage, a reasonable exposure is enough: informing people about update, requesting signoffs, keeping in #testing up to a week depending on the severity of the change, lack of outstanding bug reports, along with the implicit signoff of the package maintainer.
extra
This repository can be found in . /extra/os/ on your favorite mirror.
extra contains all packages that do not fit in core. Example: Xorg, window managers, web browsers, media players, tools for working with languages such as Python and Ruby, and a lot more.
community
This repository can be found in . /community/os/ on your favorite mirror.
community contains packages that have been adopted by Trusted Users from the Arch User Repository. Some of these packages may eventually make the transition to the core or extra repositories as the developers consider them crucial to the distribution.
multilib
This repository can be found in . /multilib/os/ on your favorite mirror.
multilib contains 32-bit software and libraries that can be used to run and build 32-bit applications on 64-bit installs (e.g. wine , steam , etc).
With the multilib repository enabled, the 32-bit compatible libraries are located under /usr/lib32/ .
Enabling multilib
To enable multilib repository, uncomment the [multilib] section in /etc/pacman.conf :
Then upgrade the system and install the desired multilib packages.
Disabling multilib
Execute the following command to remove all packages that were installed from multilib:
If you have conflicts with gcc-libs reinstall the gcc-libs package and the base-devel group.
Comment out the [multilib] section in /etc/pacman.conf :
Then upgrade the system.
Testing repositories
The intended purpose of the testing repository is to provide a staging area for packages to be placed prior to acceptance into the main repositories. Package maintainers (and general users) can then access these testing packages to make sure that there are no problems integrating the new package. Once a package has been tested and no errors are found, the package can then be moved to the primary repositories.
Not all packages need to go through this testing process. However, all packages destined for the core repository must go to testing first. Packages that can affect many packages (such as perl or python ) should be tested as well. Testing is also usually used for large collections of packages such as GNOME and KDE.
testing
This repository can be found in . /testing/os/ on your favorite mirror.
testing contains packages that are candidates for the core or extra repositories.
New packages go into testing if:
- They are destined for the core repo. Everything in core must go through testing
- They are expected to break something on update and need to be tested first.
testing is the only repository that can have name collisions with any of the other official repositories. If enabled, it has to be the first repository listed in your /etc/pacman.conf file.
community-testing
This repository is similar to the testing repository, but for packages that are candidates for the community repository.
multilib-testing
This repository is similar to the testing repository, but for packages that are candidates for the multilib repository.
gnome-unstable
This repository contains testing packages for the next stable or stable release candidate version of the GNOME desktop environment, before they are moved to the main testing repository.
To enable it, add the following lines to /etc/pacman.conf :
The gnome-unstable entry should be first in the list of repositories (i.e., above the testing entry).
Please report packaging related bugs in our bug tracker, while anything else should be reported upstream to GNOME Gitlab.
kde-unstable
This repository contains the latest beta or Release Candidate of KDE Plasma and Applications.
To enable it, add the following lines to /etc/pacman.conf :
The kde-unstable entry should be first in the list of repositories (i.e., above the testing entry).
Make sure you make bug reports if you find any problems.
Disabling testing repositories
If you enabled testing repositories, but later on decided to disable them, you should:
- Remove (comment out) them from /etc/pacman.conf
- Perform a pacman -Syuu to «rollback» your updates from these repositories.
The second item is optional, but keep it in mind if you notice any problems.
Staging repositories
This repository contains broken packages and is used solely by developers during rebuilds of many packages at once. In order to rebuild packages that depend on, for example, a new shared library, the shared library itself must first be built and uploaded to the staging repositories to be made available to other developers. As soon as all dependent packages are rebuilt, the group of packages is then moved to testing or to the main repositories, whichever is more appropriate.
See [1] for more historical details.
Historical background
Most of the repository splits are for historical reasons. Originally, when Arch Linux was used by very few users, there was only one repository known as official (now core). At the time, official basically contained Judd Vinet’s preferred applications. It was designed to contain one of each «type» of program — one DE, one major browser, etc.
There were users back then that did not like Judd’s selection, so since the Arch Build System is so easy to use, they created packages of their own. These packages went into a repository called unofficial, and were maintained by developers other than Judd. Eventually, the two repositories were both considered equally supported by the developers, so the names official and unofficial no longer reflected their true purpose. They were subsequently renamed to current and extra sometime near the release version 0.5.
Shortly after the 2007.8.1 release, current was renamed core in order to prevent confusion over what exactly it contains. The repositories are now more or less equal in the eyes of the developers and the community, but core does have some differences. The main distinction is that packages used for Installation CDs and release snapshots are taken only from core. This repository still gives a complete Linux system, though it may not be the Linux system you want.
Some time around 0.5/0.6, there were a lot of packages that the developers did not want to maintain. Jason Chu set up the «Trusted User Repositories», which were unofficial repositories in which trusted users could place packages they had created. There was a staging repository where packages could be promoted into the official repositories by one of the Arch Linux developers, but other than this, the developers and trusted users were more or less distinct.
This worked for a while, but not when trusted users got bored with their repositories, and not when untrusted users wanted to share their own packages. This led to the development of the AUR. The TUs were conglomerated into a more closely knit group, and they now collectively maintain the community repository. The Trusted Users are still a separate group from the Arch Linux developers, and there is not a lot of communication between them. However, popular packages are still promoted from community to extra on occasion. The AUR also allows untrusted users to submit PKGBUILDs.
After a kernel in core broke many user systems, the «core signoff policy» was introduced. Since then, all package updates for core need to go through a testing repository first, and only after multiple signoffs from other developers are then allowed to move. Over time, it was noticed that various core packages had low usage, and user signoffs or even lack of bug reports became informally accepted as criteria to accept such packages.
In late 2009/the beginning of 2010, with the advent of some new filesystems and the desire to support them during installation, along with the realization that core was never clearly defined (just «important packages, handpicked by developers»), the repository received a more accurate description.
Источник