사용자 도구

사이트 도구


linux:apt

차이

문서의 선택한 두 판 사이의 차이를 보여줍니다.

차이 보기로 링크

양쪽 이전 판 이전 판
다음 판
이전 판
linux:apt [2023/02/19 16:31]
kwon37xi [다음 패키지를 과거 버전으로 유지합니다:]
linux:apt [2025/05/14 16:57] (현재)
kwon37xi [ansible 의 경우]
줄 119: 줄 119:
 man apt-key 8 man apt-key 8
 </code> </code>
-  * ''apt-key'' 명령은 deprecated 상태라고 보면 된다. 아래와 같은 명령을 사용한다면 후자로 변경해줘야 한다.+  * ''apt-key'' 명령은 **deprecated** 되었으며 [[linux:ubuntu:25.04|Ubuntu 25.04]]에서는 아예 삭제되었다. 아래와 같은 명령을 사용한다면 후자로 변경해줘야 한다. 
 +  * [[devops:ansible|Ansible]] 에서 ''apt-key''도 사용하지 말 것. 
 + 
 +==== script의 경우 ==== 
 <code sh> <code sh>
 +# 사용 금지
 wget -qO- https://myrepo.example/myrepo.asc | sudo apt-key add - wget -qO- https://myrepo.example/myrepo.asc | sudo apt-key add -
 +
 +# 이렇게 사용. 
 wget -qO- https://myrepo.example/myrepo.asc | sudo tee /etc/apt/trusted.gpg.d/myrepo.asc wget -qO- https://myrepo.example/myrepo.asc | sudo tee /etc/apt/trusted.gpg.d/myrepo.asc
 </code> </code>
줄 128: 줄 135:
   * Open PGP 바이너리의 경우(''%%gpg --dearmor%%'' 로 저장했거나) **''.gpg''** 확장자로 저장해야 한다.   * Open PGP 바이너리의 경우(''%%gpg --dearmor%%'' 로 저장했거나) **''.gpg''** 확장자로 저장해야 한다.
  
 +==== ansible 의 경우 ====
 +  * [[https://docs.ansible.com/ansible/latest/collections/ansible/builtin/deb822_repository_module.html|ansible.builtin.deb822_repository module – Add and remove deb822 formatted repositories — Ansible Community Documentation]]
 +    * Repository 추가와 key 추가를 함께 동시에 한다.
 +  * [[https://gist.github.com/roib20/27fde10af195cee1c1f8ac5f68be7e9b|Example usages of the new `deb822_repository` Ansible module · GitHub]]
 +
 +<code yaml>
 +- name: Add repo using key from URL
 +  deb822_repository:
 +    name: example
 +    types: deb
 +    uris: https://download.example.com/linux/ubuntu
 +    suites: '{{ ansible_distribution_release }}'
 +    components: stable
 +    architectures: amd64
 +    signed_by: https://download.example.com/linux/ubuntu/gpg
 +</code>
 +  * https://gist.github.com/roib20/27fde10af195cee1c1f8ac5f68be7e9b : 각종 deb 패키지 리포지토리 예시
 ===== CheatSheet ===== ===== CheatSheet =====
   * [[http://www.cyberciti.biz/tips/linux-debian-package-management-cheat-sheet.html|Debian Linux apt-get package management cheat sheet]]   * [[http://www.cyberciti.biz/tips/linux-debian-package-management-cheat-sheet.html|Debian Linux apt-get package management cheat sheet]]
linux/apt.1676791881.txt.gz · 마지막으로 수정됨: 2023/02/19 16:31 저자 kwon37xi