Technitium DNS server zone high-availability

Disable snap core service on Ubuntu 18.04

1. To disable snapd service on Ubuntu 18.04 server, run below command to view all currently runnig snap service.

administrator@nagios:/etc/systemd/system$ systemctl list-unit-files | grep snap
snap-core-4486.mount                   disabled
snap-core-4830.mount                   disabled
snapd.autoimport.service               enabled
snapd.core-fixup.service               enabled
snapd.seeded.service                   disabled
snapd.service                          disabled
snapd.snap-repair.service              static
snapd.system-shutdown.service          enabled
snapd.socket                           disabled
snapd.snap-repair.timer                enabled

2. Run below commands to disable all the enabled snap services 1 by 1.

sudo systemctl disable snapd.service
sudo systemctl disable snapd.seeded.service
sudo systemctl disable snapd.socket
sudo systemctl disable snap-core-4486.mount
sudo systemctl disable snap-core-4830.mount

Comments

Unknown said…
Thank you for your suggested method.

Based on your idea, I modify it to make it more automatic

#! /bin/bash
snap_services=$(systemctl list-unit-files | grep snap|grep enabled|cut -d ' ' -f 1)
for snap_service in $snap_services; do
cmd="sudo systemctl disable $snap_service"
echo $cmd
$cmd
done
Lee Pak Hong said…
Thanks for the script