3

我的 Bitbucket Pipelines 配置了一段时间,但今天我的构建开始在apt-get命令上失败:

我使用 java 8 泊坞窗图像:

 image: java:8

我需要安装python

 # Install python
 - echo "Install python"
 - apt-get update
 - apt-get install python-pip -q -y

并且构建开始在“apt-get”命令上失败:

+ apt-get update
Get:1 http://security.debian.org jessie/updates InRelease [44.9 kB]
Ign http://deb.debian.org jessie InRelease
Ign http://deb.debian.org jessie-updates InRelease
Ign http://deb.debian.org jessie-backports InRelease
Get:2 http://deb.debian.org jessie Release.gpg [2420 B]
Ign http://deb.debian.org jessie-updates Release.gpg
Ign http://deb.debian.org jessie-backports Release.gpg
Get:3 http://deb.debian.org jessie Release [148 kB]
Ign http://deb.debian.org jessie-updates Release
Ign http://deb.debian.org jessie-backports Release
Err http://deb.debian.org jessie-backports/main amd64 Packages

Get:4 http://security.debian.org jessie/updates/main amd64 Packages [822 kB]
Get:5 http://deb.debian.org jessie/main amd64 Packages [9098 kB]
Err http://deb.debian.org jessie-updates/main amd64 Packages
404  Not Found
Err http://deb.debian.org jessie-backports/main amd64 Packages
404  Not Found
Fetched 10.1 MB in 7s (1395 kB/s)
W: Failed to fetch http://deb.debian.org/debian/dists/jessie-updates/main/binary-amd64/Packages  404  Not Found

W: Failed to fetch http://deb.debian.org/debian/dists/jessie-backports/main/binary-amd64/Packages  404  Not Found

E: Some index files failed to download. They have been ignored, or old ones used instead.
Skipping cache upload for failed step
Searching for test report files in directories named [test-results, failsafe-reports, test-reports, surefire-reports] down to a depth of 4
Finished scanning for test reports. Found 0 test report files.
Merged test suites, total number tests is 0, with 0 failures and 0 errors.

有什么改变吗?我需要调整我的配置吗?

4

5 回答 5

3

正如引用的其他答案一样,Jessie 和 Wheezy 存储库已从其正常位置中删除。当尝试apt-get update在某些 Docker 镜像上运行时,这将导致 404 错误。

除非您从 Docker 映像中有非常具体的需求,否则我建议您将其更改为使用 Debian Stretch 存储库的映像。

在您的情况下,对于java:8图像,这已被弃用,取而代之的是openjdk 图像。我已经测试openjdk:8并看到它使用 Stretch 并且运行apt-get update良好。

我还在Atlassian 社区上写了一篇官方帖子,其中包含类似的详细信息。如果我们发现任何其他可能与解决此问题相关的内容,我们将更新这篇文章。

于 2019-03-27T10:00:49.680 回答
1

由于年龄原因,Jessie 和 Wheezy 已从其正常的回购位置中删除。

请参阅此问题的解决方案:https ://unix.stackexchange.com/questions/508724/failed-to-fetch-jessie-backports-repository

于 2019-03-26T21:05:04.727 回答
0

我使用的是 maven:3.6.3 Docker 映像,也遇到了这个问题。Docker 映像现在似乎是基于 Red Hat 的,但不包括 yum。只能使用 rpm,因此可以选择手动下载 rpm 包并使用 rpm 或使用不同的 Docker 映像作为基础。

于 2021-12-17T22:29:56.427 回答
0

也遇到了这个问题(因为它在管道的机器上,甚至不是我自己的机器上)。

我在 apt-get update 之前运行了这个:sed -i '/jessie-updates/d' /etc/apt/sources.list

我的 pipelines.yml 的这一部分如下所示:

   - sed -i '/jessie-updates/d' /etc/apt/sources.list # Debian mirror-network drops Jessie, so don't use it
   - apt-get update # required to install zip
   - apt-get install -y zip # required for packaging up the application

完整答案在这里(引用另一个)

于 2019-03-27T01:14:58.247 回答
0

我的解决方案是改变

image: python:3.5.1

image: python:3.5.7

于 2019-06-21T06:21:24.790 回答