skip to Main Content

I am trying to build a new image in Docker Compose but the following problem occurs

E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/a/apt/apt-utils_2.4.7_amd64.deb  404  Not Found [IP: ]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
The command '/bin/sh -c apt-get install -y apt-utils' returned a non-zero code: 100
ERROR: Service 'nginx-service' failed to build : Build failed

In my Dockerfile I’m running: RUN apt-get install -y apt-utils and with --fix-missing.

None of the related questions or other solutions helped me and I’ve been stuck for quite a while. What am I missing?

Thanks!

EDIT: The whole Dockerfile

FROM ubuntu:latest
RUN apt-get update 
RUN apt-get upgrade -y
RUN apt-get install -y nginx 
RUN apt-get clean 
RUN apt-get install -y curl
RUN apt-get install -y unzip
RUN apt-get install -y wget
RUN DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get -y install tzdata
RUN apt-get install -y php php-xml php-curl php-fpm php-mysql 
RUN apt-get install -y apt-utils --fix-missing
RUN apt-get install -y php-zip --fix-missing
RUN apt-get install -y php-gd --fix-missing
RUN apt-get install -y mysql-server
RUN curl -sS https://getcomposer.org/installer -o composer-setup.php
RUN php composer-setup.php --install-dir=/usr/local/bin --filename=composer
RUN apt-get install -y nano
RUN apt-get install -y mc
RUN apt-get install -y systemctl
RUN systemctl start nginx.service

2

Answers


  1. Chosen as BEST ANSWER

    Building the image like this: docker-compose build --no-cache worked for me


  2. usually , when we are building a new image, we use update then install like this

    RUN apt-get update && apt-get install -y apt-utils
    

    This will update apt source list and will make the package available to install.

    Addibg this to your Dockerfile should fix the issue.

    If you want to install many at once you can add the packages like the following :

    RUN apt-get update && apt-get install -y 
      bzr 
      cvs 
      git 
      mercurial 
      subversion 
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search