install package a partir de distribuições específicas com repositório privado apt?

3

então estou hospedando um repositório particular do apt.

a hierarquia é assim:

├── stable
│   ├── main
│   │   └── binary-all
│   │       ├── Packages
│   │       └── mypackage_2.3.1_all.deb
│   ├── Release
│   └── Release.gpg
└── unstable
    ├── main
    │   └── binary-all
    │       ├── Packages
    │       └── mypackage_2.3.2_all.deb
    ├── rc
    │   └── binary-all
    │       ├── Packages
    │       └── mypackage_2.3.2_all.deb
    ├── Release
    └── Release.gpg

meu arquivo de origem é assim:

deb [arch=all] https://user:[email protected]/ stable main
deb [arch=all] https://user:[email protected]/ unstable main rc

apt-cache policy mypackage

mypackage:
  Installed: (none)
  Candidate: 2.3.2
  Version table:
     2.3.2 500
        500 https://my.apt-server.com unstable/main all Packages
        500 https://my.apt-server.com unstable/rc all Packages
     2.3.1 500
        500 https://my.apt-server.com stable/main all Packages

estável Release conteúdo do arquivo (sem hashes):

Date: Wed, 12 Oct 2016 09:29:19 UTC
MD5Sum:
                 0 Release
               707 main/binary-all/Packages
SHA1:
                 0 Release
               707 main/binary-all/Packages
SHA256:
                 0 Release
               707 main/binary-all/Packages
SHA512:
                 0 Release
               707 main/binary-all/Packages

instável Release conteúdo do arquivo (sem hashes):

Date: Wed, 12 Oct 2016 09:29:27 UTC
MD5Sum:
                 0 Release
               709 main/binary-all/Packages
               705 rc/binary-all/Packages
SHA1:
                 0 Release
               709 main/binary-all/Packages
               705 rc/binary-all/Packages
SHA256:
                 0 Release
               709 main/binary-all/Packages
               705 rc/binary-all/Packages
SHA512:
                 0 Release
               709 main/binary-all/Packages
               705 rc/binary-all/Packages

o problema é, quando tento instalar a partir de stable executando o comando:
sudo apt-get install -t stable mypackage

ainda instala o pacote mais recente da unstable / main mypackage_2.3.2_all.deb
e não o pacote de stable / main mypackage_2.3.1_all.deb

eu também tentei fixar ( desta resposta )
criou um arquivo em /etc/apt/preferences.d com:

Package: *
Pin: release n=unstable
Pin-Priority: 50

mas ainda é instalada uma versão superior da unstable.
O que estou fazendo errado?

    
por Urban48 12.10.2016 / 11:55

1 resposta

2

Seus arquivos Release devem conter um cabeçalho Codename para permitir a fixação pelo nome do lançamento. De man apt_preferences :

The Release file is normally found in the directory .../dists/dist-name: for
example, .../dists/stable/Release, or .../dists/wheezy/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:

[...]

the Codename: line
    names the codename to which all the packages in the directory tree belong.
    For example, the line "Codename: jessie" specifies that all of the packages
    in the directory tree below the parent of the Release file belong to a
    version named jessie. Specifying this value in the APT preferences file would
    require the line:

        Pin: release n=jessie

Veja referência o arquivo Release do repositório oficial do Xenial .

    
por fkraiem 12.10.2016 / 15:51