最近想在公司内部搭建一个 ubuntu apt 仓库,一开始尝试用 apt-mirror 搭建本地仓库(20.04.4 LTS),在解决了 apt-mirror 的一些 bug 之后,成功搭建了 Ubuntu 20.04 LTS 的本地仓库,但是 Ubuntu 20.04.2 LTS 无法使用这个仓库,只有 20.04.4 LTS 可以使用,不知道问题出在哪里,如何搭建一个 20.04 所有版本都可以使用的仓库(不关心小版本)?
root@ubuntu:~# cat /etc/apt/mirror.list
############# config ##################
#
# set base_path /var/spool/apt-mirror
set base_path /opt/apt-mirror/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 defaultarch amd64
# set postmirror_script $var_path/postmirror.sh
# set run_postmirror 0
set nthreads 20
set _tilde 0
#
############# end config ##############
#deb http://cn.archive.ubuntu.com/ubuntu artful main restricted universe multiverse
#deb http://cn.archive.ubuntu.com/ubuntu artful-security main restricted universe multiverse
#deb http://cn.archive.ubuntu.com/ubuntu artful-updates main restricted universe multiverse
#deb http://archive.ubuntu.com/ubuntu artful-proposed main restricted universe multiverse
#deb http://archive.ubuntu.com/ubuntu artful-backports main restricted universe multiverse
#deb-src http://archive.ubuntu.com/ubuntu artful main restricted universe multiverse
#deb-src http://archive.ubuntu.com/ubuntu artful-security main restricted universe multiverse
#deb-src http://archive.ubuntu.com/ubuntu artful-updates main restricted universe multiverse
#deb-src http://archive.ubuntu.com/ubuntu artful-proposed main restricted universe multiverse
#deb-src http://archive.ubuntu.com/ubuntu artful-backports main restricted universe multiverse
deb-amd64 http://mirrors.bfsu.edu.cn/ubuntu/ focal main restricted universe multiverse
# deb-src https://mirrors.bfsu.edu.cn/ubuntu/ focal main restricted universe multiverse
deb-amd64 http://mirrors.bfsu.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
# deb-src https://mirrors.bfsu.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
deb-amd64 http://mirrors.bfsu.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
# deb-src https://mirrors.bfsu.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
deb-amd64 http://mirrors.bfsu.edu.cn/ubuntu/ focal-security main restricted universe multiverse
# deb-src https://mirrors.bfsu.edu.cn/ubuntu/ focal-security main restricted universe multiverse
clean http://archive.ubuntu.com/ubuntu
答案1
如果您保持系统更新,20.04.2 和 20.04.4 之间应该没有任何区别 - 关键版本是生成新 ISO 时。安装所有更新后,系统应该没有任何功能差异。因此,如果 20.04.2 系统无法使用您的存储库,则您的系统存在问题(或者更可能是您的管理方式存在问题)。首先修复它。