카테고리 없음

[Docker 설치]curl libssl1.0.0 error와 the GPG error "NO_PUBKEY"가 둘 다 뜰 때 해결법

parkjoohye 2022. 11. 22. 13:58

https://shanepark.tistory.com/237

 

Ubuntu 20.04 LTS ) Docker 설치하기

Intro Docker는 제가 회사에서 사용하는 노트북의 OS를 Windows 에서 Ubuntu 로 변경하게 된 트리거 였습니다. Docker를 사용하면 정말 편하게 격리된 컨테이너들을 구성해 가상화의 장점을 정말 잘 살릴

shanepark.tistory.com

Docker 설치 메뉴얼은 위의 링크를 따라서 하면 된다.

 

 

 

 

나의 경우 UBUNTU 20.04이고

 

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

 

이 명령어를 치면

 

libssl.so.1.0.0: cannot open shared object file: No such file or directory

 

위와 같은 에러가 발생한다.

 

sudo apt-get openssl

sudo apt-get curl

 

등 위의 library를 삭제했다가 다시 최신 버전으로 다시 깔아도 위의 에러가 해결되지 않는다.

 

거기서 혹시나 관리자 권한으로

 

sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

 

하면

 

OK

 

라고 떠서 잘 작동하는 것 같다. (완전 속음)

 

 

 

그 다음의 명령어와 sudo apt-get update를 실행시키면

 

GPG error "NO_PUBKEY"가 뜬다. 

 

에러 메세지는

 

root@master:/home/ubuntu# add-apt-repository \
>   "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
>   $(lsb_release -cs) \
>   stable"
Hit:1 http://in.archive.ubuntu.com/ubuntu bionic InRelease
Get:2 https://download.docker.com/linux/ubuntu bionic InRelease [64.4 kB]
Hit:3 http://in.archive.ubuntu.com/ubuntu bionic-updates InRelease
Hit:4 http://in.archive.ubuntu.com/ubuntu bionic-backports InRelease
Hit:5 http://in.archive.ubuntu.com/ubuntu bionic-security InRelease
**Err:2 https://download.docker.com/linux/ubuntu bionic InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 7EA0A9C3F273FCD8**
Reading package lists... Done
W: GPG error: https://download.docker.com/linux/ubuntu bionic InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 7EA0A9C3F273FCD8
**E: The repository 'https://download.docker.com/linux/ubuntu bionic InRelease' is not signed.**
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
root@master:/home/ubuntu#

위와 같다.

 

 

그래서 구글에다가 GPG error "NO_PUBKEY" 를 치면 대부분 다 아래처럼 하라고 한다.

 

https://jellybeanz.medium.com/ubuntu-no-pubkey-7ea0a9c3f273fcd8-%EB%AC%B8%EC%A0%9C-%ED%95%B4%EA%B2%B0-520176e3424c

 

UBUNTU NO_PUBKEY 7EA0A9C3F273FCD8 문제 해결

UBUNTU 를 사용하다가 apt update 를 하면 간혹 NO_PUBKEY 메세지가 나오는 경우가 있다.

jellybeanz.medium.com

apt-key adv --keyserver-options [http-proxy=PROXY SERVER] --keyserver keyserver.ubuntu.com --recv 7EA0A9C3F273FCD8

 

대부분 위에 키 등록하면 잘 된다고 나와있지만,

 

위의 내용들을 다 해봐도 잘 안된다면 curl을 의심해야한다.

 

애초에 curl에서 부터 못받아와서 꼬였기 때문에 당연하게 PUBKEY를 받아오지 못한다.

 

그래서 다시 돌아가서 curl에서 libssl1.0.0을 받아 오지 못하는거를 고쳐야하는데,

 

libssl은 openssl을 설치하면서 설치되는 하위 lib이다.

 

현재 쓰고 있는 curl은 libssl1.0.0을 받아서 쓰는데,

 

sudo apt-get install libssl1.0.0

 

하면 그런 candidate가 없다고 뜬다.

 

