Page 1 of 3 123 LastLast
Results 1 to 10 of 25

Thread: Snaps bloating out my / partition

  1. #1
    Join Date
    Mar 2011
    Location
    19th Hole
    Beans
    Hidden!
    Distro
    Ubuntu 22.04 Jammy Jellyfish

    Snaps bloating out my / partition

    I'm not trying to start another snap war, but it's creating the following issue for me:

    Problem:

    For years, I've set aside 30 GB for each / on my main multiboot box, which has always been more than enough. But, to my consternation, I've discovered that I'm running out of space on one of them. A quick scan shows the following:
    Code:
    duckhook@Zeus:~$  sudo du -cha --max-depth=1 /snap | grep -E "M|G"
    [sudo] password for duckhook: 
    1.6G	/snap/makemkv
    868M	/snap/kde-frameworks-5-core18
    395M	/snap/core20
    486M	/snap/lxd
    4.0K	/snap/README
    846M	/snap/signal-desktop
    1.1G	/snap/gnome-3-38-2004
    678M	/snap/gtk-common-themes
    1.7G	/snap/gnome-3-34-1804
    312M	/snap/snap-store
    338M	/snap/core18
    1.3G	/snap/gnome-3-28-1804
    1.8G	/snap/telegram-desktop
    596M	/snap/core
    12G	/snap
    12G	total
    This is nuts. ≈2 GB for an app like Telegram??? I can't get rid of snap entirely because I rely on LXD which only comes as a snap these days, but I will delete my Telegram, Signal and MakeMKV snaps and reinstall them as PPAs instead (though it grates on me to add PPAs), so those are solvable. But the following questions remain:

    1. Why do I have (?):
      Code:
      kde-frameworks-5-core18
      The description reads:
      Code:
      duckhook@Zeus:~$  snap info kde-frameworks-5-core18
      name:      kde-frameworks-5-core18
      summary:   KDE Frameworks 5
      publisher: KDE✓
      store-url: https://snapcraft.io/kde-frameworks-5-core18
      contact:   https://www.kde.org/support/
      license:   unset
      description: |
        KDE Frameworks are addons and useful extensions to Qt
      snap-id:      GeIofQKAwadB4OEM8lOzdSMAc56sCNdL
      tracking:     latest/stable
      refresh-date: 2020-04-24
      channels:
        latest/stable:    5.61.0                         2019-08-27 (32) 273MB -
        latest/candidate: 5.67.0                         2020-02-17 (35) 303MB -
        latest/beta:      ↑                                                    
        latest/edge:      5.54.0+p18.04+git20190115.0202 2019-01-16 (25) 250MB -
      installed:          5.61.0                                    (32) 273MB -
      ..but I don't run KDE. I run vanilla Ubuntu with Gnome, so why do I need this? Can it be safely removed?
    2. Likewise, why (?):
      Code:
      gnome-3-28-1804
      gnome-3-34-1804
      gnome-3-38-2004
      Are all of these needed? Are any needed? The descriptions are singularly unhelpful and it seems that my websearch-fu has gone AWOL:
      Code:
      duckhook@Zeus:~$  snap info gnome-3-28-1804
      name:      gnome-3-28-1804
      summary:   Shared GNOME 3.28 runtime for Ubuntu 18.04
      publisher: Canonical✓
      store-url: https://snapcraft.io/gnome-3-28-1804
      contact:   https://gitlab.gnome.org/Community/Ubuntu/gnome-3-28-1804/issues
      license:   unset
      description: |
        This snap includes a GNOME 3.28 stack (the base libraries and desktop
        integration components) and shares it through the content interface.
      snap-id:      TKv5Fm000l4XiUYJW9pjWHLkCPlDbIg1
      tracking:     latest/stable
      refresh-date: 2021-07-16
      channels:
        latest/stable:    3.28.0-19-g98f9e67.98f9e67 2021-07-08 (161) 172MB -
        latest/candidate: 3.28.0-19-g98f9e67.98f9e67 2021-10-26 (166) 172MB -
        latest/beta:      ↑                                                 
        latest/edge:      ↑                                                 
      installed:          3.28.0-19-g98f9e67.98f9e67            (161) 172MB -
      duckhook@Zeus:~$  snap info gnome-3-34-1804
      name:      gnome-3-34-1804
      summary:   Shared GNOME 3.34 Ubuntu stack
      publisher: Canonical✓
      store-url: https://snapcraft.io/gnome-3-34-1804
      license:   unset
      description: |
        This snap includes a GNOME 3.34 stack (the base libraries and desktop
        integration components) and shares it through the content interface.
      snap-id:      TIM9dBBJEceEjMpwaB3fiuZ3AdSykgDO
      tracking:     latest/stable/ubuntu-21.10
      refresh-date: 36 days ago, at 16:27 MST
      channels:
        latest/stable:    0+git.3556cb3 2021-11-22 (77) 229MB -
        latest/candidate: 0+git.3556cb3 2021-10-26 (77) 229MB -
        latest/beta:      ↑                                   
        latest/edge:      ↑                                   
      installed:          0+git.3556cb3            (77) 229MB -
      duckhook@Zeus:~$  snap info gnome-3-38-2004
      name:      gnome-3-38-2004
      summary:   Shared GNOME 3.38 Ubuntu stack
      publisher: Canonical✓
      store-url: https://snapcraft.io/gnome-3-38-2004
      license:   unset
      description: |
        This snap includes a GNOME 3.38 stack (the base libraries and desktop
        integration components) and shares it through the content interface.
      snap-id:      rw36mkAjdIKl13dzfwyxP87cejpyIcct
      tracking:     latest/stable
      refresh-date: 36 days ago, at 16:27 MST
      channels:
        latest/stable:    0+git.cd626d1 2021-11-22 (87) 259MB -
        latest/candidate: 0+git.cd626d1 2021-12-17 (90) 260MB -
        latest/beta:      ↑                                   
        latest/edge:      ↑                                   
      installed:          0+git.cd626d1            (87) 259MB -
      I've moved on from 18.04 years ago. I'm guessing that at least two of these are redundant and have been superseded by their newer replacements, but cannot be sure―it's a wild guess. If so, why have such bloated stubs been left hanging around? Wouldn't the network upgrade process have cleaned them up?
    3. Canonical's move to snaps has left guys like me stranded high and dry. I don't want the hassle of having to grow all of my / partitions which, as a result of past shortsightedness, are packed cheek by jowl next to each other. Yet, I know that as more and more basic apps are shuffled off to snaps, this will just become a growing pain problem. So, can I relocate /snap to another partition post install? If any of you have done this, can you point me to a decent tutorial?
    4. Do I need both:
      Code:
      core18
      core20
      Is one of them also redundant/obsolete? Can core18 be safely removed?

    I would normally tinker away on my own, but since this is my production box, I don't want to mess it up.
    Last edited by wildmanne39; January 4th, 2022 at 09:58 PM.

  2. #2
    Join Date
    Oct 2005
    Location
    Lab, Slovakia
    Beans
    10,783

    Re: Snaps bloating out my / partition

    There is a simple solution. You can create a partition on another disk and mount it on /snap

  3. #3
    Join Date
    May 2008
    Beans
    3,947
    Distro
    Ubuntu 22.04 Jammy Jellyfish

    Re: Snaps bloating out my / partition

    Quote Originally Posted by DuckHook View Post
    Do I need both:
    Code:
    core18
    core20
    Is one of them also redundant/obsolete? Can core18 be safely removed?
    I tried to remove core18 with the following result:-

    Code:
    edited@edited:~$ snap list
    Name               Version                     Rev    Tracking       Publisher     Notes
    bare               1.0                         5      latest/stable  canonical✓    base
    core               16-2.52.1                   11993  latest/stable  canonical✓    core
    core18             20211028                    2253   latest/stable  canonical✓    base
    core20             20211129                    1270   latest/stable  canonical✓    base
    get-iplayer        3.27                        315    latest/stable  snapcrafters  -
    gnome-3-28-1804    3.28.0-19-g98f9e67.98f9e67  161    latest/stable  canonical✓    -
    gnome-3-34-1804    0+git.3556cb3               77     latest/stable  canonical✓    -
    gnome-3-38-2004    0+git.cd626d1               87     latest/stable  canonical✓    -
    gnome-characters   41.0-6-g3387c148db          761    latest/stable  canonical✓    -
    gtk-common-themes  0.1-59-g7bca6ae             1519   latest/stable  canonical✓    -
    snap-store         3.38.0-66-gbd5b8f7          558    latest/stable  canonical✓    -
    snapd              2.53.4                      14295  latest/stable  canonical✓    snapd
    vimix-themes       2020-02-24-15-g426d7e0      2      latest/stable  gantonayde    -
    edited@edited:~$ sudo snap remove core18
    [sudo] password for edited: 
    error: cannot remove "core18": snap "core18" is not removable: snap is being used by snaps
           get-iplayer, gnome-3-28-1804, gnome-3-34-1804, gnome-characters, gtk-common-themes and 2
           more.
    edited@edited:~$
    I wish that I understood snaps completely, but sadly, I do not.................

  4. #4
    Join Date
    Apr 2011
    Location
    Mystletainn Kick!
    Beans
    13,596
    Distro
    Ubuntu

    Re: Snaps bloating out my / partition

    The /snap directory holds nothing in the hard drive.
    snaps on disk are inside the /var/lib/snapd/snaps directory.
    if they were in /snap then i'd have run out of space by a couple dozen gigabytes by now.
    Interestingly the /snap/README file actually tries to explain this.

    As far as core versions are concerned I think certain snaps can only run with certain cores.
    Same applies to the varying gnome/gtk frameworks.
    Not sure what the kde framework is for, none of the snaps listed seem to have any use for it.
    though I didn't dig too deep on that.

    Also, I would think the /snap directory is showing all within the directory which also includes any other revisions for the mount for a particular snap.
    Look at
    Code:
    snap list --all
    for the full snap listing, which will include any extra revisions.

    You can then proceed to remove any older revisions you may want by either doing so piecemeal like
    Code:
    snap remove snap-package-name-here --revision ##
    (replace snap-package-name-here with the snap name and replace ## with the rev number that is listed for the revision you want to remove.)

    Or you can run a simple script like this:
    Code:
    #!/bin/sh
    set -eu
    
    snap list --all | awk '/disabled/{print $1, $3}' |
        while read snapname revision; do
            snap remove "$snapname" --revision="$revision"
        done
    Which will remove all extra revisions of all snaps.

    I not sure what the default is now but I think it's set to keep up to 2 revisions
    (meaning you can have 3 versions of a snaps on disk, but can be set to only keep 2.
    (2 is the absolute minimal)
    See this on how to set those: https://snapcraft.io/docs/keeping-sn...refresh-retain
    Splat Double Splat Triple Splat
    Earn Your Keep
    Don't mind me, I'm only passing through.
    Once in a blue moon, I'm actually helpful
    .

  5. #5
    Join Date
    Jul 2005
    Location
    I think I'm here! Maybe?
    Beans
    Hidden!
    Distro
    Xubuntu 22.04 Jammy Jellyfish

    Re: Snaps bloating out my / partition

    If you do not even use any KDE applications I can see little reason for a need for that kde-frameworks-5-core18 snap package to be needed.

    I run Xubuntu and have done so for the past 12 years or so and I had a similar uncertainty when I removed all snaps including several gnome packages from 20.04 which I think appeared when I installed chromium before realising it dragged in the whole snap infrastructure.
    I went ahead and removed all snap packages and snapd from the system, installed chromium using a PPA, and as far as I can see it has caused absolutely no problems of any sort, even though I do run a few more standard gnome applications eg, gthumb.

    And if you do remove the snap system completely then find it causes a problem you can just restore snapd and the kde-frameworks package again, as well as all the other snaps you currently have.

  6. #6
    Join Date
    Mar 2011
    Location
    U.K.
    Beans
    Hidden!
    Distro
    Ubuntu 22.04 Jammy Jellyfish

    Re: Snaps bloating out my / partition

    I wish that I understood snaps completely, but sadly, I do not.................
    I can offer an idea for easier visibility of snaps (although you can list them via command line).

    I have Stacer installed (PPA) and I can see all snaps under Processes (search snap) and Uninstaller windows.

  7. #7
    Join Date
    Dec 2014
    Beans
    2,565

    Re: Snaps bloating out my / partition

    The core, gnome and kde snaps are for other snaps to plug into. They are dependencies. You need Gnome in snap because Applications that come as snaps can't "see" the Gnome that's already on your system. You need different core and gnome snaps because various snaps might depend on different version of the core libraries. Welcome to dependency-hell, snap-style: few dependencies but really big ones which are then kept in multiple revisions (see 'snap list --all', snap keeps at least one old revision so you can roll back updates which don't work right).

    And putting /snap on a different partition won't help. that's just the mount point for the squashfs inside the snap-packages. The directory you want to put somewhere else is /var/lib/snapd/snaps/, which is the place where the actual snap packages sit.

    Holger

  8. #8
    Join Date
    Mar 2011
    Location
    19th Hole
    Beans
    Hidden!
    Distro
    Ubuntu 22.04 Jammy Jellyfish

    Re: Snaps bloating out my / partition

    Thanks to all for the veritable avalanche of help.

    @ajgreeny

    I can't just get rid of snaps because LXD depends on it, and I have come to depend on LXD.

    @deadflowr & Holger_Gehrke

    Thanks for the insights into the guts of this monster. All I can say is: Wow.

    I might just shift my whole /var partition someplace else. The new journald logs are also pigs, so it would help there too. I've shifted system partitions post‑install in the past but it's always a fraught exercise. I'll sleep on that one first.

    My problem is exacerbated by the fact that I have three / partitions for which I must duplicate this strategy. <sigh>

    I might just empty my install of all but critical snaps and keep it at bare minimum. Don't know what I will do when must‑have apps like Firefox get snapped. Will cross that bridge when I come to it I suppose.

  9. #9
    Join Date
    Dec 2014
    Beans
    2,565

    Re: Snaps bloating out my / partition

    Quote Originally Posted by DuckHook View Post
    The new journald logs are also pigs, so it would help there too.
    That's one very tame-able pig: read 'man 5 journald.conf' and configure SystemMaxUse, RunTimeMaxUse, and MaxRetentionSec to your taste. Because of its binary format (basically the id of a catalogue, the id of a message from the catalogue and values for placeholders in the message) the journal is actually more compact then an (uncompressed) clear text log. You could also run journalctl with one of '--vacuum-time=...', '--vacuum-size=...' or '--vacuum-files' to cut the journal down to size. A big journal usually means you're keeping multiple years worth of messages on the system.

    Holger

  10. #10
    Join Date
    Mar 2011
    Location
    19th Hole
    Beans
    Hidden!
    Distro
    Ubuntu 22.04 Jammy Jellyfish

    Re: Snaps bloating out my / partition

    Quote Originally Posted by Holger_Gehrke View Post
    That's one very tame-able pig: read 'man 5 journald.conf' and configure SystemMaxUse, RunTimeMaxUse, and MaxRetentionSec to your taste. Because of its binary format (basically the id of a catalogue, the id of a message from the catalogue and values for placeholders in the message) the journal is actually more compact then an (uncompressed) clear text log. You could also run journalctl with one of '--vacuum-time=...', '--vacuum-size=...' or '--vacuum-files' to cut the journal down to size. A big journal usually means you're keeping multiple years worth of messages on the system.

    Holger
    Thanks Holger.

    I've set these parameters in the past. It's hard on my aging brain to remember to do such housekeeping on new installs. Release upgrades also tend to replace config files.

    I've had to help out new users with such bloat by using exactly these methods so you would think I would remember. Why do these workarounds have to be so obscure? (Please pardon the rant.)

    There's still something to be said for relocating /var. That directory tends to grow with lots of funny oddities hiding in the dark, like a hidden ecosystem of mould or mushrooms. Example: I wasn't aware that it held all that snap stuff. But I gotta weigh taking on that project against my sloth.

    Thanks to all for your input.

Page 1 of 3 123 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •