apt-mirror 无法读取和使用 http://archive.ubuntu.com/ubuntu/dists/jammy/Release 文件

apt-mirror 无法读取和使用 http://archive.ubuntu.com/ubuntu/dists/jammy/Release 文件

我对 apt-mirror 有一个问题。

我正在尝试为我的公司建立一个内部 Ubuntu 镜像。

我的公司使用 Squid 代理:内部 IP 10.###.###.5:3128 我们的代理不需要用户/密码。

我正在运行 Ubuntu。

DISTRIB_RELEASE=22.04
DISTRIB_CODENAME=jammy
Linux ber-app-29v 6.5.0-21-generi

apt-get install负责添加evn变量

export http_proxy="http://10.###,###.5:3128"
export https_proxy="https://10.###,###.5:3128"
export ftp_proxy="http://10.###,###.5:3128"

所以我可以sudo apt update。我一直在寻找解决方案,并找到了此页面:https://askubuntu.com/questions/1443194/apt-mirror-error/1448476 因此将其添加到文件中。

/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

代理文件/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/";

我已经用 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本身也在起作用apt update

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.

但这一切都apt-mirror中断了。

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

apt-mirror 第 507 行和第 653 行

    unless ( open STREAM, "<$release_path" )
{
    warn( "Failed to open Release file from " . $release_uri );
    return;
}

apt-mirror 行 800

    unless ( open STREAM, "<$path/$index" )
{
    warn("apt-mirror: can't open index $path/$index in process_index");
    return;
}

那么什么是别的错了吗?我没什么可检查的了。所有部分都按预期工作,但不是全部(apt-mirror)。

我是否遗漏了其他实用程序或设置?

答案1

我是apt-mirror2
要使用 apt-mirror 的代理,您应该使用mirror.list配置:

use_proxy             on
## If proxy scheme is ommited, `http://` assumed
http_proxy            http://10.###.###.5:3128
https_proxy           http://10.###.###.5:3128

请注意,apt-mirror 中存在几个问题,这些问题已在 apt-mirror2 中修复。

答案2

现在它工作正常了。我可以通过我的代理工作。该set命令需要包含在代理设置中然后我就可以镜像 Unbutu 存档(全部 725 GB)。

# to access to repo list at http://archive.ubuntu.com/ubuntu/
set no_check_certificate 1


# adding proxy setting here
set use_proxy   on
set http_proxy  http://10.###.###.5:3128
set https_proxy https://10.###.###.5:3128
set ftp_proxy   http://10.###.###.5:3128

这是一个很长的下载过程。@11 Kbps 花了 18 个小时才完成。我怀疑所有的存档文件都已获取(源文件,以及其他我不需要的文件)。我将手动清除它们。

相关内容