预置文件中是否有任何设置忽略Release'valid_Until'选项?

问题描述 投票:1回答:3

我刚刚配置了一个preseed文件来包含一个本地存储库。

# Debian mirrors
d-i apt-setup/local0/comment string local mirror
d-i apt-setup/local0/repository string http://<repo_url>
d-i apt-setup/local0/key string http://<repo_key>

我在这里遇到的主要问题是repo没有添加到sources.list,因为Releases文件在几天前过期了,所以我无法获取我需要的一些软件包。

我知道有这个选项可以添加到apt.conf文件中:

Acquire::Check-Valid-Until "false"

这将忽略Releases文件在不久前到期的事实。但是,我真的需要一种方法在preseed文件中包含相同的选项。为此,我一直在寻找可能的解决方案:

  1. 这个德国开发商似乎受到了同样的影响(https://lists.debian.org/debian-user-german/2012/04/msg00382.html)。基本上,他建议尝试添加: d-i apt-setup/check_valid_until boolean false 但我尝试过这个选项,但并没有成功。
  2. 我想在late_command阶段包含一些内容来相应地更新sources.list(即执行 in-target echo <my_mirror_information> >> /etc/apt/sources.list.d/custom.list in-target apt-get -o Acquire::Check-Valid-Until="false" update in-target apt-get upgrade

但是,我确实认为这不是解决问题的正确方法,因为有一个apt-setup部分准备处理这些问题。

我还可以在预售中使用其他解决方案吗?

非常感谢你!

installer debian mirror debian-based debconf
3个回答
0
投票

遇到同样的问题而没有找到解决方案,我终于使用preseed工作:

d-i partman/early_command string echo "echo 'Acquire::Check-Valid-Until \"false\";' > /target/etc/apt/apt.conf.d/02IgnoreValidUntil" > /usr/lib/apt-setup/generators/02IgnoreValidUntil ; chmod +x /target/etc/apt/apt.conf.d/02IgnoreValidUntil

这是Debian / Jessie的


0
投票

这有效:

d-i partman/early_command string echo "echo 'Acquire::Check-Valid-Until \"false\";' > /target/etc/apt/apt.conf.d/02IgnoreValidUntil" > /usr/lib/apt-setup/generators/02IgnoreValidUntil ; chmod +x /usr/lib/apt-setup/generators/02IgnoreValidUntil

0
投票

d -i preseed / run string script.sh

在“script.sh”里面:

fix_apt_repo_expire()
{
local APT_DIR="/target/etc/apt/apt.conf.d"
while [ ! -d "$APT_DIR" ]; do sleep 1; done
echo 'Acquire::Check-Valid-Until "false";' > "$APT_DIR"/90ignore-repo-expiry
}

fix_apt_repo_expire &
© www.soinside.com 2019 - 2024. All rights reserved.