我如何将“main/dist-upgrader-all”添加到“/etc/apt/mirror.list”以便我的 apt-mirror 下载版本升级的文件?

我如何将“main/dist-upgrader-all”添加到“/etc/apt/mirror.list”以便我的 apt-mirror 下载版本升级的文件?

我使用以下方式维护一个合适的镜像apt-mirror. 它适用于以下软件包仿生的焦点。现在,我想添加使用此镜像执行版本升级所需的文件。/etc/apt/mirror.list我将其添加到main/dist-upgrader-all包含这些文件夹的所有更新源中。

我的/etc/apt/mirror.list当前样子是这样的:

############# config ##################
#
set base_path    /mnt/usb/ubuntu_mirror
#
# set mirror_path  $base_path/mirror
# set skel_path    $base_path/skel
# set var_path     $base_path/var
# set cleanscript $var_path/clean.sh
# set defaultarch  <running host architecture>
# set postmirror_script $var_path/postmirror.sh
# set run_postmirror 0
set nthreads     20
set _tilde 0
#
############# end config ##############

deb-amd64 http://archive.ubuntu.com/ubuntu bionic main restricted universe multiverse main/dist-upgrader-all
deb-amd64 http://archive.ubuntu.com/ubuntu bionic-security main restricted universe multiverse
deb-amd64 http://archive.ubuntu.com/ubuntu bionic-updates main restricted universe multiverse main/dist-upgrader-all
deb-amd64 http://archive.ubuntu.com/ubuntu bionic-backports main restricted universe multiverse

deb-amd64 http://archive.ubuntu.com/ubuntu focal main restricted universe multiverse main/dist-upgrader-all
deb-amd64 http://archive.ubuntu.com/ubuntu focal-security main restricted universe multiverse
deb-amd64 http://archive.ubuntu.com/ubuntu focal-updates main restricted universe multiverse main/dist-upgrader-all
deb-amd64 http://archive.ubuntu.com/ubuntu focal-backports main restricted universe multiverse

clean http://archive.ubuntu.com/ubuntu

添加 之后main/dist-upgrader-all,在处理索引时执行apt-mirror会抛出以下错误:

Downloading 352 index files using 20 threads...
Begin time: Wed Aug  2 12:15:38 2021
[20]... [19]... [18]... [17]... [16]... [15]... [14]... [13]... [12]... [11]... [10]... [9]... [8]... [7]... [6]... [5]... [4]... [3]... [2]... [1]... [0]... 
End time: Wed Aug  2 12:16:01 2021

Processing translation indexes: [TTTTTTTT]

Downloading 1137 translation files using 20 threads...
Begin time: Wed Aug  2 12:16:03 2021
[20]... [19]... [18]... [17]... [16]... [15]... [14]... [13]... [12]... [11]... [10]... [9]... [8]... [7]... [6]... [5]... [4]... [3]... [2]... [1]... [0]... 
End time: Wed Aug  2 12:16:26 2021

Processing DEP-11 indexes: [DDDDDDDD]

Downloading 160 dep11 files using 20 threads...
Begin time: Wed Aug  2 12:16:29 2021
[20]... [19]... [18]... [17]... [16]... [15]... [14]... [13]... [12]... [11]... [10]... [9]... [8]... [7]... [6]... [5]... [4]... [3]... [2]... [1]... [0]... 
End time: Wed Aug  2 12:16:35 2021

Processing indexes: [Papt-mirror: can't open index archive.ubuntu.com/ubuntu//dists/bionic/main/dist-upgrader-all/binary-amd64/Packages in process_index at /usr/bin/apt-mirror line 800.
PPapt-mirror: can't open index archive.ubuntu.com/ubuntu//dists/bionic-updates/main/dist-upgrader-all/binary-amd64/Packages in process_index at /usr/bin/apt-mirror line 800.
PPapt-mirror: can't open index archive.ubuntu.com/ubuntu//dists/focal/main/dist-upgrader-all/binary-amd64/Packages in process_index at /usr/bin/apt-mirror line 800.
PPapt-mirror: can't open index archive.ubuntu.com/ubuntu//dists/focal-updates/main/dist-upgrader-all/binary-amd64/Packages in process_index at /usr/bin/apt-mirror line 800.
P]

那么,我做错了什么?如何才能成功将文件添加main/dist-upgrader-all到我的镜像中,以便使用此镜像的客户端可以执行发布升级?

答案1

dist-upgrader-all目录不是 apt 存储库,但可以使用脚本通过 apt-mirror 进行镜像postmirror.sh

以下几行可以添加到postmirror.sh脚本中,以镜像dist-upgrader-all焦点的目录。postmirror.sh脚本在目录中运行$base_path/mirror并使用相对路径。

mkdir -p archive.ubuntu.com/ubuntu/dists/focal/main/dist-upgrader-all/
rsync --recursive --times --links --hard-links --delete --delete-after rsync://archive.ubuntu.com/ubuntu/dists/focal/main/dist-upgrader-all/ archive.ubuntu.com/ubuntu/dists/focal/main/dist-upgrader-all/

使用 rsync 是示例postmirror.sh脚本中展示的一种技术在 apt-mirror 存储库中。它表明 rsync 可用于镜像 apt 存储库中的各种额外目录,包括debian-installerdist-upgrader-allinstaller-amd64installer-i386路径。

相关内容