JooTC
linux-apt-failed-due-to-time-expired

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 체크박스 옵션을 체크 해제한 후 다시 체크하면 시간을 다시 자동으로 설정하게 됩니다. 물론 수동으로 실제 시간과 맞추어주셔도 됩니다. (자동 시간 맞춤은 네트워크 연결이 필요할 수 있습니다.)

linux-change-date-time-from-settings

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

구독
알림
guest

0 Comments
Inline Feedbacks
모든 댓글 보기
0
이 포스트에 대한 의견을 남겨주세요!x