Por que isso não é possível fixar o stick?

7

Eu gostaria de preferir a instalação no nginx de squeeze-backports sobre o mainline stable. Eu tenho o repositório de backports ativado. Eu tenho este arquivo de preferências:

# /etc/apt/preferences.d/nginx
Package: nginx nginx-common
Pin: release a=squeeze-backports
Pin-Priority: 999

Definir o destino funciona especificamente conforme o esperado:

# aptitude install -t squeeze-backports nginx
The following NEW packages will be installed:
  libgd2-noxpm{a} libgeoip1{a} libjpeg62{a} libpcre3{a} libxml2{a} libxslt1.1{a} nginx nginx-common{a} nginx-full{a} 
The following packages are RECOMMENDED but will NOT be installed:
  geoip-database xml-core 
0 packages upgraded, 9 newly installed, 0 to remove and 39 not upgraded.
Need to get 828 kB/2,235 kB of archives. After unpacking 4,985 kB will be used.
Do you want to continue? [Y/n/?]

mas o destino sans não:

# aptitude install nginx
The following NEW packages will be installed:
  libgeoip1{a} libpcre3{a} nginx 
The following packages are RECOMMENDED but will NOT be installed:
  geoip-database 
0 packages upgraded, 3 newly installed, 0 to remove and 25 not upgraded.
Need to get 339 kB/694 kB of archives. After unpacking 1,667 kB will be used.
Do you want to continue? [Y/n/?]

apt_preferences (5) detalha o algoritmo para decidir qual versão do pacote instalar:

If the target release has been specified then APT uses the following algorithm to set the priorities of the versions of a package. Assign:

priority 1 :: to the versions coming from archives which in their Release files are marked as "NotAutomatic: yes" but not as "ButAutomaticUpgrades: yes" like the debian experimental archive.

priority 100 :: to the version that is already installed (if any) and to the versions coming from archives which in their Release files are marked as "NotAutomatic: yes" and "ButAutomaticUpgrades: yes" like the debian backports archive since squeeze-backports.

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, except versions coming from archives which in their Release files are marked as "NotAutomatic: yes" - these versions get the priority 1 or priority 100 if it is additionally marked as "ButAutomaticUpgrades: yes".

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

  • 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.)

  • Install the highest priority version.

Você pode ler o artigo completo aqui . Pelo que entendi, a prioridade 999 é a atual prioridade mais alta e o nginx do squeeze-backports deve ser favorecido. É claramente não é. Talvez o diabo esteja nos detalhes - eu não tenho certeza se o pacote nginx está marcado como NotAutomatic ou ButAutomaticUpgrades ou como determinar isso - mas os exemplos mais tarde na manpage sugerem que eu fiz a coisa correta. Ainda

# apt-cache policy nginx
nginx:
  Installed: (none)
  Candidate: 1.1.8-2~bpo60+1
  Package pin: 1.1.8-2~bpo60+1
  Version table:
     1.1.8-2~bpo60+1 999
        100 http://backports.debian.org/debian-backports/ squeeze-backports/main i386 Packages
     0.7.67-3+squeeze1 999
        500 http://debian.osuosl.org/debian/ squeeze/main i386 Packages

Prioridade 100 para o pacote que desejo. O que dá?

    
por troutwine 31.01.2012 / 04:22

1 resposta

4

É possível que você esteja sendo mordido por este bug ?

On a mixed sid/testing system, the same text behaves differently whether placed in /etc/apt/preferences or in /etc/apt/preferences.d/pinning.

apt-get respects files placed in either location, and apt-cache policy also shows the expected behavior. aptitude alone behaves this way.

I saw the same behavior on version 0.4.11.11-1+b2, and tried upgrading to 0.6.1.3-3 to see if it was fixed in sid, but the misbehavior remains.

De acordo com a atualização mais recente, isso é fixed in aptitude 0.6.3-3.2

    
por 31.01.2012 / 04:46

Tags