Recently we have noticed errors when running apt-get update before installing a package. This can lead to failed compute environment builds. There can be various causes to this issue, here are some of the more common.
- Not really an error, but you can ignore the error by adding `|| true`, i.e. run `apt-get update || true`. This will allow the build to proceed, but may not correctly install your package.
- The issue may be due to apt-get update attempting to use an http (vs https) URL. Add this before the update to resolve this issue by replacing http with https: `RUN sudo sed -i 's/http/https/g' /etc/apt/sources.list`
- You may be missing the apt-transport-https package. Install this before running the 'apt-get update' statement, 'RUN apt-get install apt-transport-https -y && apt-get update'.
Comments
1 comment
We came across this while apt installing a pluggable workspace tool on Ubuntu 16.04 Xenial. We were running this in an environment that is on-prem and does not have access to internet and all packages are to be installed from artifactory repository. We noticed that `apt-get update` would just get stuck at 0% [Working] in the docker environment build. After much troubleshooting, we arrived at the solution which was to:
(i) Ensure apt-transport-https package is installed before running the apt-get update statement
(ii) Ensure the right artifactory sources are listed and any internet related sources are removed from the /etc/apt/sources.list file
Submitted by: akshay.ambekar
Please sign in to leave a comment.