It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Bitbucket Pipelines: Apt-get update returning 404

Recently, there were some changes to the apt mirrors that has affected several Docker images, which you may be running in Bitbucket Pipelines. Most reports of this issue started on the 26th of March. But it’s possible to have occurred since March 20th.

If you’re seeing an error message like this, when running "apt-get update", you are likely affected by this issue:

Err jessie-updates/main amd64 Packages
404 Not Found
Get:4 jessie/updates/main amd64 Packages [822 kB]
Get:5 jessie/main amd64 Packages [9098 kB]
W: Failed to fetch 404 Not Found
E: Some index files failed to download. They have been ignored, or old ones used instead.
Fetched 10.1 MB in 6s (1486 kB/s)

You may also encounter this with “wheezy” instead of “jessie”.

Details of why this is occurring are noted here:

In order to fix this issue, you will need to update the Docker image you are using in your build.

For example, if you are using Python:3.5.1, you now need to use a currently supported tag such as 3.5.7 or 3.7.2.

image: python:3.5.7 # This line has been updated to a working version
- step:
- apt-get update # This should now work properly

If you are using another public Docker image, search for it on Dockerhub and either try a newer tag, or see if there is a “-stretch” tag suffix available to use.

Once you’ve updated the image, your “apt-get update” command should resume working again.


Thank you. Updating the image version worked for me.

Hi, I changed the image in bitbucket-pipelines.yml from -image: node:10.6.0 TO image: node:10.15.3

But still i get same issue. Is it because it is still referring to cache from - step: >> caches: >> - node

My bitbucket-pipelines.yml looks like below now : 

image: node:10.15.3

      - step:
            - node
            - bash testApi

Hi Ajitesh, I think node:10.15.3 is still using 'jessie' . 

Have a look at
you may want to use a `stretch` version.  I ended up using `node:11.12.0-stretch` and before apt-get install I had to run : 

echo "deb jessie main\ndeb jessie/updates main" > /etc/apt/sources.list

 and then had to run 

- npm rebuild node-sass 


Like # people like this

@Rob's approach looks fine here. (FYI: The GitHub issue URL is linking to a search query, not the URL you intended:

There's a PR currently open which means you won't need that workaround for too long.

If you need to keep using Jessie repositories, then there's some guidance in this StackExchange answer:

Key quote here though:

Since you’re building a container image, I highly recommend basing it on Debian 9 instead.

Like # people like this

Very big issue here with this outdated python image! I lost more than 10 hours trying to figure out why the bitbucket pipeline failed! :(


Log in or Sign up to comment
Community showcase
Published in Bitbucket Pipelines

What We Learned When We Researched Open Source Vulnerabilities in 7 Popular Coding Languages

...hey are a part of us, shaping how we interact with the world around us. The same holds true for programming languages when we think about how different kinds of vulnerabilities raise their heads in t...

933 views 0 3
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you