[apt] GPG error: https://cli.github.com/packages stable InRelease 에러

apt-get update를 했는데 다음과 같은 에러가 난다.

W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: https://cli.github.com/packages stable InRelease: 다음 서명이 올바르지 않습니다: EXPKEYSIG 23F3D4EA75716059 GitHub CLI <opensource+cli@github.com>
W: https://cli.github.com/packages/dists/stable/InRelease 파일을 받는데 실패했습니다  다음 서명이 올바르지 않습니다: EXPKEYSIG 23F3D4EA75716059 GitHub CLI <opensource+cli@github.com>
W: Some index files failed to download. They have been ignored, or old ones used instead.

기존 서명 키 삭제

sudo rm /usr/share/keyrings/githubcli-archive-keyring.gpg

최신 키 다운로드 및 설치

curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo tee /usr/share/keyrings/githubcli-archive-keyring.gpg > /dev/null
sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg

/etc/apt/sources.list.d/github-cli.list 파일 안에는 이렇게 되어 있다.

deb [arch=amd64 signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main