문제해결

apt 사용 시 Release file for {url} is not valid yet 해결 방법

apt Release file for {url} is not valid yet 해결 방

리눅스 데비안 계열(Debian, Ubuntu)의 패키지 관리자인 apt 또는 apt-get을 사용하여 패키지를 업데이트하는 도중 아래와 같은 에러 메시지가 출력되며 더 이상 진행되지 않는 상황이 발생합니다.

$ sudo apt update && sudo apt upgrade

Get:1 http://ports.ubuntu.com/ubuntu-ports jammy-security InRelease [110 kB]
Hit:2 http://kr.ports.ubuntu.com/ubuntu-ports jammy InRelease
Get:3 http://kr.ports.ubuntu.com/ubuntu-ports jammy-updates InRelease [119 kB]
Get:4 http://ports.ubuntu.com/ubuntu-ports jammy-proposed InRelease [270 kB]
Get:5 http://kr.ports.ubuntu.com/ubuntu-ports jammy-backports InRelease [108 kB]
Reading package lists... Done
E: Release file for http://ports.ubuntu.com/ubuntu-ports/dists/jammy-security/InRelease is not valid yet (invalid for another 20d 22h 20min 5s). Updates for this repository will not be applied.
E: Release file for http://ports.ubuntu.com/ubuntu-ports/dists/jammy-proposed/InRelease is not valid yet (invalid for another 20d 22h 20min 33s). Updates for this repository will not be applied.
E: Release file for http://kr.ports.ubuntu.com/ubuntu-ports/dists/jammy-updates/InRelease is not valid yet (invalid for another 20d 22h 20min 16s). Updates for this repository will not be applied.
E: Release file for http://kr.ports.ubuntu.com/ubuntu-ports/dists/jammy-backports/InRelease is not valid yet (invalid for another 20d 22h 20min 44s). Updates for this repository will not be applied.

여기서 확인해볼 수 있는 에러는 아래와 같은 한줄 이상의 ‘E: Release file for ~ is not valid yet. Updates for this repository will not be applied.’ 에러 입니다:

E: Release file for http://ports.ubuntu.com/ubuntu-ports/dists/jammy-security/InRelease is not valid yet (invalid for another 20d 22h 20min 5s). Updates for this repository will not be applied.

이 문제의 원인은 패키지를 업데이트하려 했지만 유효하지 않은 시간 정보로 인해 패키지 정보 가져오기에 실패하여 발생하는 문제입니다.

이는 현재 서버에 설정된 현재 타임존 또는 시간대와 시스템의 시간대의 차이가 커서 문제가 발생한 것입니다.

문제를 해결하려면 현재 리눅스 시스템 시간을 확인하여 실제 시간과 동일한지 확인해봐야 합니다. 현재 시간으로 빠르게 재설정하려면 터미널 앱에서 아래 명령어를 입력하면 됩니다.

$ sudo hwclock --hctosys

또는 시스템 설정(하단 이미지는 Ubuntu 22.04 기준)에서 Date & Time – Automatic Date & Time 체크박스 옵션을 체크 해제한 후 다시 체크하면 시간을 다시 자동으로 설정하게 됩니다. 물론 수동으로 실제 시간과 맞추어주셔도 됩니다. (자동 시간 맞춤은 네트워크 연결이 필요할 수 있습니다.)

이제 다시 apt 패키지 관리자로 패키지를 업데이트하면 문제가 해결된 것을 확인할 수 있을 것입니다.

JooTC

안녕하세요. 테크놀로지에 관심이 많은 블로거입니다.

Recent Posts

Zalgo 텍스트와 이를 방지하는 방법

인터넷 커뮤니티 사이트에서 게시글이나 댓글에 간혹 장난을 목적으로 작성된 특이한 글자를 볼 수 있습니다. 위…

1개월 ago

리눅스 kill, killall 명령어 – 특정 프로세스 종료하기

리눅스 명령어 - kill, killall 리눅스 kill 명령어는 특정 프로세스를 종료해주는 명령어입니다. 백그라운드에서 실행되고 있는…

1개월 ago

JavaScript typeof null이 ‘object’인 이유

JavaScript는 역사가 긴 스크립트 프로그래밍 언어입니다. 세월이 흐르면서 많은 자바스크립트 표준이 만들어졌고, 현재는 많은 문법적…

1개월 ago

Mocha Error: Resolution method is overspecified. 해결 방법

NodeJS 테스트 프레임워크인 Mocha는 비동기 테스트를 지원합니다. 간혹 특정 테스트 스크립트를 작성하고 실행하면 아래와 같이…

1개월 ago

윈도우 11 설치 시 Microsoft 계정 로그인 없이 로컬 계정 만들기

언제부턴가 윈도우 11을 처음 설치할 때 마이크로소프트(Microsoft) 계정 로그인을 강제로 요구하게 되었습니다. 물론 마이크로소프트 계정이…

6개월 ago

에어팟 프로 2 케이스 스피커 소리를 완전히 끄는 방법

애플 에어팟 프로 2 (AirPods Pro 2) 케이스에는 스피커가 내장되어 있습니다. 그런데 간혹 아무 것도…

9개월 ago