apt-get update fails inside Dockerfile - linux

When I try to build a simple docker image:
in Dockerfile:
FROM ubuntu:18.04
RUN apt-get update
The output is:
$ sudo docker build --no-cache -t testbuild .
Sending build context to Docker daemon 3.471MB
Step 1/2 : FROM ubuntu:18.04
---> c090eaba6b94
Step 2/2 : RUN apt-get update
---> Running in 53d64603442f
Ign:1 http://archive.ubuntu.com/ubuntu bionic InRelease
Ign:2 http://security.ubuntu.com/ubuntu bionic-security InRelease
Ign:3 http://archive.ubuntu.com/ubuntu bionic-updates InRelease
Err:4 http://security.ubuntu.com/ubuntu bionic-security Release
404 Not Found [IP: 91.189.88.142 80]
Ign:5 http://archive.ubuntu.com/ubuntu bionic-backports InRelease
Err:6 http://archive.ubuntu.com/ubuntu bionic Release
404 Not Found [IP: 91.189.88.152 80]
Err:7 http://archive.ubuntu.com/ubuntu bionic-updates Release
404 Not Found [IP: 91.189.88.152 80]
Err:8 http://archive.ubuntu.com/ubuntu bionic-backports Release
404 Not Found [IP: 91.189.88.152 80]
Reading package lists...
E: The repository 'http://security.ubuntu.com/ubuntu bionic-security Release' does not have a Release file.
E: The repository 'http://archive.ubuntu.com/ubuntu bionic Release' does not have a Release file.
E: The repository 'http://archive.ubuntu.com/ubuntu bionic-updates Release' does not have a Release file.
E: The repository 'http://archive.ubuntu.com/ubuntu bionic-backports Release' does not have a Release file.
The command '/bin/sh -c apt-get update' returned a non-zero code: 100
I tried:
build with different types of ubuntu images - e.g. ubuntu:16.04, 18.04,20.04 - and get a similar error '...Release' does not have a Release file.'
I completely removed and reinstalled docker from my system, inc all containers and repository, and rebooted, and get the same error
I previously built multiple docker images and everything worked fine. And now I get this error out of nowhere all the time.

Related

I get an error when i try apt-get update?

