Disable certain processes at boot to make booting faster

TLDR: snapd taking a lot of time at boot, slowing things down. How do I disable it ?

I am trying to make my boot speed faster, I tried systemd-analyze and this was the output:

Startup finished in 4.931s (firmware) + 2.115s (loader) + 1.486s (kernel) + 3.048s (userspace) = 11.582s 
graphical.target reached after 2.590s in userspace

On trying systemd-analyze blame
I got this

18.982s systemd-tmpfiles-clean.service
 1.009s ufw.service
 1.000s systemd-modules-load.service
  868ms systemd-random-seed.service
  773ms var-lib-snapd-snap-gnome\x2d3\x2d28\x2d1804-161.mount
  752ms var-lib-snapd-snap-gtk\x2dcommon\x2dthemes-1519.mount
  735ms var-lib-snapd-snap-snapd-13270.mount
  728ms apparmor.service
  720ms dev-nvme0n1p5.device
  655ms var-lib-snapd-snap-bare-5.mount
  639ms var-lib-snapd-snap-core18-2128.mount
  632ms var-lib-snapd-snap-core20-1081.mount
  623ms var-lib-snapd-snap-core20-1169.mount
  600ms var-lib-snapd-snap-gtk\x2dcommon\x2dthemes-1515.mount
  587ms var-lib-snapd-snap-gzdoom-57.mount
  583ms udisks2.service
  581ms var-lib-snapd-snap-snapd-13170.mount
  500ms upower.service
  495ms dev-loop6.device
  483ms dev-loop7.device
  456ms tlp.service
  427ms run-media-pyramis-DATA.mount
  423ms dev-loop5.device
  370ms dev-loop4.device
  353ms dev-loop9.device
  346ms dev-loop3.device
  340ms dev-loop2.device
  339ms dev-loop1.device
  334ms dev-loop8.device
  333ms dev-loop0.device
  318ms user@1000.service
  284ms systemd-journal-flush.service
  229ms snapd.service
  225ms systemd-rfkill.service
18.982s systemd-tmpfiles-clean.service
 1.009s ufw.service
 1.000s systemd-modules-load.service
  868ms systemd-random-seed.service
  773ms var-lib-snapd-snap-gnome\x2d3\x2d28\x2d1804-161.mount
  752ms var-lib-snapd-snap-gtk\x2dcommon\x2dthemes-1519.mount
  735ms var-lib-snapd-snap-snapd-13270.mount
  728ms apparmor.service
  720ms dev-nvme0n1p5.device
  655ms var-lib-snapd-snap-bare-5.mount
18.982s systemd-tmpfiles-clean.service
 1.009s ufw.service
 1.000s systemd-modules-load.service
  868ms systemd-random-seed.service
  773ms var-lib-snapd-snap-gnome\x2d3\x2d28\x2d1804-161.mount
  752ms var-lib-snapd-snap-gtk\x2dcommon\x2dthemes-1519.mount
  735ms var-lib-snapd-snap-snapd-13270.mount
  728ms apparmor.service
  720ms dev-nvme0n1p5.device
  655ms var-lib-snapd-snap-bare-5.mount
  639ms var-lib-snapd-snap-core18-2128.mount
  632ms var-lib-snapd-snap-core20-1081.mount
  623ms var-lib-snapd-snap-core20-1169.mount
  600ms var-lib-snapd-snap-gtk\x2dcommon\x2dthemes-1515.mount
  587ms var-lib-snapd-snap-gzdoom-57.mount
  583ms udisks2.service
  581ms var-lib-snapd-snap-snapd-13170.mount
  500ms upower.service
  495ms dev-loop6.device
  483ms dev-loop7.device
  456ms tlp.service
  427ms run-media-pyramis-DATA.mount
  423ms dev-loop5.device
  370ms dev-loop4.device
  353ms dev-loop9.device
  346ms dev-loop3.device
  340ms dev-loop2.device
  339ms dev-loop1.device
  334ms dev-loop8.device
  333ms dev-loop0.device
  318ms user@1000.service
  284ms systemd-journal-flush.service
  229ms snapd.service
  225ms systemd-rfkill.service
  165ms cups.service
  136ms systemd-udev-trigger.service
  116ms systemd-udevd.service
  104ms polkit.service
  103ms boot-efi.mount
   99ms ModemManager.service
   96ms systemd-journald.service
   92ms tmp.mount
   82ms systemd-timesyncd.service
   70ms snapd.apparmor.service
   65ms avahi-daemon.service
   64ms bluetooth.service
   59ms systemd-fsck@dev-disk-by\x2duuid-84DF\x2d51C0.service
   59ms NetworkManager.service
   53ms lvm2-monitor.service
   52ms systemd-logind.service
   39ms accounts-daemon.service
   37ms swapfile.swap
   29ms colord.service
   24ms systemd-tmpfiles-setup-dev.service
   18ms wpa_supplicant.service
   17ms modprobe@fuse.service
   17ms rtkit-daemon.service
   16ms systemd-tmpfiles-setup.service
   15ms user-runtime-dir@1000.service
   15ms alsa-restore.service
   14ms systemd-binfmt.service
   12ms systemd-sysctl.service
   10ms systemd-backlight@backlight:intel_backlight.service
   10ms dev-hugepages.mount
    9ms dev-mqueue.mount
    9ms sys-kernel-debug.mount
    9ms sys-kernel-tracing.mount
    7ms kmod-static-nodes.service
    7ms systemd-remount-fs.service
    7ms systemd-update-utmp.service
    7ms modprobe@configfs.service
    7ms modprobe@drm.service
    6ms linux-module-cleanup.service
    5ms systemd-user-sessions.service
    3ms proc-sys-fs-binfmt_misc.mount
    2ms sys-fs-fuse-connections.mount
    2ms sys-kernel-config.mount
  960us snapd.socket

So snapd and its things take a lot of time to process, how do I disable snapd from opening at boot because snapd isnt the first thing that I use after I open my system
Edit: Also, can I disable `systemd-tmpfiles-clean.service``` too, It takes a lot of time.

Please use the search function.
This question is both answered in the abstract of ‘how do I handle services’ and ‘how do I speed boot’ in many many places.
Quick example here:

I encourage you to learn the fundamentals of such management from the Manjaro and Arch wikis like here:
https://wiki.archlinux.org/title/Improving_performance/Boot_process
https://wiki.archlinux.org/title/Systemd

1 Like

Why do you think you may be the only one with this question?

Although I totally agree you should search before asking the services enabled for snap support are not very obvious so here it goes again - you can safe disable the following services.

  • apparmor.service
  • snapd.apparmor.service
  • snapd.service
  • snapd.socket

If I recall correct when snap is enabled there is also an added argument to kernel command line.

apparmor=1 security=apparmor