Eu tenho um problema com o apt-mirror.
Estou tentando configurar um espelho interno do Ubuntu para minha empresa.
Minha empresa usa um proxy Squid: IP interno 10.###.###.5:3128 Nosso proxy não precisa de usuário/senha.
Estou executando o Ubuntu.
DISTRIB_RELEASE=22.04
DISTRIB_CODENAME=jammy
Linux ber-app-29v 6.5.0-21-generi
Eu apt-get install
trabalho com adição evn
de variáveis
export http_proxy="http://10.###,###.5:3128"
export https_proxy="https://10.###,###.5:3128"
export ftp_proxy="http://10.###,###.5:3128"
Então eu posso sudo apt update
. Estou procurando uma solução e encontrei esta página: https://askubuntu.com/questions/1443194/apt-mirror-error/1448476
Então adicionei-a ao arquivo.
O/ets/apt/mirror.list
{ ############# config ##################
#
set base_path /usr/share/nginx/html/repo/Ubuntu
### More commented values
# set run_postmirror 0
set nthreads 20
set _tilde 0
# to access to repo list at http://archive.ubuntu.com/ubuntu/
set no_check_certificate 1
# Jammy 22.04
deb http://archive.ubuntu.com/ubuntu/ jammy main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ jammy-updates main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ jammy-security main restricted universe
deb http://archive.ubuntu.com/ubuntu/ jammy-backports main restricted universe
#Focal 20.04
deb http://archive.ubuntu.com/ubuntu/ focal main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ focal-updates main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ focal-security main restricted universe
deb http://archive.ubuntu.com/ubuntu/ focal-backports main restricted universe
clean http://archive.ubuntu.com/ubuntu
O arquivo proxy/ets/apt/apt.conf.d/90curtin-aptproxy
# Proxysetting for apt
Acquire::http::Proxy "http://10.###.###.5:3128/";
Acquire::https::Proxy "https://10.###.###.5:3128/";
Acquire::tcp::Proxy "tcp://10.###.###.5:3128/";
Eu testei com ambos curl:
url -v --insecure http://archive.ubuntu.com/ubuntu/dists/jammy/Release 1>/dev/null
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Last-Modified: Thu, 21 Apr 2022 17:16:39 GMT
< Content-Length: 269219
< Date: Thu, 07 Mar 2024 13:10:40 GMT
wget http://archive.ubuntu.com/ubuntu/dists/xenial/Release
--2024-03-07 12:58:17-- http://archive.ubuntu.com/ubuntu/dists/xenial/Release Connecting to 10.246.214.5:3128... connected.
Proxy request sent, awaiting response... 200 OK
Length: 245864 (240K)
Saving to: ‘Release.1’
2024-03-07 12:58:18 (176 MB/s) - ‘Release.1’ saved [245864/245864]
apt-get
em si está funcionando e apt update
também.
sudo apt-get install mc
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
libssh2-1 mc-data unzip
Suggested packages:
...
Scanning processes...
Scanning linux images...
Running kernel seems to be up-to-date.
No services need to be restarted.
No containers need to be restarted.
No user sessions are running outdated binaries.
No VM guests are running outdated hypervisor (qemu) binaries on this host.
Mas com tudo isso apt-mirror
quebra.
sudo apt-mirror
Downloading 304 index files using 20 threads...
Begin time: Thu Mar 7 13:44:42 2024
[20]... [19]... [18]... [17]... [16]... [15]... [14]... [13]... [12]... [11]... [10]... [9]... [8]... [7]... [6]... [5]... [4]... [3]... [2]... [1]... [0]...
End time: Thu Mar 7 13:44:42 2024
Failed to open Release file from http://archive.ubuntu.com/ubuntu/dists/jammy/Release at /usr/bin/apt-mirror line 507.
Failed to open Release file from http://archive.ubuntu.com/ubuntu/dists/jammy/Release at /usr/bin/apt-mirror line 507.
Failed to open Release file from http://archive.ubuntu.com/ubuntu/dists/jammy/Release at /usr/bin/apt-mirror line 507.
Failed to open Release file from http://archive.ubuntu.com/ubuntu/dists/jammy/Release at /usr/bin/apt-mirror line 507.
...
Also for line 653, 800
linha apt-mirror 507 e 653
unless ( open STREAM, "<$release_path" )
{
warn( "Failed to open Release file from " . $release_uri );
return;
}
linha apt-mirror 800
unless ( open STREAM, "<$path/$index" )
{
warn("apt-mirror: can't open index $path/$index in process_index");
return;
}
Então, o que mais está errado? Estou ficando sem ideias para verificar. Todas as peças estão funcionando conforme o esperado, mas não o todo (apt-mirror).
Há outro utilitário ou configuração que estou faltando?
Eu sou o autor do apt-mirror2 .
Para usar proxy para apt-mirror você deve usar
mirror.list
a configuração:Por favor, note que existem vários problemas no apt-mirror que foram corrigidos no apt-mirror2.
Agora está funcionando. Consegui trabalhar através do meu proxy. O
set
comando precisa ser incluído nas configurações de proxy. Então consegui espelhar o arquivo Unbutu (todos os 725 GB).É um download longo para ser executado. @ 11 Kbps, demorou 18 horas para terminar. Suspeito que todos os arquivos compactados foram buscados (fonte e outros arquivos que não precisarei. Vou eliminá-los manualmente.