Como corrigir a entrada da lista de fontes para buscar debs do local desejado? (Apt Offline Repository)

0

No momento, estou tentando instalar o software off-line (estudando esta pergunta) e quero usar o Repositório off-line de acordo com esta resposta.

Eu segui passos como:

  1. coloque todos os debs em /var/my-local-repo
  2. sudo bash -c 'dpkg-scanpackages /var/my-local-repo /dev/null > /var/my-local-repo/Packages' (nota: dpkg-dev já está instalado para executar esta ação)
  3. definir repositório como raiz por echo "deb file:/var/my-local-repo ./" > /etc/apt/sources.list.d/my-local.list e sudo apt-get update

Mas quando tentei instalar o pacote, os seguintes erros foram exibidos:

Abaixo está o exemplo de saída do terminal durante a instalação do synaptic :

$ sudo apt-get install synaptic
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  docbook-xml libcairo-perl libept1.4.12 libglib-perl libgtk2-perl
  libpango-perl librarian0 rarian-compat sgml-data
Suggested packages:
  docbook docbook-dsssl docbook-xsl docbook-defguide libfont-freetype-perl
  libgtk2-perl-doc perlsgml w3-recs opensp libxml2-utils dwww menu deborphan
  tasksel
The following NEW packages will be installed:
  docbook-xml libcairo-perl libept1.4.12 libglib-perl libgtk2-perl
  libpango-perl librarian0 rarian-compat sgml-data synaptic
0 upgraded, 10 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/3,437 kB of archives.
After this operation, 17.4 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
WARNING: The following packages cannot be authenticated!
  libept1.4.12 sgml-data docbook-xml libcairo-perl libglib-perl libpango-perl
  libgtk2-perl synaptic librarian0 rarian-compat
Install these packages without verification? [y/N] Y
Err file:/var/my-local-repo/ ./ libept1.4.12 1.0.12
  File not found
Err file:/var/my-local-repo/ ./ sgml-data 2.0.9-1
  File not found
Err file:/var/my-local-repo/ ./ docbook-xml 4.5-7.2
  File not found
Err file:/var/my-local-repo/ ./ libcairo-perl 1.104-1
  File not found
Err file:/var/my-local-repo/ ./ libglib-perl 3:1.304-1
  File not found
Err file:/var/my-local-repo/ ./ libpango-perl 1.224-2
  File not found
Err file:/var/my-local-repo/ ./ libgtk2-perl 2:1.249-2
  File not found
Err file:/var/my-local-repo/ ./ synaptic 0.81.1
  File not found
Err file:/var/my-local-repo/ ./ librarian0 0.8.1-5ubuntu1
  File not found
Err file:/var/my-local-repo/ ./ rarian-compat 0.8.1-5ubuntu1
  File not found
E: Failed to fetch file:/var/my-local-repo//var/my-local-repo/libept1.4.12_1.0.12_i386.deb  File not found

E: Failed to fetch file:/var/my-local-repo//var/my-local-repo/sgml-data_2.0.9-1_all.deb  File not found

E: Failed to fetch file:/var/my-local-repo//var/my-local-repo/docbook-xml_4.5-7.2_all.deb  File not found

E: Failed to fetch file:/var/my-local-repo//var/my-local-repo/libcairo-perl_1.104-1_i386.deb  File not found

E: Failed to fetch file:/var/my-local-repo//var/my-local-repo/libglib-perl_3%3a1.304-1_i386.deb  File not found

E: Failed to fetch file:/var/my-local-repo//var/my-local-repo/libpango-perl_1.224-2_i386.deb  File not found

E: Failed to fetch file:/var/my-local-repo//var/my-local-repo/libgtk2-perl_2%3a1.249-2_i386.deb  File not found

E: Failed to fetch file:/var/my-local-repo//var/my-local-repo/synaptic_0.81.1_i386.deb  File not found

E: Failed to fetch file:/var/my-local-repo//var/my-local-repo/librarian0_0.8.1-5ubuntu1_i386.deb  File not found

E: Failed to fetch file:/var/my-local-repo//var/my-local-repo/rarian-compat_0.8.1-5ubuntu1_i386.deb  File not found

E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

Aqui, podemos ver que o apt tenta buscar debs de /var/my-local-repo//var/my-local-repo/ em vez de var/my-local-repo/

E se eu mover todos os debs para /var/my-local-repo/var/my-local-repo/ (criando subdiretórios) então depois que o apt funcionar bem e o pacote estiver instalado! E sináptico funcionando bem.

Então, minha pergunta é Por que o Apt está buscando debs do local errado ou / e qual correção é necessária em echo "deb file:/var/my-local-repo ./" ?

    
por Pandya 10.10.2014 / 13:42

1 resposta

0

Encontrei solução / correção eu mesmo após 1 a 2 dias e correção necessária que está funcionando da seguinte forma:

Como criar Packages.gz por dpkg-scanpackages ?

Caminho 1: -

Se o arquivo Packages.gz for criado pelo seguinte comando:

dpkg-scanpackages /var/my-local-repo | gzip > Packages.gz

Então tem todas as informações de localização de debs como segue:

% bl0ck_qu0te%

Caminho 2 (recomendado): -

Se o arquivo Packages.gz for criado pelo seguinte comando:
(Em outras palavras, depois de mudar para esse diretório contendo todos os debs)

dpkg-scanpackages . | gzip > ./Packages.gz

Então tem todas as informações de localização de debs como segue:

% bl0ck_qu0te%

Agora, se Packages.gz for criado por Way-1, a correção necessária no repositório .list será:

deb file:/// var/my-local-repo/ ou deb file:// /var/my-local-repo/

Mas é recomendado criar Packages.gz por Way-2, então nenhuma correção é necessária e o repositório correto em .list é:

deb file:///var/my-local-repo/ ./ ou deb file:/var/my-local-repo/ ./

Anteriormente, criei Packages.gz pela Way-1 e configurei o repositório para a segunda via, por isso, o apt tenta buscar debs do diretório que não é desejado.

Mas agora eu entendi o motivo e usei a segunda maneira de criar Packages.gz by dpkg-scanpackages e os comandos finais são:

Para gerar Packages.gz :

dpkg-scanpackages . | gzip > ./Packages.gz

Para definir o repositório:

sudo su
echo "deb file:/var/my-local-repo ./" > /etc/apt/sources.list.d/my-local.list
sudo apt-get update

E, em seguida, o pacote foi instalado com êxito, conforme abaixo:

$ sudo apt-get install synaptic
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  docbook-xml libcairo-perl libept1.4.12 libglib-perl libgtk2-perl
  libpango-perl librarian0 rarian-compat sgml-data
Suggested packages:
  docbook docbook-dsssl docbook-xsl docbook-defguide libfont-freetype-perl
  libgtk2-perl-doc perlsgml w3-recs opensp libxml2-utils dwww menu deborphan
  tasksel
The following NEW packages will be installed:
  docbook-xml libcairo-perl libept1.4.12 libglib-perl libgtk2-perl
  libpango-perl librarian0 rarian-compat sgml-data synaptic
0 upgraded, 10 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/3,437 kB of archives.
After this operation, 17.4 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
WARNING: The following packages cannot be authenticated!
  libept1.4.12 sgml-data docbook-xml libcairo-perl libglib-perl libpango-perl
  libgtk2-perl synaptic librarian0 rarian-compat
Install these packages without verification? [y/N] Y
Selecting previously unselected package libept1.4.12:i386.
(Reading database ... 174777 files and directories currently installed.)
Preparing to unpack .../libept1.4.12_1.0.12_i386.deb ...
Unpacking libept1.4.12:i386 (1.0.12) ...
Selecting previously unselected package sgml-data.
Preparing to unpack .../sgml-data_2.0.9-1_all.deb ...
Unpacking sgml-data (2.0.9-1) ...
Selecting previously unselected package docbook-xml.
Preparing to unpack .../docbook-xml_4.5-7.2_all.deb ...
Unpacking docbook-xml (4.5-7.2) ...
Selecting previously unselected package libcairo-perl.
Preparing to unpack .../libcairo-perl_1.104-1_i386.deb ...
Unpacking libcairo-perl (1.104-1) ...
Selecting previously unselected package libglib-perl.
Preparing to unpack .../libglib-perl_3%3a1.304-1_i386.deb ...
Unpacking libglib-perl (3:1.304-1) ...
Selecting previously unselected package libpango-perl.
Preparing to unpack .../libpango-perl_1.224-2_i386.deb ...
Unpacking libpango-perl (1.224-2) ...
Selecting previously unselected package libgtk2-perl.
Preparing to unpack .../libgtk2-perl_2%3a1.249-2_i386.deb ...
Unpacking libgtk2-perl (2:1.249-2) ...
Selecting previously unselected package synaptic.
Preparing to unpack .../synaptic_0.81.1_i386.deb ...
Unpacking synaptic (0.81.1) ...
Selecting previously unselected package librarian0.
Preparing to unpack .../librarian0_0.8.1-5ubuntu1_i386.deb ...
Unpacking librarian0 (0.8.1-5ubuntu1) ...
Selecting previously unselected package rarian-compat.
Preparing to unpack .../rarian-compat_0.8.1-5ubuntu1_i386.deb ...
Unpacking rarian-compat (0.8.1-5ubuntu1) ...
Processing triggers for sgml-base (1.26+nmu4ubuntu1) ...
Processing triggers for man-db (2.6.7.1-1) ...
Processing triggers for gnome-menus (3.10.1-0ubuntu2) ...
Processing triggers for desktop-file-utils (0.22-1ubuntu1) ...
Processing triggers for bamfdaemon (0.5.1+14.04.20140409-0ubuntu1) ...
Rebuilding /usr/share/applications/bamf-2.index...
Processing triggers for mime-support (3.54ubuntu1) ...
Processing triggers for hicolor-icon-theme (0.13-1) ...
Processing triggers for doc-base (0.10.5) ...
Scrollkeeper was installed, forcing re-registration of all documents.
Unregistering 33 doc-base files, re-registering 33 doc-base files...
Registering documents with scrollkeeper...
Setting up libept1.4.12:i386 (1.0.12) ...
Setting up sgml-data (2.0.9-1) ...
Setting up libcairo-perl (1.104-1) ...
Setting up libglib-perl (3:1.304-1) ...
Setting up libpango-perl (1.224-2) ...
Setting up libgtk2-perl (2:1.249-2) ...
Setting up synaptic (0.81.1) ...
Setting up librarian0 (0.8.1-5ubuntu1) ...
Processing triggers for sgml-base (1.26+nmu4ubuntu1) ...
Setting up docbook-xml (4.5-7.2) ...
Processing triggers for sgml-base (1.26+nmu4ubuntu1) ...
Setting up rarian-compat (0.8.1-5ubuntu1) ...
Processing triggers for libc-bin (2.19-0ubuntu6) ...
    
por Pandya 11.10.2014 / 15:49