Search code examples
dockerubuntugdal

docker apt-get install fails fetching a file


I have the following commands in DockerFile

# Use the official image as a parent image.
FROM ubuntu:18.04
#FROM node:10.18.0


# Install Node.js
RUN apt-get update && apt-get install -y \
  wget \
  build-essential \
  software-properties-common


# install node version 10.18, need to use this specific
# version since it is the version that works with mapnik

RUN wget https://nodejs.org/dist/v10.18.0/node-v10.18.0-linux-x64.tar.xz

RUN tar -xJf node-v10.18.0-linux-x64.tar.xz -C /usr/local --strip-components=1 --no-same-owner \
  && rm node-v10.18.0-linux-x64.tar.xz \
  && ln -s /usr/local/bin/node /usr/local/bin/nodejs \
  && node --version \
  && npm --version

# install gdal
RUN add-apt-repository ppa:ubuntugis/ppa

RUN apt-get update && apt-get install -y --no-install-recommends \
  gdal-bin \
  cmake \ 
  build-essential \
  git \
  ca-certificates \
  libgdal-dev

and it fails with the following error:

et:151 http://archive.ubuntu.com/ubuntu bionic/main amd64 unixodbc-dev amd64 2.3.4-1.1ubuntu3 [217 kB]
Err:152 http://ppa.launchpad.net/ubuntugis/ppa/ubuntu bionic/main amd64 libgeos-c1v5 amd64 3.7.1-1~bionic0
  Could not connect to ppa.launchpad.net:80 (91.189.95.85), connection timed out [IP: 91.189.95.85 80]
Err:153 http://ppa.launchpad.net/ubuntugis/ppa/ubuntu bionic/main amd64 proj-data all 5.2.0-1~bionic0
  Unable to connect to ppa.launchpad.net:http: [IP: 91.189.95.85 80]
Err:154 http://ppa.launchpad.net/ubuntugis/ppa/ubuntu bionic/main amd64 libproj13 amd64 5.2.0-1~bionic0
  Unable to connect to ppa.launchpad.net:http: [IP: 91.189.95.85 80]
Err:155 http://ppa.launchpad.net/ubuntugis/ppa/ubuntu bionic/main amd64 libgeotiff2 amd64 1.4.2-2build1+bionic0
  Unable to connect to ppa.launchpad.net:http: [IP: 91.189.95.85 80]
Err:156 http://ppa.launchpad.net/ubuntugis/ppa/ubuntu bionic/main amd64 libogdi4.1 amd64 4.1.0+ds-1~bionic0
  Unable to connect to ppa.launchpad.net:http: [IP: 91.189.95.85 80]
Err:157 http://ppa.launchpad.net/ubuntugis/ppa/ubuntu bionic/main amd64 libspatialite7 amd64 4.3.0a-5build1+bionic1
  Unable to connect to ppa.launchpad.net:http: [IP: 91.189.95.85 80]
Err:158 http://ppa.launchpad.net/ubuntugis/ppa/ubuntu bionic/main amd64 libgdal20 amd64 2.4.2+dfsg-1~bionic0
  Unable to connect to ppa.launchpad.net:http: [IP: 91.189.95.85 80]
Err:159 http://ppa.launchpad.net/ubuntugis/ppa/ubuntu bionic/main amd64 gdal-bin amd64 2.4.2+dfsg-1~bionic0
  Unable to connect to ppa.launchpad.net:http: [IP: 91.189.95.85 80]
Err:160 http://ppa.launchpad.net/ubuntugis/ppa/ubuntu bionic/main amd64 libgeos-dev amd64 3.7.1-1~bionic0
  Unable to connect to ppa.launchpad.net:http: [IP: 91.189.95.85 80]
Err:161 http://ppa.launchpad.net/ubuntugis/ppa/ubuntu bionic/main amd64 libgeotiff-dev amd64 1.4.2-2build1+bionic0
  Unable to connect to ppa.launchpad.net:http: [IP: 91.189.95.85 80]
Err:162 http://ppa.launchpad.net/ubuntugis/ppa/ubuntu bionic/main amd64 libogdi-dev amd64 4.1.0+ds-1~bionic0
  Unable to connect to ppa.launchpad.net:http: [IP: 91.189.95.85 80]
Err:163 http://ppa.launchpad.net/ubuntugis/ppa/ubuntu bionic/main amd64 libproj-dev amd64 5.2.0-1~bionic0
  Unable to connect to ppa.launchpad.net:http: [IP: 91.189.95.85 80]
Err:164 http://ppa.launchpad.net/ubuntugis/ppa/ubuntu bionic/main amd64 libspatialite-dev amd64 4.3.0a-5build1+bionic1
  Unable to connect to ppa.launchpad.net:http: [IP: 91.189.95.85 80]
Err:165 http://ppa.launchpad.net/ubuntugis/ppa/ubuntu bionic/main amd64 libgdal-dev amd64 2.4.2+dfsg-1~bionic0
  Unable to connect to ppa.launchpad.net:http: [IP: 91.189.95.85 80]
