安全库'http://security.debian.org/debian-security buster/updates InRelease'将其'Suite'值从'stable'更改为'oldstable'。

142

最近我的一些 GitHub Actions 工作流在安装 Chromedriver 时开始返回以下错误:

Get:1 http://security.debian.org/debian-security buster/updates InRelease [65.4 kB]
Get:2 http://deb.debian.org/debian buster InRelease [122 kB]
Get:3 http://deb.debian.org/debian buster-updates InRelease [51.9 kB]
Reading package lists...
E: Repository 'http://security.debian.org/debian-security buster/updates InRelease' changed its 'Suite' value from 'stable' to 'oldstable'
E: Repository 'http://deb.debian.org/debian buster InRelease' changed its 'Suite' value from 'stable' to 'oldstable'
E: Repository 'http://deb.debian.org/debian buster-updates InRelease' changed its 'Suite' value from 'stable-updates' to 'oldstable-updates'
Error: Process completed with exit code 100.

这是我的步骤实现:


jobs:
  build:
    runs-on: ubuntu-latest
    container:
        image: docker://guillaumefalourd/ritchiecli:py-3.8
    steps:
      - name: Install Chrome Driver
        run: |
            sudo apt-get update
            sudo apt-get install -y unzip xvfb libxi6 libgconf-2-4 gnupg2
            sudo curl -sS -o - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add
            sudo echo "deb https://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list
            sudo apt-get -y update
            sudo apt-get -y install google-chrome-stable
            wget -N https://chromedriver.storage.googleapis.com/89.0.4389.23/chromedriver_linux64.zip -P ~/
            unzip ~/chromedriver_linux64.zip -d ~/
            rm ~/chromedriver_linux64.zip
            sudo mv -f ~/chromedriver /usr/local/bin/chromedriver
            sudo chown root:root /usr/local/bin/chromedriver
            sudo chmod 0755 /usr/local/bin/chromedriver

Docker镜像实现:docker://guillaumefalourd/ritchiecli:py-3.8

我尝试了什么

  1. I read from here and here that adding sudo apt-get --allow-releaseinfo-change update or sudo apt-get dist-upgrade could resolve the problem, but even adding those to my workflow didn't resolve it.

  2. I tried using this action setup-chromedriver but it returned the same error when following the documentation:

    steps:
    - uses: actions/checkout@v2
    - uses: nanasess/setup-chromedriver@master
      with:
        # Optional: do not specify to match Chrome's version
        chromedriver-version: '88.0.4324.96'
    - run: |
        export DISPLAY=:99
        chromedriver --url-base=/wd/hub &
        sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 & # optional
    
  3. As it seems to be related to Debian 10 (Buster) (?) I also tried to use another Ubuntu runner version as a runner (ubuntu-18.04 instead of ubuntu-latest), but nothing changed, same error.

我该如何解决这个问题?



答案

我后来发现问题出现在第一个命令:sudo apt-get update(而我是在添加其他命令之后...)。

将其替换为sudo apt-get --allow-releaseinfo-change update解决了我的问题。

因此,答案不是将sudo apt-get --allow-releaseinfo-change update添加到执行的命令步骤中,而是用它替换sudo apt-get update命令。

jobs:
  build:
    runs-on: ubuntu-latest
    container:
        image: docker://guillaumefalourd/ritchiecli:py-3.8
    steps:
      - name: Install Chrome Driver
        run: |
            sudo apt-get --allow-releaseinfo-change update
            sudo apt-get install -y unzip xvfb libxi6 libgconf-2-4 gnupg2
            sudo curl -sS -o - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add
            sudo echo "deb https://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list
            sudo apt-get -y update
            sudo apt-get -y install google-chrome-stable
            wget -N https://chromedriver.storage.googleapis.com/89.0.4389.23/chromedriver_linux64.zip -P ~/
            unzip ~/chromedriver_linux64.zip -d ~/
            rm ~/chromedriver_linux64.zip
            sudo mv -f ~/chromedriver /usr/local/bin/chromedriver
            sudo chown root:root /usr/local/bin/chromedriver
            sudo chmod 0755 /usr/local/bin/chromedriver

