Ubuntu 22.04 (Jammy Jellyfish) – 3 updates could not be installed automatically.

외부에서 접속1한 후 아래와 같은 메시지를 확인하게 되는 경우가 있다.

3 updates could not be installed automatically. For more details,
see /var/log/unattended-upgrades/unattended-upgrades.log
Last login: (요일) (월) (일) (시각) (년) from aaa.bbb.ccc.ddd

그냥 냅둬도 시스템에 이상은 없으나 로그인 할 때마다 눈에 띄어 걸그적거려서 검색을 하다 아래의 글을 발견했다.

상기 글 내용 중에 본인이 차례로 터미널에서 적용한 내용은 아래와 같다.

  1. sudo apt update && sudo apt -y upgrade 입력
  2. apt list --installed | grep 'unattended-upgrades\|apt-listchanges\|bsd-mailx' 입력하여 3가지 패키지 중에서 설치 안된 패키지를 sudo apt install 미설치_패키지 입력하여 설치
  3. sudo dpkg-reconfigure -plow unattended-upgrades 입력
  4. Configure unattended-upgrade CLI 팝업 내용 하단에 있는 Automatically download and install stable updates? 질문에 <Yes> 선택
  5. sudo vi /etc/apt/apt.conf.d/50unattended-upgrades 입력
  6. 내용 중에 //Unattended-Upgrade::Mail ""; 내용을 Unattended-Upgrade::Mail "메일@계정"; 내용으로 변경
  7. 내용 중에 //Unattended-Upgrade::Automatic-Reboot "false"; 내용을 Unattended-Upgrade::Automatic-Reboot "true"; 내용으로 변경 후 저장 & 종료
  8. sudo vi /etc/apt/listchanges.conf 입력
  9. 내용 중에 email_address=root 내용을 email_address=메일@계정 내용으로 변경 후 저장 & 종료
  10. sudo unattended-upgrades --dry-run 입력하여 정상적으로 다음 행에 프롬프트 나오면 일단 완료!!!
  11. sudo vi /etc/rc.local 입력 후 아래처럼 차례로 명령문 추가 후 저장
    #!/bin/bash
    
    // 부팅 시 실행하고 싶은 명령어 or 스크립트 작성
    unattended-upgrades --dry-run
    
    exit 0
  12. sudo chmod +x /etc/rc.local 입력
  13. sudo vi /lib/systemd/system/rc-local.service 입력 후 아래처럼 문구 추가 후 저장
    [Install]
    WantedBy=multi-user.target
  14. sudo systemctl enable rc-local.service 입력
  15. sudo systemctl start rc-local.service 입력
  16. 재부팅하여 3 updates could not be installed automatically. For more details, ···blah blah··· 문구 없어진 것을 최종 확인!!!

이후 외부에서 접속하면 제목에서 명기한 메시지를 더이상 보지 않게 된다.

Views: 6

Footnotes

  1. 보통 ssh 이용하여 CLI 접속하는 경우를 의미한다.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.