Инструменты пользователя

Инструменты сайта


cowork:selfdistr:apt_preferences

apt_preferences

apt_preferences (5) ( Linux man: Форматы файлов)

NAME ИМЯ

apt_preferences - Preference control file for APT

apt_preferences - файл управления предпочтениями для APT

DESCRIPTION ОПИСАНИЕ

The APT preferences file /etc/apt/preferences can be used to control which versions of packages will be selected for installation.

Файл предпочтений (настроек, привилегий) APT /etc/apt/preferences может быть использован для контроля, какие версии пакетов будут выбраны для установки..

Several versions of a package may be available for installation when the sources.list(5) file contains references to more than one distribution (for example, stable and testing). APT assigns a priority to each version that is available. Subject to dependency constraints, apt-get selects the version with the highest priority for installation. The APT preferences file overrides the priorities that APT assigns to package versions by default, thus giving the user control over which one is selected for installation.

Несколько версий пакета могут быть доступными для установки, когда файл sources.list (5) содержит ссылки более чем на один дистрибутив (например, стабильный и тестируемый). APT назначает приоритет каждой доступной версии. С учётом ограничений, налагаемых зависимостями, apt-get выбирает для установки версию с наивысшим приоритетом. Файл предпочтений APT переопределяет приоритеты, которые APT присваивает версиям пакета по умолчанию, что даёт пользователю контроль над тем, какой пакет будет выбран для установки.

Several instances of the same version of a package may be available when the sources.list(5) file contains references to more than one source. In this case apt-get downloads the instance listed earliest in the sources.list(5) file. The APT preferences file does not affect the choice of instance, only the choice of version.

Несколько экземпляров одной и той же версии пакета могут быть доступны, когда файл sources.list (5) содержит ссылки больше чем на один источник. В этом случае apt-get загрузит самый ранний экземпляр из перечисленных в файле sources.list (5). Файл предпочтений APT не влияет на выбор экземпляра, а только на выбор версии.

APT's Default Priority Assignments Приоритеты APT заданные по умолчанию

If there is no preferences file or if there is no entry in the file that applies to a particular version then the priority assigned to that version is the priority of the distribution to which that version belongs. It is possible to single out a distribution, «the target release», which receives a higher priority than other distributions do by default. The target release can be set on the apt-get command line or in the APT configuration file /etc/apt/apt.conf. For example,

Если файл предпочтений отсутствует или в нём нет записи, которая относится к конкретной версии тогда, приоритет, присвоенный этой версии, является приоритетом дистрибутива, к которому принадлежит эта версия. Это даёт возможность выбрать дистрибутив, «целевой релиз», который получает более высокий приоритет, чем другие дистрибутивы по умолчанию. Целевой релиз может быть установлен в командной строке apt-get или в конфигурационном файле APT /etc/apt/apt.conf. Например:

apt-get install -t testing некоторый-пакет
APT::Default-Release "stable";
If the target release has been specified then APT uses the following algorithm to set the priorities of the versions of a package. Assign:

Если целевой релиз был указан, тогда APT использует следующий алгоритм, чтобы установить приоритеты версий пакета. Назначает:

priority 100
to the version that is already installed (if any).

версии, которая уже установлена (если таковая имеется).

priority 500
to the versions that are not installed and do not belong to the target release.

версиям, которые не установлены и не принадлежат целевому релизу.

priority 990
to the versions that are not installed and belong to the target release.

версиям, которые не установлены и принадлежат целевому релизу.

If the target release has not been specified then APT simply assigns priority 100 to all installed package versions and priority 500 to all uninstalled package versions.

Если целевой релиз не был указан, то APT просто присваивает приоритет 100 всем установленным версиям пакета и приоритет 500 всем неустановленным версиям пакета.

APT then applies the following rules, listed in order of precedence, to determine which version of a package to install.

Затем APT применяет следующие правила, перечисленные в порядке старшинства, чтобы определить, какую версию пакета установить.