Fetched 61.7 MB in 33s (1896 kB/s)
E: Failed to fetch http://ppa.launchpad.net/ubuntugis/ppa/ubuntu/pool/main/g/geos/libgeos-c1v5_3.7.1-1~bionic0_amd64.deb  Could not connect to ppa.launchpad.net:80 (91.189.95.85), connection timed out [IP: 91.189.95.85 80]
E: Failed to fetch http://ppa.launchpad.net/ubuntugis/ppa/ubuntu/pool/main/p/proj/proj-data_5.2.0-1~bionic0_all.deb  Unable to connect to ppa.launchpad.net:http: [IP: 91.189.95.85 80]
E: Failed to fetch http://ppa.launchpad.net/ubuntugis/ppa/ubuntu/pool/main/p/proj/libproj13_5.2.0-1~bionic0_amd64.deb  Unable to connect to ppa.launchpad.net:http: [IP: 91.189.95.85 80]
E: Failed to fetch http://ppa.launchpad.net/ubuntugis/ppa/ubuntu/pool/main/libg/libgeotiff-dfsg/libgeotiff2_1.4.2-2build1+bionic0_amd64.deb  Unable to connect to ppa.launchpad.net:http: [IP: 91.189.95.85 80]
E: Failed to fetch http://ppa.launchpad.net/ubuntugis/ppa/ubuntu/pool/main/o/ogdi-dfsg/libogdi4.1_4.1.0+ds-1~bionic0_amd64.deb  Unable to connect to ppa.launchpad.net:http: [IP: 91.189.95.85 80]
E: Failed to fetch http://ppa.launchpad.net/ubuntugis/ppa/ubuntu/pool/main/s/spatialite/libspatialite7_4.3.0a-5build1+bionic1_amd64.deb  Unable to connect to ppa.launchpad.net:http: [IP: 91.189.95.85 80]
E: Failed to fetch http://ppa.launchpad.net/ubuntugis/ppa/ubuntu/pool/main/g/gdal/libgdal20_2.4.2+dfsg-1~bionic0_amd64.deb  Unable to connect to ppa.launchpad.net:http: [IP: 91.189.95.85 80]
E: Failed to fetch http://ppa.launchpad.net/ubuntugis/ppa/ubuntu/pool/main/g/gdal/gdal-bin_2.4.2+dfsg-1~bionic0_amd64.deb  Unable to connect to ppa.launchpad.net:http: [IP: 91.189.95.85 80]
E: Failed to fetch http://ppa.launchpad.net/ubuntugis/ppa/ubuntu/pool/main/g/geos/libgeos-dev_3.7.1-1~bionic0_amd64.deb  Unable to connect to ppa.launchpad.net:http: [IP: 91.189.95.85 80]
E: Failed to fetch http://ppa.launchpad.net/ubuntugis/ppa/ubuntu/pool/main/libg/libgeotiff-dfsg/libgeotiff-dev_1.4.2-2build1+bionic0_amd64.deb  Unable to connect to ppa.launchpad.net:http: [IP: 91.189.95.85 80]
E: Failed to fetch http://ppa.launchpad.net/ubuntugis/ppa/ubuntu/pool/main/o/ogdi-dfsg/libogdi-dev_4.1.0+ds-1~bionic0_amd64.deb  Unable to connect to ppa.launchpad.net:http: [IP: 91.189.95.85 80]
E: Failed to fetch http://ppa.launchpad.net/ubuntugis/ppa/ubuntu/pool/main/p/proj/libproj-dev_5.2.0-1~bionic0_amd64.deb  Unable to connect to ppa.launchpad.net:http: [IP: 91.189.95.85 80]
E: Failed to fetch http://ppa.launchpad.net/ubuntugis/ppa/ubuntu/pool/main/s/spatialite/libspatialite-dev_4.3.0a-5build1+bionic1_amd64.deb  Unable to connect to ppa.launchpad.net:http: [IP: 91.189.95.85 80]
E: Failed to fetch http://ppa.launchpad.net/ubuntugis/ppa/ubuntu/pool/main/g/gdal/libgdal-dev_2.4.2+dfsg-1~bionic0_amd64.deb  Unable to connect to ppa.launchpad.net:http: [IP: 91.189.95.85 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

I am able to access the files directly, for example pasting this link in the browser, http://ppa.launchpad.net/ubuntugis/ppa/ubuntu/pool/main/g/gdal/libgdal-dev_2.4.2+dfsg-1~bionic0_amd64.deb you will download the file.

This used to work, but it's failing now. Any ideas?


Solution

  • For me the particular issue was not related to internet access, as apt-get update worked fine, the gis ppa is somehow broken and frankly you don't need it anymore with the 18.04 LTS image, maybe the default 18.04 image has been updated.

    remove

    RUN add-apt-repository ppa:ubuntugis/ppa