Apt-get update return 404

Everything run normally until today when i get the following error when attempting to run apt-get update
I googled it in 2 hours but could not find anything.
My config file:

version: 2

working_directory: ~/bee-cloud
  - image: circleci/ruby:2.4.1-node-browsers
      RAILS_ENV: test
      TZ: "/usr/share/zoneinfo/Asia/Tokyo"
  - image: circleci/mysql
    command: mysqld --default-authentication-plugin=mysql_native_password
  - image: circleci/redis
    command: redis-server --appendonly yes
parallelism: 1
    - /ci\/.*/
    - /feature\/.*/
    - /fix\/.*/
    - /hotfix\/.*/
    - /^v./
  - checkout
  - restore_cache:
        - bootsnap-cache-{{ .Branch }}-{{ .Revision }}
        - bootsnap-cache-{{ .Branch }}
        - bootsnap-cache
  - save_cache:
      key: bootsnap-cache-{{ .Branch }}-{{ .Revision }}
        - tmp/cache/bootsnap-load-path-cache
        - tmp/cache/bootsnap-compile-cache
  - save_cache:
      key: bootsnap-cache-{{ .Branch }}
        - tmp/cache/bootsnap-load-path-cache
        - tmp/cache/bootsnap-compile-cache
  - save_cache:
      key: bootsnap-cache
        - tmp/cache/bootsnap-load-path-cache
        - tmp/cache/bootsnap-compile-cache

  - restore_cache:
      - bee-cloud-dependencies-{{ checksum "Gemfile.lock" }}
      - bee-cloud-dependencies-

  - run:
      name: install dependencies [System, Library]
      command: |
        sudo apt-get update
        sudo apt-get remove libcups2
        sudo apt-get install libcups2=1.7.5-11+deb8u4 libcupsimage2 libgs9 ghostscript

  - run:
      name: install dependencies [Rails]
      command: bundle install --jobs=4 --retry=3 --path vendor/bundle

  - save_cache:
        - ./vendor/bundle
      key: bee-cloud-dependencies-{{ checksum "Gemfile.lock" }}

  - run:
      name: Waiting for MySQL to be ready
      command: dockerize -wait tcp:// -timeout 1m

  # Database setup
  - run:
      name: Database setup
      command: |
        cp config/database.yml.sample config/database.yml
        RAILS_ENV=test bundle exec rake parallel:create[$TEST_ENV_NUMBER]
        RAILS_ENV=test bundle exec rake db:migrate
        RAILS_ENV=test ALLOW_REMOVE_COLUMN=1 ALLOW_DROP_TABLE=1 bin/rails ridge:apply
        RAILS_ENV=test bundle exe rake parallel:load_schema[$TEST_ENV_NUMBER]
  - run:
      name: Run rspec in parallel
      command: |
        bundle exec parallel_rspec -n $TEST_ENV_NUMBER spec/services`

And the error

1 Like

Having the same issue here since this morning.

We’ve been having these as well.

It looks like jessie-updates is missing from the mirror that we get redirected to:


CircleCI prepared this PR for fixing this issue.


In the meanwhile, please add this step before the apt-get step.

    - run: |
        sudo rm /etc/apt/sources.list
        echo "deb http://archive.debian.org/debian/ jessie-backports main" | sudo tee -a /etc/apt/sources.list
        echo "deb-src http://archive.debian.org/debian/ jessie-backports main" | sudo tee -a /etc/apt/sources.list
        echo "Acquire::Check-Valid-Until false;" | sudo tee -a /etc/apt/apt.conf.d/10-nocheckvalid
        echo 'Package: *\nPin: origin "archive.debian.org"\nPin-Priority: 500' | sudo tee -a /etc/apt/preferences.d/10-archive-pin
        sudo apt-get update

Debian have removed the old stable distributions from the mirror network except the security support under the LTS (Long Term Support) initiative. A valid approach would be to update to the current stable as base if at all possible.

More information available at Debian Devel Announcement list.


Our team had same issue on getting postgresql-client-9.6, but fixed by using Apt repository by PostgreSQL.


1 Like

If at all possible you could move to Debian stable where the client package is available.

1 Like

Thank for your response!!
But How can I move to Debian stable ?
I mean that CircleCi will not let me move it .

I think the default version of CircleCI image is Debian 8 (Jessie) but now the stable version is Debian 9 (stretch)
We can use Debian 9 by changing:
circleci/ruby:2.4.1-node-browsers to circleci/ruby:2.4.1-stretch-node-browsers

I directly looked at index of /debian/dists and found out I was able to use these:

deb http://deb.debian.org/debian jessie main
deb http://deb.debian.org/debian stable-updates main

so, what I did in CircleCI was:

      - run:
          name: update /etc/apt/sources.list for apt-get update
          command: |
              echo "deb http://deb.debian.org/debian jessie main" > /etc/apt/sources.list
              echo "deb http://deb.debian.org/debian stable-updates main" >> /etc/apt/sources.list
              apt-get update

Now everything is working well for me.

1 Like

No, stable-updates means stretch-updates for stretch, not jessie. You should not mix it.

Ah, I thought I was able to fix it since in my project working good now.
So you mean, in the future, some problem might happen even though it’s currently working, right?
Thank you for telling me that. I’ll change it.

Yes, just removing “jessie-updates” in your apt line is fine.


Had the same issue today, changed circleci image to circleci/node:10.12.0-stretch, which is not using debian jessie


Thanks everyone! Great to see the community sharing information like this.

Using the fixes in here I was able to get my dev builds working but to compile our assets in Rails for production we use YUI which depends on java-jre. Can’t for the life of me get that working. Anyone had luck with that?

Thank you for sharing this. It worked for me I was using old node:6-10 version, so this error forced me to update :slight_smile:

Hi Taka, any idea when this update will be released?

All images have been updated, However, if you are using an older tag we do not currently build it will not be updated. You can check this by visiting DockerHub and seeing if the upstream image shows that tag version as still building.

thanks , now i am facing issue with tomcat
The following packages have unmet dependencies:
tomcat8 : Depends: tomcat8-common (>= 8.0.14-1+deb8u11) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
which package i should add to resolve this.