【问题标题】:Is there any setting in the preseed file to ignore the Release 'Valid_Until' option?预置文件中是否有任何设置可以忽略 Release 'Valid_Until' 选项?
【发布时间】:2014-07-30 14:22:02
【问题描述】:

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

# 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 文件在一段时间前过期的事实。但是,我真的需要一种在预置文件中包含相同选项的方法。为此,我一直在寻找可能的解决方案:

  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 部分来处理这些问题。

我可以在 preseed 中使用任何其他解决方案吗?

非常感谢!

【问题讨论】:

  • 你找到了有用的东西吗?你的#2 对你有用吗?有票在:bugs.debian.org/cgi-bin/bugreport.cgi?bug=771699
  • 如果我的上述评论的读者去到工单,回复它,并要求更新议程,工单所有者可能会看到更改将是有用的,并可能重新确定优先级。我希望。

标签: installation debian mirror debian-based debconf


【解决方案1】:

这行得通:

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】:

    遇到同样的问题,也没有找到解决方案,我终于用 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 的

    【讨论】:

    • 这行不通。当partman/early_command 运行时/target 甚至不存在...
    • 这个答案有错误。 chmod 命令针对的是错误的文件。 @Stefan Staedtler 的答案与此答案相同,但已修复错误。
    【解决方案3】:

    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 &
    

    【讨论】:

      猜你喜欢
      • 2020-12-19
      • 2018-06-17
      • 1970-01-01
      • 1970-01-01
      • 2016-04-10
      • 2016-05-08
      • 2020-04-12
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多