본문 바로가기

Linux Distribution

우분투 20.04에서 Snap 완전히 제거하는 방법

728x90
반응형

우분투 20.04에서 Snap 완전히 제거하는 방법

Snap은 기본적으로 Ubuntu 20.04에 포함되어 있지만 필요하지 않다면 완전히 제거할 수 있습니다.

테스트 환경

$ lsb_release -d
Description:    Ubuntu 20.04.6 LTS

1. Snap 관련 서비스 비활성화

sudo systemctl disable snapd.service snapd.socket snapd.seeded.service
Removed /etc/systemd/system/cloud-final.service.wants/snapd.seeded.service.
Removed /etc/systemd/system/multi-user.target.wants/snapd.seeded.service.
Removed /etc/systemd/system/multi-user.target.wants/snapd.service.
Removed /etc/systemd/system/sockets.target.wants/snapd.socket.

2. Snap 패키지 제거

$ sudo snap list
Name    Version        Rev    Tracking       Publisher   Notes
core20  20230207       1828   latest/stable  canonical✓  base
lxd     4.0.9-a29c6f1  24061  4.0/stable/…   canonical✓  -
snapd   2.58.2         18357  latest/stable  canonical✓  snapd
sudo snap remove lxd
sudo snap remove core20
sudo snap remove snapd

3. Snap 패키지 관리자 제거

$ dpkg -l snap
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name           Version      Architecture Description
+++-==============-============-============-=================================
un  snap           <none>       <none>       (no description available)
sudo apt autoremove --purge -y snapd
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
  snapd* squashfs-tools*
0 upgraded, 0 newly installed, 2 to remove and 56 not upgraded.
After this operation, 104 MB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database ... 72360 files and directories currently installed.)
Removing snapd (2.63+20.04ubuntu0.1) ...
Removing squashfs-tools (1:4.4-1ubuntu0.3) ...
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for dbus (1.12.16-2ubuntu2.3) ...
Processing triggers for mime-support (3.64ubuntu1) ...
(Reading database ... 72259 files and directories currently installed.)
Purging configuration files for snapd (2.63+20.04ubuntu0.1) ...
rmdir: failed to remove '/etc/systemd/system/snapd.mounts.target.wants': No such file or directory
Discarding preserved snap namespaces
Final directory cleanup
Removing extra snap-confine apparmor rules
Removing snapd cache
Removing snapd state

4. Snap 관련 디렉터리 삭제

rm -rf ~/snap
sudo rm -rf /snap /var/snap /var/cache/snapd

5. APT 패키지 자동 설치 방지 (선택 사항)

sudo apt-mark hold snapd
snapd set on hold.

 

우분투 20.04에서 Snap이 완전히 제거되었습니다.

 

728x90
반응형