k8s 의 nginx 컨테이너 내에서 패키지를 추가 설치하기 위해 apt update 및 install 을 실행시 아래와 같은 에러가 발생
root@sample-entrypoint:/# apt update
Ign:1 http://deb.debian.org/debian buster InRelease
Ign:2 http://deb.debian.org/debian buster-updates InRelease
Ign:3 http://security.debian.org/debian-security buster/updates InRelease
Err:4 http://deb.debian.org/debian buster Release
404 Not Found [IP: 146.75.50.132 80]
Err:5 http://security.debian.org/debian-security buster/updates Release
404 Not Found [IP: 151.101.66.132 80]
Err:6 http://deb.debian.org/debian buster-updates Release
404 Not Found [IP: 146.75.50.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://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.
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.
원인은, 이 nginx 컨테이너의 base OS 는 Debian Stretch 리눅스인데, Stretch 리눅스의 경우 일정 기간이 지나면 패키지 저장소가 archive 저장소로 이동된다. 따라서 현재 등록된 패키지 저장소에서 찾을 수 없다는 에러가 발생한 것이다.
따라서, http://deb.debian.org/debian 로 바라보고 있는 패키지 저장소 주소를 archive 저장소 주소로 변경해주면 해결된다.
root@sample-entrypoint:/# cat > /etc/apt/sources.list << EOF
> deb http://archive.debian.org/debian buster main
> deb http://archive.debian.org/debian-security buster/updates main
> deb http://archive.debian.org/debian buster-updates main
> EOF
/etc/apt/sources.list 에 지정된 경로에서 패키지를 가져오는데, 이 경로를 http://archive.debian.org 으로 바라보게 설정하면 된다.
이후에 다시 apt update && apt install ~~~ 실행하면 정상적으로 패키지를 업데이트하고 설치할 수 있다.
root@sample-entrypoint:/# apt update
Get:1 http://archive.debian.org/debian buster InRelease [122 kB]
Get:2 http://archive.debian.org/debian-security buster/updates InRelease [34.8 kB]
Get:3 http://archive.debian.org/debian buster-updates InRelease [56.6 kB]
Get:4 http://archive.debian.org/debian buster/main arm64 Packages [7737 kB]
Get:5 http://archive.debian.org/debian-security buster/updates/main arm64 Packages [600 kB]
Get:6 http://archive.debian.org/debian buster-updates/main arm64 Packages [8780 B]
Fetched 8559 kB in 6s (1329 kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
54 packages can be upgraded. Run 'apt list --upgradable' to see them.
'Linux' 카테고리의 다른 글
[LINUX] 자주쓰는 dd 명령어 옵션 정리 (0) | 2025.05.04 |
---|---|
[LINUX] swap file 사용하기 (0) | 2025.05.04 |
[LINUX] swap partition 사용하기 (0) | 2025.05.04 |
[LINUX] swap 이해하기 및 활성/비활성하기 (디스크 스왑, 파일 스왑) (0) | 2025.05.04 |
[LINUX] 디스크, 파티션, 파일시스템 확장하기 (0) | 2025.05.04 |