1
如果你想要稳定版(不会变动),在源列表中使用“stable”,否则使用发行版名称。注意:如果你从其他地方获取到了错误的数据,可以使用“sed”命令进行更正。因此,请检查你的/etc/apt/sources.list*文件。 - Giacomo Catenazzi
3
注:这很可能是因为Debian刚刚发布了“bullseye”版本(https://www.debian.org/News/2021/20210814),所以Buster进入了LTS - https://wiki.debian.org/LTS。 - jrg
"apt upgrade" 对我解决了这个问题。 - jchook
3个回答

175

我知道你已经尝试过了

apt-get --allow-releaseinfo-change update

但是对我而言它有效果。

这是我的Dockerfile命令:

wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
&& sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \
&& apt-get --allow-releaseinfo-change update \
&& apt-get install -y google-chrome-unstable \
   --no-install-recommends \
&& rm -rf /var/lib/apt/lists/*

不必要的: rm -rf /var/lib/apt/lists/*


7
谢谢您的回答。我后来观察到问题出现在第一个命令:sudo apt-get update(我是在之后添加了另一个命令...)。只需将其替换为sudo apt-get --allow-releaseinfo-change update即可解决我的问题 :) - GuiFalourd
1
以前它不存在,然后突然需要使用 apt-get --allow-releaseinfo-change update 命令来消除错误!有人能简要解释一下吗? - aderchox
正是我Buster系统所需要的。截至我写这篇文章时,我的系统正在更新263个软件包,并进行了几项额外的安全更新。A++ - user9329083

34
FWIW,您可以通过添加“专家选项”来减少使用此选项(--allow-releaseinfo-change)的风险,以限制允许绕过apt-secure的字段。来自man apt-get:
专家选项(--allow-releaseinfo-change-field)存在,仅允许更改某些字段,如origin、label、codename、suite、version和defaultpin。另请参阅apt_preferences(5)。
例如,在Debian和其派生的RPi OS之间由于bullseye延迟发布而创建的当前问题中,专家选项将是suite。这是因为buster中的suite标签已从stable更改为oldstable:
$ sudo apt-get --allow-releaseinfo-change-suite update

2
这个答案对我来说更好,因为允许的发布信息更改仅限于特定的字段套件,没有其他更多的限制。 - Eike

7

注意

这是从serverfault.com转载的。

因为我无法通过接受的答案apt-get --allow-releaseinfo-change-suite update解决问题,而且接受的答案存在安全隐患,实际上也没有解决apt从错误的仓库获取安全更新的根本问题,所以我觉得这里也很相关。

问题

在Debian Stretch(9)Docker镜像上遇到了此问题。

运行apt-get update时出现以下错误:

W: The repository 'http://security.debian.org/debian-security stretch/updates Release' does not have a Release file.
W: The repository 'http://deb.debian.org/debian stretch Release' does not have a Release file.
W: The repository 'http://deb.debian.org/debian stretch-updates Release' does not have a Release file.
E: Failed to fetch http://security.debian.org/debian-security/dists/stretch/updates/main/binary-amd64/Packages  404  Not Found [IP: xx]
E: Failed to fetch http://deb.debian.org/debian/dists/stretch/main/binary-amd64/Packages  404  Not Found
E: Failed to fetch http://deb.debian.org/debian/dists/stretch-updates/main/binary-amd64/Packages  404  Not Found
E: Some index files failed to download. They have been ignored, or old ones used instead.

背景

这与安全仓库相关。

这些仓库定义被apt用来获取更新,它们被定义在/etc/apt/sources.list中。

官方的Debian安全建议 - https://www.debian.org/security/

To keep your Debian operating system up-to-date with security patches, please add the following line to your /etc/apt/sources.list file

`deb http://security.debian.org/debian-security bullseye-security main contrib non-free`

答案

在Dockerfile中添加这行代码

RUN echo "deb http://security.debian.org/debian-security bullseye-security main contrib non-free" > /etc/apt/sources.list

RUN apt-get update

其他解决方案

对我不起作用的方法:

  • 将仓库更改为stable-security
  • 使用apt --allow-releaseinfo-change标志运行 - 与apt-get update配对的标志无法识别

其他可行的方法:

  • 可以使用stretch档案仓库而不是bullseye安全仓库 deb http://archive.debian.org/debian stretch main contrib non-free; 从安全角度来看最新版本的安全性更好

更新

以上内容正确,如果您只关注安全仓库问题。

为什么我们要遇到这些安全仓库的问题?

在我的情况下,Debian 9是一个已归档、不受支持、未维护的版本。

尽管我可以“修复”(绕过)安全仓库,但我还面临APT的依赖仓库问题。由于该版本已过时,这些仓库需要指向archive。

总的来说,这迫使我升级到Debian 10。 在Debian 10上,我不需要上述修复。


我曾经遇到过一个旧的PHP Docker镜像的问题,只有添加stretch存档库才能解决。 - Ogrim
@Ogrim 很高兴它能正常运行,但尽快升级到基本的LTS版本。当前状态会冻结安全更新,这将使您容易受到未来的攻击。 - alanionita

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接