Engineering/Docker

컨테이너에서 패키지 설치시 "Not Found" 에러 발생시

부스 boos 2026. 5. 7. 13:39
728x90

 데비안(Debian) 계열의 슬림 도커 이미지(openjdk:11-jre-slim) 기반의 pod 내 에서 필요한 패키지를 설치하기 위해 apt update 나 apt install 명령을 실행하는데, 다음과 같이 Not Found 에러 발생한다면

5cb4ccd78b-z2pc2:/home/user1/agent# apt update
Ign:1 http://deb.debian.org/debian buster InRelease
Ign:2 http://deb.debian.org/debian buster-updates InRelease
Err:3 http://deb.debian.org/debian buster Release
  404  Not Found [IP: 146.75.50.132 80]
Err:4 http://deb.debian.org/debian buster-updates Release
  404  Not Found [IP: 146.75.50.132 80]
Ign:5 http://security.debian.org/debian-security buster/updates InRelease
Err:6 http://security.debian.org/debian-security buster/updates Release
  404  Not Found [IP: 151.101.2.132 80]
Reading package lists... Done
E: The repository 'http://deb.debian.org/debian buster 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 buster-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://security.debian.org/debian-security buster/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.

 

 현재 패키지 소스 경로 확인해보고 아카이브된 주소로 변경해야 한다. 오래된 패키지는 어느 정도 시간이 지나면 다른 저장소로 보관한다(archieve)

5cb4ccd78b-z2pc2:/home/user1/agent# more /etc/apt/sources.list
# deb http://snapshot.debian.org/archive/debian/20210511T000000Z buster main
deb http://deb.debian.org/debian buster main
# deb http://snapshot.debian.org/archive/debian-security/20210511T000000Z buster/updates main
deb http://security.debian.org/debian-security buster/updates main
# deb http://snapshot.debian.org/archive/debian/20210511T000000Z buster-updates main
deb http://deb.debian.org/debian buster-updates main

 

 현재 /etc/apt/sources.list 에서 repository 서버 경로는 deb.debian.org, security.debian.org 이다. # 로 시작하는거는 comment 이니 무시하자.

 다음 명령어로 주소 변경후, 최신화하고(update) 필요한 패키지를 설치한다.

5cb4ccd78b-z2pc2:/home/user1/agent# sed -i 's/deb.debian.org/archive.debian.org/g' /etc/apt/sources.list
5cb4ccd78b-z2pc2:/home/user1/agent# sed -i 's/security.debian.org/archive.debian.org/g' /etc/apt/sources.list

5cb4ccd78b-z2pc2:/home/user1/agent# apt update

5cb4ccd78b-z2pc2:/home/user1/agent# apt install -y curl
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
...
...