我刚配置了一个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文件中包含相同的选项。为此,我一直在寻找可能的解决方案:
这位德国开发商似乎受到同样的影响(https://lists.debian.org/debian-user-german/2012/04/msg00382.html)。基本上,他建议尝试添加:
d-i apt-setup/check_valid_until boolean false
但我尝试了这个选项,但没有成功。
我考虑在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部分准备处理这些问题。
我可以在preseed中使用其他任何解决方案吗?
非常感谢!
答案 0 :(得分: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
答案 1 :(得分: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
答案 2 :(得分:0)
d-i预置/运行字符串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 &