Additional information can be found here: https://discuss.circleci.com/t/some-builds-failing-due-to-apt-get-update/38018
We’re starting to see reports of CircleCI builds failing due to an error when running
apt-get update. The problem we’re tracking is due to the Debian repository for Debian Stretch (Debian 9) removing the backports component of their repository.
Could not open file /var/lib/apt/lists/deb.debian.org_debian_dists_stretch-backports_main_binary-amd64_Packages.diff_Index - open (2: No such file or directory)
We’re seeing images have this issue that are:
- based on Debian 9 (Stretch)
- older images (last built more than 90 days ago)
There are a few solutions you can take for your project depending on which works best for you:
- Use an image tag that updates the primary version of your software. For example, an image we know affected is
circleci/ruby:2.6.5-stretch-node-browsers. This contains Ruby v2.6.5 which is fairly old. Newer patch releases, such as Ruby v2.6.6 are not affected by this issue.
- Use a newer base OS. Using the same affected image as an example,
circleci/ruby:2.6.5-stretch-node-browsers, this image uses Debian 9 (Stretch) as a base, which is 3+ years old. Removing the string
stretchwill use a newer Debian or Ubuntu base, which is unaffected by this issue. For example, you could use
- Use a next-gen Convenience Image. The next-gen Convenience Images aren’t affected by this issue as they’re all Ubuntu 18.04 or Ubuntu 20.04 based.
- You can patch this issue without changing the image by deleting the Apt cache before running
sudo apt-get update. This would look like this:
- run: | sudo rm -rf /var/lib/apt/lists/* sudo apt-get update