1

I'm currently facing an issue in installing Google Chrome in my docker - this set up was working yesterday but as of today I'm getting this error -

This is how I'm installing Chrome

    ENV CHROME_VERSION "google-chrome-stable"
RUN apt-get update
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
  && echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list \
  && apt-get -qqy install \
    ${CHROME_VERSION:-google-chrome-stable} \
  && rm /etc/apt/sources.list.d/google-chrome.list \
  && rm -rf /var/lib/apt/lists/*

This throws an error

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

E: Some index files failed to download. They have been ignored, or old ones used instead.

If I remove the apt-get update part, then the above error doesn't come but the google-chrome-stable is not found

ENV CHROME_VERSION "google-chrome-stable"
    RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
      && echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list \
      && apt-get -qqy install \
        ${CHROME_VERSION:-google-chrome-stable} \
      && rm /etc/apt/sources.list.d/google-chrome.list \
      && rm -rf /var/lib/apt/lists/*

Then the error is

E: Unable to locate package google-chrome-stable

Further , I found a link which recommends removing jessie - https://lists.debian.org/debian-devel-announce/2019/03/msg00006.html

How can I configure to remove both the errors since this was working all fine yesterday and my docker build was successful.

1 Answer 1

3

http://deb.debian.org/debian/dists/jessie-updates/main/binary-amd64/Packages delivers a 404 indeed. I don't know why that is but you are not the only person affected: https://github.com/docker-library/official-images/issues/3551

So as a workaround you have to comment out the line containing that URL in the sources.list before running apt-get update to make sure that it doesn't fail. I used sed for that (sed -i -- 's&deb http://deb.debian.org/debian jessie-updates main&#deb http://deb.debian.org/debian jessie-updates main&g').

So I could install chrome successfully by modifying your Dockerfile to look like:

FROM debian:jessie
ENV CHROME_VERSION "google-chrome-stable"
RUN sed -i -- 's&deb http://deb.debian.org/debian jessie-updates main&#deb http://deb.debian.org/debian jessie-updates main&g' /etc/apt/sources.list \
  && apt-get update && apt-get install wget -y
ENV CHROME_VERSION "google-chrome-stable"
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
  && echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list \
  && apt-get update && apt-get -qqy install ${CHROME_VERSION:-google-chrome-stable}
CMD /bin/bash
3
  • I tried this in my local docker and it got stuck at Reading package lists... Commented Mar 26, 2019 at 10:14
  • I can confirm that Reading package lists... needs pretty long (and it is displayed two times), but it moves on after ~20s. Please retry with --no-cache in your docker build command .. and give it some time. Tried it on two different machines.
    – codinghaus
    Commented Mar 26, 2019 at 10:22
  • Umm. I'm waiting for more than a minute and it hasn't moved yet. Running with --no-cache makes no different. Commented Mar 26, 2019 at 10:32

Not the answer you're looking for? Browse other questions tagged or ask your own question.