조금 더 search해보면 ubuntu 20.04부터는 libssl1.0.0을 지원하지 않고 최신 opensll을 깔면 자동으로 그 위의 버전이 깔린다.

 

그래서 curl이 libssl1.0.0를 못 찾는다고 한거고 이제 1.0.0 깔려면 수동으로 깔아줘야한다.

 

wget http://nz2.archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2.16_amd64.deb

sudo dpkg -i libssl1.1_1.1.1f-1ubuntu2.16_amd64.deb

 

 

위는 그저 예시로 가져온 거고 버전은 1.0.0으로 바꿔서 가져와야한다.

 

wget 명령어 안쓰고 홈페이지 타서 여러 버전들 중에서 원하는 걸로 다운로드 후,

 

밑에 명령어를 실행시켜도 똑같이 잘 작동된다.

 

이제 curl을 sudo 없이해도 잘 작동하면 성공!

 

다음은 다시

 

sudo apt-get update를 해준다.

 

이전처럼 pubkey error가 뜨지는 않지만, 이전에 고군분투하며 여러 삽질을 했더니 레파지토리가 중복되면서 다음과 같은 에러가 발생했다.

 

W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:33 and /etc/apt/sources.list:87
W: Target Packages (main/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list:33 and /etc/apt/sources.list:87
W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:33 and /etc/apt/sources.list:87
W: Target Translations (main/i18n/Translation-en_GB) is configured multiple times in /etc/apt/sources.list:33 and /etc/apt/sources.list:87
W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:33 and /etc/apt/sources.list:87
W: Target DEP-11 (main/dep11/Components-amd64.yml) is configured multiple times in /etc/apt/sources.list:33 and /etc/apt/sources.list:87
W: Target DEP-11-icons (main/dep11/icons-64x64.tar) is configured multiple times in /etc/apt/sources.list:33 and /etc/apt/sources.list:87
W: Target Packages (restricted/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:33 and /etc/apt/sources.list:87
W: Target Packages (restricted/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list:33 and /etc/apt/sources.list:87
W: Target Packages (restricted/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:33 and /etc/apt/sources.list:87
W: Target Translations (restricted/i18n/Translation-en_GB) is configured multiple times in /etc/apt/sources.list:33 and /etc/apt/sources.list:87
W: Target Translations (restricted/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:33 and /etc/apt/sources.list:87
W: Target DEP-11 (restricted/dep11/Components-amd64.yml) is configured multiple times in /etc/apt/sources.list:33 and /etc/apt/sources.list:87
W: Target DEP-11-icons (restricted/dep11/icons-64x64.tar) is configured multiple times in /etc/apt/sources.list:33 and /etc/apt/sources.list:87
W: Target Packages (multiverse/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:33 and /etc/apt/sources.list:87
W: Target Packages (multiverse/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list:33 and /etc/apt/sources.list:87
W: Target Packages (multiverse/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:33 and /etc/apt/sources.list:87
W: Target Translations (multiverse/i18n/Translation-en_GB) is configured multiple times in /etc/apt/sources.list:33 and /etc/apt/sources.list:87
W: Target Translations (multiverse/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:33 and /etc/apt/sources.list:87
W: Target DEP-11 (multiverse/dep11/Components-amd64.yml) is configured multiple times in /etc/apt/sources.list:33 and /etc/apt/sources.list:87
W: Target DEP-11-icons (multiverse/dep11/icons-64x64.tar) is configured multiple times in /etc/apt/sources.list:33 and /etc/apt/sources.list:87
W: The repository 'http://extras.ubuntu.com/ubuntu xenial Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.

 

 

이것도 구글링해보면 여러가지 방법들이 있는데

 

 rm -rf /var/lib/apt/lists/*

 

나의 경우 위의 명령어로 겹치는 리스트들을 삭제하면

 

sudo  apt-get update 했을 때,

아무 문제 없이 잘 되는 것을 확인할 수 있었다.

 

그 다음부터는 다른 docker 설치 메뉴얼대로 그대로 따라하면 된다.!

 

끝.... !