본문 바로가기
my_lesson/_Linux

Linux - 만료 된 키 (KEYEXPIRED)를 apt로 해결하는 방법

by boolean 2016. 12. 13.
728x90

만료 된 키 (KEYEXPIRED)를 apt로 해결하는 방법
How to solve an expired key (KEYEXPIRED) with apt

EYEXPIRED는 관련 저장소 서명에서 유효성 검증이 실패했음을 보여줍니다.
The KEYEXPIRED shows that validation failed on the related repository signature.

우리가 저장소를 점검해야 한다고 경고를 하는데 이 방법은 이 문제를 해결하는데 좋은 것입니다.
This is a good thing, to warn us that we should be checking the repository.

만료 된 키가 있으면 솔루션은 간단합니다.
With an expired key, the solution is simple.

업데이트 된 키를 다운로드 해야 합니다.
we need to download an updated key.

분명히 그것은 nginx 저장소입니다.
Apparently it is for the nginx repository.

W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://nginx.org/packages/mainline/ubuntu xenial Release: The following signatures were invalid: KEYEXPIRED 1471427554 W: Failed to fetch http://nginx.org/packages/mainline/ubuntu/dists/xenial/Release.gpg The following signatures were invalid: KEYEXPIRED 1471427554 W: Some index files failed to download. They have been ignored, or old ones used instead.

Step 1: Run apt-key

Using the apt-key utility we can display all the known keys.

apt-key list

우리의 경우, 며칠 전에 nginx 키가 만료되었음을 알 수 있습니다 :

In our case, we see the nginx key is expired a few days ago:

pub 2048R/7BD9BF62 2011-08-19 [expired: 2016-08-17]
uid nginx signing key <signing-key@nginx.com>

Two items are highlighted in this example. The first one is the short version of the key. The second one is showing that the key is expired (including the date). This key was valid for almost 5 years.

To quickly find the expired keys, search for “expired:”:

apt-key list | grep “expired:”

Step 2: Update the key

We can now use the key gathered in step 1 to update it:

apt-key adv --keyserver keys.gnupg.net --recv-keys [KEY]

The output might look like this:

Screenshot of apt to renew an expired APT key

The key is renewed, after choosing the right one (otherwise no change is made)

On purpose we selected an incorrect key, which was also related to nginx:

/etc/apt/trusted.gpg.d/nginx-development.gpg
——————————————–
pub 1024R/C300EE8C 2010-07-21
uid Launchpad Stable

As you can see in the output above, nothing happens when you select the wrong key.

Step 3: Update

After renewing the expired key you can run apt update again and install any available upgrades.

apt update && apt upgrade



댓글