■ 자동 업데이트를 비활성화하는 방법을 보여준다.
1. CTRL + ALT + T 키를 눌러서 [터미널]을 실행한다.
2. 명령줄을 통한 자동 업데이트를 비활성화할 수 있다.
2.1 [터미널]에서 아래 명령을 실행해 [20auto-upgrades] 파일을 수정한다.
▶ 실행 명령
1 2 3 |
sudo nano /etc/apt/apt.conf.d/20auto-upgrades |
2.2 [20auto-upgrades] 파일의 아래 부분을 수정한다.
▶ 수정 사항
1 2 3 4 5 6 |
APT::Periodic::Update-Package-Lists "0"; APT::Periodic::Download-Upgradeable-Packages "0"; APT::Periodic::AutocleanInterval "0"; APT::Periodic::Unattended-Upgrade "0"; |
2.3 자동 업데이트를 다시 활성화한다면 [20auto-upgrades] 파일의 아래 부분을 수정한다.
▶ 수정 사항
1 2 3 4 5 6 |
APT::Periodic::Update-Package-Lists "1"; APT::Periodic::Download-Upgradeable-Packages "1"; APT::Periodic::AutocleanInterval "1"; APT::Periodic::Unattended-Upgrade "1"; |
3. 시스템에서 unattended-upgrades 패키지를 제거함으로써 자동 업데이트를 비활성화할 수 있다.
3.1 [터미널]에서 아래 명령을 실행해 상기 패키지를 제거한다.
▶ 실행 명령
1 2 3 |
sudo apt purge --auto-remove unattended-upgrades |
3.2 [터미널]에서 아래 명령을 실행해 시스템 업그레이드 타이머를 비활성화한다.
▶ 실행 명령
1 2 3 4 5 6 |
sudo systemctl disable apt-daily-upgrade.timer sudo systemctl mask apt-daily-upgrade.service sudo systemctl disable apt-daily.timer sudo systemctl mask apt-daily.service |
3.3 자동 업데이트를 다시 활성화하는 경우 unattended-upgrades 패키지를 설치하고 업그레이드 타이머를 활성화한다.
▶ 실행 명령
1 2 3 4 5 6 7 8 |
sudo apt install unattended-upgrades sudo systemctl enable apt-daily-upgrade.timer sudo systemctl unmask apt-daily-upgrade.service sudo systemctl enable apt-daily.timer sudo systemctl unmask apt-daily.service |
4. 스냅 업데이트를 비활성화할 수 있다.
4.1 Snap 패키지 관리자를 사용하지 않는 경우 시스템에서 완전히 제거하면 모든 업데이트도 중지된다. (옵션 1)
▶ 실행 명령
1 2 3 |
sudo apt purge --auto-remove snapd |
4.2 systemd를 구성해 우분투 실행에서 snapd 서비스를 중단할 수 있다. (옵션 2)
▶ 실행 명령
1 2 3 4 5 6 |
sudo systemctl stop snapd.service sudo systemctl stop snapd.socket sudo systemctl mask snapd.service sudo systemctl mask snapd.socket |
4.3 스냅 업데이트를 다시 활성화하는 경우 아래 명령을 실행한다.
▶ 실행 명령
1 2 3 4 5 6 |
sudo systemctl unmask snapd.service sudo systemctl unmask snapd.socket sudo systemctl start snapd.service sudo snap refresh |
4.4 /etc/hosts 파일에서 스냅 저장소에 대한 네트워크 액세스를 차단하도록 편집할 수 있다. (옵션 3)
▶ 실행 명령
1 2 3 |
sudo echo "127.0.0.1 api.snapcraft.io" >> /etc/hosts |