#!/bin/bash

# root 권한 체크
if [ "$EUID" -ne 0 ]; then
    echo "Error: 이 스크립트는 root 권한으로 실행해야 합니다." >&2
    exit 1
fi

export DEBIAN_FRONTEND=noninteractive

sudo apt update
sudo apt-get -o APT::Get::Always-Include-Phased-Updates=true -o Dpkg::Options::="--force-confdef" full-upgrade -y
#sudo apt-get -o APT::Get::Always-Include-Phased-Updates=true -o Dpkg::Options::="--force-confold" full-upgrade -y
sudo apt autopurge -y
sudo apt autoclean -y
sudo snap refresh