I'm trying to update my server with apt-get update and this error shows up...
My Server runs on Ubuntu 18.04
Ign:1 https://packages.sury.org/php bionic InRelease
Err:2 https://packages.sury.org/php bionic Release
404 Not Found [IP: 138.199.37.227 443]
Ign:3 http://old-releases.ubuntu.com/ubuntu bionic InRelease
Hit:4 http://ppa.launchpad.net/ondrej/php/ubuntu bionic InRelease
Ign:5 http://old-releases.ubuntu.com/ubuntu bionic-updates InRelease
Ign:6 http://old-releases.ubuntu.com/ubuntu bionic-security InRelease
Err:7 http://old-releases.ubuntu.com/ubuntu bionic Release
404 Not Found [IP: 185.125.190.40 80]
Err:8 http://old-releases.ubuntu.com/ubuntu bionic-updates Release
404 Not Found [IP: 185.125.190.40 80]
Err:9 http://old-releases.ubuntu.com/ubuntu bionic-security Release
404 Not Found [IP: 185.125.190.40 80]
Hit:10 https://packagecloud.io/pufferpanel/pufferpanel/ubuntu bionic InRelease
Reading package lists... Done
E: The repository 'https://packages.sury.org/php bionic Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: The repository 'http://old-releases.ubuntu.com/ubuntu bionic Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: The repository 'http://old-releases.ubuntu.com/ubuntu bionic-updates Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: The repository 'http://old-releases.ubuntu.com/ubuntu bionic-security Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
Does anybody know how i can fix that?
It looks like you are using repositories that do not contain this version of ubuntu (http://old-releases.ubuntu.com/ubuntu) and others designed for Debian (https://packages.sury.org/php).
I recommend you edit your /etc/apt/sources.list file, replace the content with the one you can find in this repository and then try with:
apt update

How to get a clean message after using the sudo apt update in ubuntu?

I wanna remove all these error and get back to a clean message. But I don't know how to remove these.
sudo apt update
Hit:1 http://packages.microsoft.com/repos/code stable InRelease
Hit:2 http://ppa.launchpad.net/linuxuprising/java/ubuntu focal InRelease
Hit:3 http://archive.ubuntu.com/ubuntu focal InRelease
Ign:4 http://ppa.launchpad.net/webupd8team/java/ubuntu focal InRelease
Hit:5 https://dl.google.com/linux/chrome/deb stable InRelease
Hit:6 http://archive.ubuntu.com/ubuntu focal-updates InRelease
Hit:7 https://download.sublimetext.com apt/stable/ InRelease
Get:8 http://archive.ubuntu.com/ubuntu focal-backports InRelease [101 kB]
Err:9 http://ppa.launchpad.net/webupd8team/java/ubuntu focal Release
404 Not Found [IP: 2001:67c:1560:8008::19 80]
Get:10 http://archive.ubuntu.com/ubuntu focal-security InRelease [114 kB]
Reading package lists... Done
E: The repository 'http://ppa.launchpad.net/webupd8team/java/ubuntu focal Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
The key to the real problem can be found on this line - E: The repository 'http://ppa.launchpad.net/webupd8team/java/ubuntu focal Release' does not have a Release file.
You need to clean the PPA to get rid of the error. Thankfully, someone explained how to do that, here - https://askubuntu.com/questions/866901/what-can-i-do-if-a-repository-ppa-does-not-have-a-release-file

Databricks ODBC driver missing

has anyone else encountered this?
I think this driver is missing from repo from today 17.6.2021 onwards.
Anyway to solve this?
Hit:1 http://archive.ubuntu.com/ubuntu bionic InRelease
Hit:2 http://archive.ubuntu.com/ubuntu bionic-updates InRelease
Hit:3 https://packages.microsoft.com/ubuntu/16.04/prod xenial InRelease
Hit:4 http://archive.ubuntu.com/ubuntu bionic-backports InRelease
Hit:5 http://security.ubuntu.com/ubuntu bionic-security InRelease
Hit:6 https://repos.azul.com/zulu/deb stable InRelease
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
The following packages were automatically installed and are no longer required:
libcap2-bin libpam-cap
Use 'sudo apt autoremove' to remove them.
The following NEW packages will be installed:
msodbcsql17
0 upgraded, 1 newly installed, 0 to remove and 52 not upgraded.
Need to get 745 kB of archives.
After this operation, 0 B of additional disk space will be used.
Err:1 https://packages.microsoft.com/ubuntu/16.04/prod xenial/main amd64 msodbcsql17 amd64 17.7.2.1-1
404 Not Found [IP: 40.114.136.21 443]
E: Failed to fetch https://packages.microsoft.com/ubuntu/16.04/prod/pool/main/m/msodbcsql17/msodbcsql17_17.7.2.1-1_amd64.deb 404 Not Found [IP: 40.114.136.21 443]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

getting 404 Not Found [IP: 91.189.95.85 80] error when trying to install/apt update on WSL ubuntu18.04 OS

followed below link to install sublime-text on WSL ubuntu18.04 image,
https://tecadmin.net/install-sublime-text-editor-on-ubuntu/
but getting error on apt update:
Hit:1 http://security.ubuntu.com/ubuntu bionic-security InRelease
Err:2 https://download.sublimetext.com apt/stable/ InRelease
Temporary failure resolving 'download.sublimetext.com'
Err:3 http://archive.ubuntu.com/ubuntu bionic InRelease
Temporary failure resolving 'archive.ubuntu.com'
Ign:4 http://ppa.launchpad.net/webupd8team/sublime-text-3/ubuntu bionic InRelease
Hit:5 http://archive.ubuntu.com/ubuntu bionic-updates InRelease
Hit:6 http://archive.ubuntu.com/ubuntu bionic-backports InRelease
Err:7 http://ppa.launchpad.net/webupd8team/sublime-text-3/ubuntu bionic Release
404 Not Found [IP: 91.189.95.85 80]
Reading package lists... Done
E: The repository 'http://ppa.launchpad.net/webupd8team/sublime-text-3/ubuntu bionic Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
new to WSL, help will be appreciated in this regard.
and also any other open source tool which can help in counting and restricting the git commit message to 72 char.

Azure Ubuntu VM docker build apt-get 403 forbidden

I'm trying to configure Docker on an Azure VM (Ubuntu 18.04 LTS). The goal is to use Jenkins to deploy my applications to my Kubernetes cluster (following this tutorial).
But when I try to build a docker image inside this VM I got 403 errors during the "RUN apt-get update". While the VM itself can access those urls, it's only during the build of the docker image that I get 403 errors.
Sample of the output :
Err:33 http://archive.ubuntu.com/ubuntu xenial-backports/main amd64 Packages
403 Forbidden [IP: 91.189.88.149 80]
Ign:34 http://archive.ubuntu.com/ubuntu xenial-backports/main all Packages
Ign:35 http://archive.ubuntu.com/ubuntu xenial-backports/restricted amd64 Packages
Ign:36 http://archive.ubuntu.com/ubuntu xenial-backports/restricted all Packages
Ign:37 http://archive.ubuntu.com/ubuntu xenial-backports/universe amd64 Packages
Ign:38 http://archive.ubuntu.com/ubuntu xenial-backports/universe all Packages
Ign:39 http://archive.ubuntu.com/ubuntu xenial-backports/multiverse amd64 Packages
Ign:40 http://archive.ubuntu.com/ubuntu xenial-backports/multiverse all Packages
Reading package lists...
W: The repository 'http://archive.ubuntu.com/ubuntu xenial-updates Release' does not have a Release file.
W: The repository 'http://archive.ubuntu.com/ubuntu xenial-backports Release' does not have a Release file.
E: Failed to fetch http://security.ubuntu.com/ubuntu/dists/xenial-security/main/binary-amd64/Packages 403 Forbidden [IP: 91.189.88.161 80]
E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial/main/binary-amd64/Packages 403 Forbidden [IP: 91.189.88.149 80]
E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial-updates/main/binary-amd64/Packages 403 Forbidden [IP: 91.189.88.149 80]
E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial-backports/main/binary-amd64/Packages 403 Forbidden [IP: 91.189.88.149 80]
I have found some similar questions like this one but none of the answers worked or explains exactly what happens in Azure (firewall or transparent proxy not used properly by the network of docker I guess).
Is there a specific configuration for docker, azure VM, ...?
Thank you.

Resources