* Never downgrade unless the priority of an available version exceeds 1000. («Downgrading» is installing a less recent version of a package in place of a more recent version. Note that none of APT's default priorities exceeds 1000; such high priorities can only be set in the preferences file. Note also that downgrading a package can be risky).
  • Никогда не понижать версию, если приоритет доступной версии не превышает 1000. («Понижение версии» устанавливает более старую версию пакета вместо более свежей версии. Обратите внимание, что ни один из приоритетов APT по умолчанию не превышает 1000; такие высокие приоритеты могут быть установлены только в файле предпочтений. Обратите внимание также, что понижение версии пакета может быть опасным).
* Install the highest priority version.
  • Устанавливать версию с наивысшим приоритетом.
* If two or more versions have the same priority, install the most recent one (that is, the one with the higher version number).
  • Если две или более версии имеют одинаковый приоритет, установить самую свежую (то есть, с более высоким номером версии).
* If two or more versions have the same priority and version number but either the packages differ in some of their metadata or the –reinstall option is given, install the uninstalled one.
  • Если две или более версии имеют одинаковый приоритет и номер версии, но или пакеты отличаются по некоторым из их метаданных, или задана опция – reinstall, установить неустановленную.
In a typical situation, the installed version of a package (priority 100) is not as recent as one of the versions available from the sources listed in the sources.list(5) file (priority 500 or 990). Then the package will be upgraded when apt-get install some-package or apt-get upgrade is executed.

В типичной ситуации установленная версия пакета (приоритет 100) не является столь же свежей, как одна из версий, доступных из источников, перечисленных в файле sources.list (5) (приоритет 500 или 990). Тогда пакет будет обновлён запуском apt-get install некоторый-пакет или apt-get upgrade.

More rarely, the installed version of a package is more recent than any of the other available versions. The package will not be downgraded when apt-get install some-package or apt-get upgrade is executed.

Реже, установленная версия пакета более свежая, чем любая из других доступных версий. Версия пакета не будет понижена запуском apt-get install некоторый-пакет или apt-get upgrade.

Sometimes the installed version of a package is more recent than the version belonging to the target release, but not as recent as a version belonging to some other distribution. Such a package will indeed be upgraded when apt-get install some-package or apt-get upgrade is executed, because at least one of the available versions has a higher priority than the installed version.

Иногда установленная версия пакета более свежая, чем версия, принадлежащая целевому релизу, но не так свежа, как версии из некоторых других дистрибутивов. Такой пакет будет действительно обновлён, при запуске apt-get install некоторый-пакет, или apt-get upgrade, потому что по крайней мере одна из доступных версий имеет более высокий приоритет, чем установленная версия.

The Effect of APT Preferences Влияние предпочтений APT

The APT preferences file allows the system administrator to control the assignment of priorities. The file consists of one or more multi-line records separated by blank lines. Records can have one of two forms, a specific form and a general form.

Файл предпочтений APT позволяет системному администратору управлять назначением приоритетов. Файл состоит из одной или более многострочных записей, разделённых пустыми строками. Записи могут иметь одну из двух форм: специфическую форму и общую форму.

* The specific form assigns a priority (a «Pin-Priority») to one or more specified packages and specified version or version range. For example, the following record assigns a high priority to all versions of the perl package whose version number begins with «5.8». Multiple packages can be separated by spaces.
  • Специфическая форма назначает приоритет («Pin-Priority») одному или нескольким указанным пакетам и указанной версии или диапазону версий. Например, следующая запись назначает высокий приоритет всем версиям пакета perl, номер версии которого начинается «5.8». Несколько пакетов могут быть разделены пробелами.
Package: perl
Pin: version 5.8*
Pin-Priority: 1001
* The general form assigns a priority to all of the package versions in a given distribution (that is, to all the versions of packages that are listed in a certain Release file) or to all of the package versions coming from a particular Internet site, as identified by the site's fully qualified domain name.
  • Общая форма назначает приоритет всем версиям пакета в данном дистрибутиве (то есть, всем версиям пакетов, которые перечислены в определённом файле Release), или всем версиям пакета, прибывающим с определённого Интернет-сайта, который идентифицируется полным доменным именем сайта.
This general-form entry in the APT preferences file applies only to groups of pack>ages. For example, the following record assigns a high priority to all package versions available from the local site.

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

Package: *
Pin: origin ""
Pin-Priority: 999
A note of caution: the keyword used here is «origin». This should not be confused with the Origin of a distribution as specified in a Release file. What follows the «Origin:» tag in a Release file is not an Internet address but an author or vendor name, such as «Debian» or «Ximian».

Предупреждение: ключевое слово, используемое здесь, является «origin». Это не должно быть перепутано с источником (Origin) дистрибутива как это определено в файле Release. Что следует за «Origin»: тег в файле Release не интернет-адрес, а имя автора или поставщика, такое как «Debian» или «Ximian».

The following record assigns a low priority to all package versions belonging to any distribution whose Archive name is «unstable».

Следующая запись присваивает низкий приоритет всем версиям пакета, принадлежащим любому дистрибутиву, имя архива которого является «unstable» («нестабильный»).

Package: *
Pin: release a=unstable
Pin-Priority: 500
The following record assigns a high priority to all package versions belonging to any release whose Archive name is «stable» and whose release Version number is «3.0».

Следующая запись присваивает высокий приоритет всем версиям пакета, принадлежащим любому релизу, имя архива которого «stable» («стабильный») и чей номер версии выпуска «3.0».

Package: *
Pin: release a=stable, v=3.0
Pin-Priority: 500

How APT Interprets Priorities Как APT интерпретирует приоритеты

Priorities (P) assigned in the APT preferences file must be positive or negative integers. They are interpreted as follows (roughly speaking):

Приоритеты (P) назначенные в файле предпочтений APT должны быть положительными или отрицательными целыми числами. Они интерпретируются следующим образом (грубо говоря):

P > 1000
causes a version to be installed even if this constitutes a downgrade of the package

заставляет версию быть установленной, даже если это понижает версию пакета

990 < P <=1000
causes a version to be installed even if it does not come from the target release, unless the installed version is more recent

заставляет версию быть установленной, даже если она не прибывает из целевого выпуска, если установленная версия не более новая

500 < P <=990
causes a version to be installed unless there is a version available belonging to the target release or the installed version is more recent

заставляет версию быть установленной, если нет доступной версии, принадлежащей целевому выпуску или установленная версии более свежая

100 < P <=500
causes a version to be installed unless there is a version available belonging to some other distribution or the installed version is more recent

заставляет версию быть установленной, если нет доступной версии, принадлежащей некоторому другому дистрибутиву или установленная версия более свежая

0 < P <=100
causes a version to be installed only if there is no installed version of the package

заставляет версию быть установленной, только если нет установленной версии пакета

P < 0
prevents the version from being installed

препятствует тому, чтобы версия была установлена.

If any specific-form records match an available package version then the first such record determines the priority of the package version. Failing that, if any general-form records match an available package version then the first such record determines the priority of the package version.

Если какие-либо записи в специфической форме соответствуют доступной версии пакета, то первая такая запись определяет приоритет версии пакета. В противном случае, если какие-либо записи в общей форме соответствуют доступной версии пакета, то первая такая запись определяет приоритет версии пакета.

For example, suppose the APT preferences file contains the three records presented earlier:

Например, предположим, что файл предпочтений APT содержит три записи, представленные ранее:

Package: perl
Pin: version 5.8*
Pin-Priority: 1001

Package: *
Pin: origin ""
Pin-Priority: 999

Package: *
Pin: release unstable
Pin-Priority: 50
Then:

Тогда:

* The most recent available version of the perl package will be installed, so long as that version's version number begins with «5.8». If any 5.8* version of perl is available and the installed version is 5.9*, then perl will be downgraded.
  • Новая доступная версия пакета perl будет установлена, пока номер версии версии будет начинается с «5.8». Если какие-либо 5.8* версии perl будут доступны, и установлена версия 5.9 *, то версия perl будет понижена.
* A version of any package other than perl that is available from the local system has priority over other versions, even versions belonging to the target release.
  • У версии любого пакета, кроме perl, который доступен из локальной системы, есть приоритет над другими версиями, даже если версии принадлежат целевому релизу.
* A version of a package whose origin is not the local system but some other site listed in sources.list(5) and which belongs to an unstable distribution is only installed if it is selected for installation and no version of the package is already installed.
  • Версия пакета, источник которого не локальная система, но некоторый другой сайт, перечисленный в sources.list (5) и который принадлежит нестабильному дистрибутиву, установится только, если он выбран для установки, и никакая версия пакета ещё не установлена.

Determination of Package Version and Distribution Properties Определение свойств версии пакета и дистрибутива

The locations listed in the sources.list(5) file should provide Packages and Release files to describe the packages available at that location.

Места, перечисленные в файле sources.list (5), должны предоставлять файлы Packages и Release, чтобы описать пакеты, доступные в этом месте.

The Packages file is normally found in the directory …/dists/dist-name/component/arch: for example, …/dists/stable/main/binary-i386/Packages. It consists of a series of multi-line records, one for each package available in that directory. Only two lines in each record are relevant for setting APT priorities:

Файл Packages обычно находится в каталоге …/dists/dist-name/component/arch: например …/dists/stable/main/binary-i386/Packages. Он состоит из серии многострочных записей, по одной для каждого пакета, доступного в данном каталоге. Только две строки в каждой записи важны для установки приоритетов APT:

строка Package:
gives the package name

задаёт имя пакета

строка Version:
gives the version number for the named package

задаёт номер версии для именованного пакета

The Release file is normally found in the directory …/dists/dist-name: for example, …/dists/stable/Release, or …/dists/woody/Release. It consists of a single multi-line record which applies to all of the packages in the directory tree below its parent. Unlike the Packages file, nearly all of the lines in a Release file are relevant for setting APT priorities:

Файл Release обычно находится в каталоге …/dists/dist-name: например …/dists/stable/Release, или …/dists/woody/Release. Он состоит из единственной многострочной записи, которая применяется ко всем пакетам в дереве каталогов ниже его родителя. В отличие от файла Packages, почти все строки в файле Release важны для установки приоритетов APT:

строка Archive:
names the archive to which all the packages in the directory tree belong. For example, the line «Archive: stable» specifies that all of the packages in the directory tree below the parent of the Release file are in a stable archive. Specifying this value in the APT preferences file would require the line:

называет архив, которому принадлежат все пакеты в дереве каталогов. Например, строка «Archive: stable» определяет, что все пакеты в дереве каталогов ниже родителя файла Release находятся в архиве stable. Определение этого значения в файле предпочтений APT потребовало бы строки:

Pin: release a=stable
строка Version:
names the release version. For example, the packages in the tree might belong to Debian GNU/Linux release version 3.0. Note that there is normally no version number for the testing and unstable distributions because they have not been released yet. Specifying this in the APT preferences file would require one of the following lines.

называет версию выпуска. Например, пакеты в дереве могли бы принадлежать версии 3.0 выпуска GNU/Linux Debian. Обратите внимание, что обычно не существует номера версии для тестового и нестабильного дистрибутивов, потому что они ещё не были выпущены. Определение этого в файле предпочтений APT потребовало бы одной из следующих строк.

Pin: release v=3.0
Pin: release a=stable, v=3.0
Pin: release 3.0
строка Component:
names the licensing component associated with the packages in the directory tree of the Release file. For example, the line «Component: main» specifies that all the packages in the directory tree are from the main component, which entails that they are licensed under terms listed in the Debian Free Software Guidelines. Specifying this component in the APT preferences file would require the line:

называет компонент лицензирования связанный с пакетами в дереве каталогов файла Release. Например, строка «Component: main» определяет, что все пакеты в дереве каталогов от основного компонента, который влечёт за собой, что им лицензируют в соответствии с условиями, перечисленными в Debian Free Software Guidelines. Определение этого компонента в файле предпочтений APT потребовало бы строки:

Pin: release c=main
строка Origin:
names the originator of the packages in the directory tree of the Release file. Most commonly, this is Debian. Specifying this origin in the APT preferences file would require the line:

называет создателя пакетов в дереве каталогов файла Release. Обычно, это - Debian. Определение этого источника в файле предпочтений APT потребовало бы строки:

Pin: release o=Debian
строка Label:
names the label of the packages in the directory tree of the Release file. Most commonly, this is Debian. Specifying this label in the APT preferences file would require the line:

называет метку пакетов в дереве каталогов файла Release. Обычно, это - Debian. Определение этой метки в файле предпочтений APT потребовало бы строки:

Pin: release l=Debian
All of the Packages and Release files retrieved from locations listed in the sources.list(5) file are stored in the directory /var/lib/apt/lists, or in the file named by the variable Dir::State::Lists in the apt.conf file. For example, the file debian.lcs.mit.edu_debian_dists_unstable_contrib_binary-i386_Release contains the Release file retrieved from the site debian.lcs.mit.edu for binary-i386 architecture files from the contrib component of the unstable distribution.

Все файлы Packages и Release, полученные из мест, перечисленных в файле sources.list (5), сохраняются в каталоге /var/lib/apt/lists, или в файле, названном в переменной Dir::State::Lists в файле apt.conf. Например, файл debian.lcs.mit.edu_debian_dists_unstable_contrib_binary-i386_Release содержит файл Release, полученный с сайта debian.lcs.mit.edu для двоичных-i386 файлов архитектуры от компонента contrib нестабильного дистрибутива.

Optional Lines in an APT Preferences Record Дополнительные строки в записи предпочтений APT

Each record in the APT preferences file can optionally begin with one or more lines beginning with the word Explanation:. This provides a place for comments.

Каждая запись в файле предпочтений APT может дополнительно начинаться с одной или более строк, начинающихся со слова Explanation:. Это обеспечивает место для комментариев.

The Pin-Priority: line in each APT preferences record is optional. If omitted, APT assigns a priority of 1 less than the last value specified on a line beginning with Pin-Priority: release …

Pin-Priority: строка в каждой записи предпочтений APT является дополнительной. Если она опущена, APT присваивает приоритет на 1 меньше чем последнее значение, определённое в строке, начинающейся с Pin-Priority: release …

EXAMPLES ПРИМЕРЫ

Tracking Stable Отслеживание Stable

The following APT preferences file will cause APT to assign a priority higher than the default (500) to all package versions belonging to a stable distribution and a prohibitively low priority to package versions belonging to other Debian distributions.

Следующий файл предпочтений APT заставит APT назначать приоритет выше, чем значение по умолчанию (500) всем версиям пакета, принадлежащим стабильному дистрибутиву и предельно низкий приоритет версиям пакетов, принадлежащих другим дистрибутивам Debian.

Explanation: Uninstall or do not install any Debian-originated
Explanation: package versions other than those in the stable distro
Package: *
Pin: release a=stable
Pin-Priority: 900

Package: *
Pin: release o=Debian
Pin-Priority: -10
With a suitable sources.list(5) file and the above preferences file, any of the following commands will cause APT to upgrade to the latest stable version(s).

С подходящим файлом sources.list (5) и вышеупомянутым файлом предпочтений, любая из следующих команд заставит APT производить обновление до последней стабильной версии(й).

apt-get install имя-пакета
apt-get upgrade
apt-get dist-upgrade
The following command will cause APT to upgrade the specified package to the latest version from the testing distribution; the package will not be upgraded again unless this command is given again.

Следующая команда заставит APT обновить указанный пакет до последней версии из тестового дистрибутива; пакет не будет обновлён ещё раз, пока снова не будет дана данная команда.

apt-get install имя-пакета/testing

Tracking Testing or Unstable Отслеживание Testing или Unstable

The following APT preferences file will cause APT to assign a high priority to package versions from the testing distribution, a lower priority to package versions from the unstable distribution, and a prohibitively low priority to package versions from other Debian distributions.

Следующий файл предпочтений APT заставит APT назначить высокий приоритет версиям пакета из тестового дистрибутива, более низкий приоритет версиям пакетов из нестабильного дистрибутива, и совсем низкий приоритет версиям пакетов Debian из других дистрибутивов.

Package: *
Pin: release a=testing
Pin-Priority: 900

Package: *
Pin: release a=unstable
Pin-Priority: 800

Package: *
Pin: release o=Debian
Pin-Priority: -10
With a suitable sources.list(5) file and the above preferences file, any of the following commands will cause APT to upgrade to the latest testing version(s).

С подходящим файлом sources.list (5) и вышеупомянутым файлом предпочтений, любая из следующих команд заставит APT произвести обновление до последней тестовой версии(й).

apt-get install имя-пакета
apt-get upgrade
apt-get dist-upgrade
The following command will cause APT to upgrade the specified package to the latest version from the unstable distribution. Thereafter, apt-get upgrade will upgrade the package to the most recent testing version if that is more recent than the installed version, otherwise, to the most recent unstable version if that is more recent than the installed version.

Следующая команда заставит APT обновить указанный пакет до последней версии из нестабильного дистрибутива. После того, apt-get upgrade обновит пакет до новой тестовой версии, если она будет более свежей чем установленная версия, иначе, до новой нестабильной версии, если она более свежая чем установленная версия.

apt-get install имя-пакета/unstable

SEE ALSO СМОТРИ ТАКЖЕ

apt-get(8) apt-cache(8) apt.conf(5) sources.list(5)

BUGS ОШИБКИ

APT bug page[1]. If you wish to report a bug in APT, please see /usr/share/doc/debian/bug-reporting.txt or the reportbug(1) command.

Если Вы хотите сообщить об ошибке в APT, пожалуйста, см. /usr/share/doc/debian/bug-reporting.txt или команду reportbug(1).

AUTHOR АВТОР

APT team

REFERENCES ССЫЛКИ

cowork/selfdistr/apt_preferences.txt · Последнее изменение: 2018/08/03 08:01 — dwadmin

Если не указано иное, содержимое этой вики предоставляется на условиях следующей лицензии: GNU Free Documentation License 1.3
GNU Free Documentation License 1.3 Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki