Docker 설치 apt-key is deprecated, apt-key: command not found 해결법

Docker 설치 apt-key is deprecated, apt-key: command not found 해결법

Warning, Error 발생 이유

Docker 설치 과정에서 아래와 같은 apt-key 방식으로 GPG key를 등록하는 경우가 있습니다.

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

apt-key 방식은 여러 보안 문제로 권장 되지 않는 방식이기에 아래와 같은 경고가 뜰 수 있습니다.

Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).

Ubuntu 25.04같은 최근 버전에서는 apt-key 가 아예 설치가 안 되어있기도 합니다.

apt-key: command not found

공식 Docker 설치 방식은 apt-key를 사용하지 않고 GPG Key를 등록하는 방식입니다.
설치 방법은 아래 포스팅에서 자세히 설명 하겠습니다.

Docker, Docker-compose 설치
Docker 설치 1. 패키지 업데이트, 의존성 패키지 설치 sudo apt-get update sudo apt-get install ca-certificates curl 2. Docker 공식 GPG key 등록 sudo install -m 0755 -d /etc/apt/keyrings sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc sudo chmod a+r