1

I'm working on a debian:9 image pulled from Docker Hub. When I ran apt update or apt-get update, I got the following error messages:

Ign:1 http://security.debian.org/debian-security stretch/updates InRelease
Ign:2 http://deb.debian.org/debian stretch InRelease          
Err:3 http://security.debian.org/debian-security stretch/updates Release      
 400  Bad request: request method denied
Ign:4 http://deb.debian.org/debian stretch-updates InRelease                  
Err:5 http://deb.debian.org/debian stretch Release
 400  Bad request: request method denied
Err:6 http://deb.debian.org/debian stretch-updates Release    
 400  Bad request: request method denied
Reading package lists... Done                                  
E: The repository 'http://security.debian.org/debian-security stretch/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://deb.debian.org/debian stretch 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://deb.debian.org/debian stretch-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.

My sources.list file looks like this (official example from Debian Wiki):

deb http://deb.debian.org/debian stretch main
deb-src http://deb.debian.org/debian stretch main

deb http://deb.debian.org/debian stretch-updates main
deb-src http://deb.debian.org/debian stretch-updates main

deb http://security.debian.org stretch/updates main    
deb-src http://security.debian.org stretch/updates main

I also tried other releases, but got the same error. Does anyone have a clue what might cause the problem? Many thanks!

EDIT:

Thanks to GracefulRestart, I finally solved it by manually setting the network proxy for the Debian image in Dockerfile before I do apt update.

Although the question is marked as duplicate, it has nothing to do with Debian: The repository does not have a Release file, because it was 400 error and the sources.list file was actually correct.

YuKitAs
  • 11
  • I've seen that post before, but that answer didn't help. – YuKitAs Apr 17 '18 at 15:09
  • 1
    I just pulled that debian docker image and did not have those issues. Are you doing some non-default networking in your docker environment? – GracefulRestart Apr 17 '18 at 17:01
  • @GracefulRestart I never configured networking manually for the contrainer... :/ – YuKitAs Apr 17 '18 at 18:03
  • 1
    I am not sure what your problem is then, a 400 error means you were able to connect to the remote HTTP server but it rejected your request. Unless you modified the docker image, I should have the same debian:latest that you do. I am not able to replicate your problem, are you running behind some proxy that would modify your requests in some way? – GracefulRestart Apr 17 '18 at 18:11
  • @GracefulRestart Thanks for reminding me about that! I finally solved it by modifying the webproxy in my Dockerfile. – YuKitAs Apr 19 '18 at 08:52
  • @GracefulRestart if you'd like to write it as an answer, I will accept it :) 'cause I don't have enough reputation to answer my own question right now – YuKitAs Apr 19 '18 at 12:01
  • I cannot seem to post an answer, this question appears to be locked as a duplicate but the linked answer has nothing to do with misconfigured proxies. Not sure if i can fix that. – GracefulRestart Apr 19 '18 at 20:51
  • @GracefulRestart I didn't understand why so many people marked it as duplicate without reading the question even after I explained it was something different. I just wrote the solution in my question, hopefully someone sees it. Thanks anyway! – YuKitAs Apr 20 '18 at 21:22

1 Answers1

0

enter image description here

Debian 9 sources.list The sources.list for Debian Testing is not compatible with Debian 9 (codename Stretch)

Here is an example sources.list:

deb http://ftp.us.debian.org/debian/ stretch main contrib non-free
deb http://ftp.us.debian.org/debian/ stretch-updates main contrib non-free
deb http://security.debian.org/debian-security/ stretch/updates main contrib non-free

The following sources.list attempts to serve content close to your location using redirection:

deb http://deb.debian.org/debian/ stretch main contrib non-free
deb http://deb.debian.org/debian/ stretch-updates main contrib non-free
deb http://deb.debian.org/debian-security/ stretch/updates main contrib non-free

To update your system, proceed as usual:

apt-get update # Update package information from sources
apt-get upgrade # Upgrade packages
apt-get dist-upgrade # Upgrade packages that depends on new dependencies

I do recommend doing security updates either manually or doing it as part of planned upgrades via other provisioning systems, after testing in a pre-production environment. In alternative, you might also install the package unattended-upgrades.