Old Ubuntu core snap versions are filling up disk space











up vote
18
down vote

favorite
3












I am running Ubuntu 16.10 with snapd and the basic core snap installed since it was released.

After some time I observed that the /snap/core directory fills up with multiple older versions.

To remove them I'll have to execute sudo snap remove core --revision <number> manually.



Multiple versions of snaps & garbage collection section in
Snaps and snapcraft documentation explains that after every update of a snap package the current version and the one before are installed and older versions are getting automatically removed (just as it was earlier the case).



As I cannot find further information in snap help, I am asking whether there is a setting or a switch command in snapd to enable automatic removal of those older core snap packages.

Additional information : What I described is valid for 3 machines with the same configuration.










share|improve this question




















  • 1




    The default in snapd is to keep 3 versions, current and two previous. How many were you seeing?
    – popey
    Mar 22 '17 at 12:22






  • 2




    Thanks for this information @popey ! Whenever I found more than two core versions, I uninstalled the oldest one manually and in most cases I saw three installed versions, but I am not sure if I also found four versions before. Why does the documentation provide a different information ? Can I change the default settings to keep only the current and the one before ? Maybe you can explain it by writing an answer ? :)
    – cl-netbox
    Mar 22 '17 at 13:27










  • If you're seeing more than 3 then it's a bug in my mind, so I'd file it at bugs.launchpad.net/ubuntu/+source/snapd . Would need to see the output of "snap changes" and show directory listing maybe in /snap/<appname> to show multiple installed versions.
    – popey
    Mar 31 '17 at 11:02















up vote
18
down vote

favorite
3












I am running Ubuntu 16.10 with snapd and the basic core snap installed since it was released.

After some time I observed that the /snap/core directory fills up with multiple older versions.

To remove them I'll have to execute sudo snap remove core --revision <number> manually.



Multiple versions of snaps & garbage collection section in
Snaps and snapcraft documentation explains that after every update of a snap package the current version and the one before are installed and older versions are getting automatically removed (just as it was earlier the case).



As I cannot find further information in snap help, I am asking whether there is a setting or a switch command in snapd to enable automatic removal of those older core snap packages.

Additional information : What I described is valid for 3 machines with the same configuration.










share|improve this question




















  • 1




    The default in snapd is to keep 3 versions, current and two previous. How many were you seeing?
    – popey
    Mar 22 '17 at 12:22






  • 2




    Thanks for this information @popey ! Whenever I found more than two core versions, I uninstalled the oldest one manually and in most cases I saw three installed versions, but I am not sure if I also found four versions before. Why does the documentation provide a different information ? Can I change the default settings to keep only the current and the one before ? Maybe you can explain it by writing an answer ? :)
    – cl-netbox
    Mar 22 '17 at 13:27










  • If you're seeing more than 3 then it's a bug in my mind, so I'd file it at bugs.launchpad.net/ubuntu/+source/snapd . Would need to see the output of "snap changes" and show directory listing maybe in /snap/<appname> to show multiple installed versions.
    – popey
    Mar 31 '17 at 11:02













up vote
18
down vote

favorite
3









up vote
18
down vote

favorite
3






3





I am running Ubuntu 16.10 with snapd and the basic core snap installed since it was released.

After some time I observed that the /snap/core directory fills up with multiple older versions.

To remove them I'll have to execute sudo snap remove core --revision <number> manually.



Multiple versions of snaps & garbage collection section in
Snaps and snapcraft documentation explains that after every update of a snap package the current version and the one before are installed and older versions are getting automatically removed (just as it was earlier the case).



As I cannot find further information in snap help, I am asking whether there is a setting or a switch command in snapd to enable automatic removal of those older core snap packages.

Additional information : What I described is valid for 3 machines with the same configuration.










share|improve this question















I am running Ubuntu 16.10 with snapd and the basic core snap installed since it was released.

After some time I observed that the /snap/core directory fills up with multiple older versions.

To remove them I'll have to execute sudo snap remove core --revision <number> manually.



Multiple versions of snaps & garbage collection section in
Snaps and snapcraft documentation explains that after every update of a snap package the current version and the one before are installed and older versions are getting automatically removed (just as it was earlier the case).



As I cannot find further information in snap help, I am asking whether there is a setting or a switch command in snapd to enable automatic removal of those older core snap packages.

Additional information : What I described is valid for 3 machines with the same configuration.







snap ubuntu-core






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 23 '17 at 15:11

























asked Mar 22 '17 at 12:15









cl-netbox

25.6k572113




25.6k572113








  • 1




    The default in snapd is to keep 3 versions, current and two previous. How many were you seeing?
    – popey
    Mar 22 '17 at 12:22






  • 2




    Thanks for this information @popey ! Whenever I found more than two core versions, I uninstalled the oldest one manually and in most cases I saw three installed versions, but I am not sure if I also found four versions before. Why does the documentation provide a different information ? Can I change the default settings to keep only the current and the one before ? Maybe you can explain it by writing an answer ? :)
    – cl-netbox
    Mar 22 '17 at 13:27










  • If you're seeing more than 3 then it's a bug in my mind, so I'd file it at bugs.launchpad.net/ubuntu/+source/snapd . Would need to see the output of "snap changes" and show directory listing maybe in /snap/<appname> to show multiple installed versions.
    – popey
    Mar 31 '17 at 11:02














  • 1




    The default in snapd is to keep 3 versions, current and two previous. How many were you seeing?
    – popey
    Mar 22 '17 at 12:22






  • 2




    Thanks for this information @popey ! Whenever I found more than two core versions, I uninstalled the oldest one manually and in most cases I saw three installed versions, but I am not sure if I also found four versions before. Why does the documentation provide a different information ? Can I change the default settings to keep only the current and the one before ? Maybe you can explain it by writing an answer ? :)
    – cl-netbox
    Mar 22 '17 at 13:27










  • If you're seeing more than 3 then it's a bug in my mind, so I'd file it at bugs.launchpad.net/ubuntu/+source/snapd . Would need to see the output of "snap changes" and show directory listing maybe in /snap/<appname> to show multiple installed versions.
    – popey
    Mar 31 '17 at 11:02








1




1




The default in snapd is to keep 3 versions, current and two previous. How many were you seeing?
– popey
Mar 22 '17 at 12:22




The default in snapd is to keep 3 versions, current and two previous. How many were you seeing?
– popey
Mar 22 '17 at 12:22




2




2




Thanks for this information @popey ! Whenever I found more than two core versions, I uninstalled the oldest one manually and in most cases I saw three installed versions, but I am not sure if I also found four versions before. Why does the documentation provide a different information ? Can I change the default settings to keep only the current and the one before ? Maybe you can explain it by writing an answer ? :)
– cl-netbox
Mar 22 '17 at 13:27




Thanks for this information @popey ! Whenever I found more than two core versions, I uninstalled the oldest one manually and in most cases I saw three installed versions, but I am not sure if I also found four versions before. Why does the documentation provide a different information ? Can I change the default settings to keep only the current and the one before ? Maybe you can explain it by writing an answer ? :)
– cl-netbox
Mar 22 '17 at 13:27












If you're seeing more than 3 then it's a bug in my mind, so I'd file it at bugs.launchpad.net/ubuntu/+source/snapd . Would need to see the output of "snap changes" and show directory listing maybe in /snap/<appname> to show multiple installed versions.
– popey
Mar 31 '17 at 11:02




If you're seeing more than 3 then it's a bug in my mind, so I'd file it at bugs.launchpad.net/ubuntu/+source/snapd . Would need to see the output of "snap changes" and show directory listing maybe in /snap/<appname> to show multiple installed versions.
– popey
Mar 31 '17 at 11:02










2 Answers
2






active

oldest

votes

















up vote
7
down vote



accepted










Right now I don't believe it's possible to change the number of old versions of any snap, that's set at 3. If you see more than that, it's likely a bug, so should be filed at https://bugs.launchpad.net/ubuntu/+source/snapd






share|improve this answer




























    up vote
    1
    down vote













    The post https://superuser.com/questions/1310825/how-to-remove-old-version-of-installed-snaps lists several solutions for older snap version removing:



    Manual script by popey to delete "all old versions of snaps" - https://superuser.com/a/1330590




    #!/bin/bash
    # https://superuser.com/a/1330590
    # Removes old revisions of snaps
    # CLOSE ALL SNAPS BEFORE RUNNING THIS set -eu

    snap list --all | awk '/disabled/{print $1, $3}' |
    while read snapname revision; do
    snap remove "$snapname" --revision="$revision"
    done



    And "snap set system refresh.retain" setting for "snap 2.34 and later" by Mustapha Hadid to store only 2 revisions of every snap https://superuser.com/a/1361201:




    $ sudo snap set system refresh.retain=2 


    The refresh.retain value can only be a number between 2 and 20 and has
    a default value of 3







    share|improve this answer





















      Your Answer








      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "89"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f895634%2fold-ubuntu-core-snap-versions-are-filling-up-disk-space%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes








      up vote
      7
      down vote



      accepted










      Right now I don't believe it's possible to change the number of old versions of any snap, that's set at 3. If you see more than that, it's likely a bug, so should be filed at https://bugs.launchpad.net/ubuntu/+source/snapd






      share|improve this answer

























        up vote
        7
        down vote



        accepted










        Right now I don't believe it's possible to change the number of old versions of any snap, that's set at 3. If you see more than that, it's likely a bug, so should be filed at https://bugs.launchpad.net/ubuntu/+source/snapd






        share|improve this answer























          up vote
          7
          down vote



          accepted







          up vote
          7
          down vote



          accepted






          Right now I don't believe it's possible to change the number of old versions of any snap, that's set at 3. If you see more than that, it's likely a bug, so should be filed at https://bugs.launchpad.net/ubuntu/+source/snapd






          share|improve this answer












          Right now I don't believe it's possible to change the number of old versions of any snap, that's set at 3. If you see more than that, it's likely a bug, so should be filed at https://bugs.launchpad.net/ubuntu/+source/snapd







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Mar 31 '17 at 11:10









          popey

          12.7k74689




          12.7k74689
























              up vote
              1
              down vote













              The post https://superuser.com/questions/1310825/how-to-remove-old-version-of-installed-snaps lists several solutions for older snap version removing:



              Manual script by popey to delete "all old versions of snaps" - https://superuser.com/a/1330590




              #!/bin/bash
              # https://superuser.com/a/1330590
              # Removes old revisions of snaps
              # CLOSE ALL SNAPS BEFORE RUNNING THIS set -eu

              snap list --all | awk '/disabled/{print $1, $3}' |
              while read snapname revision; do
              snap remove "$snapname" --revision="$revision"
              done



              And "snap set system refresh.retain" setting for "snap 2.34 and later" by Mustapha Hadid to store only 2 revisions of every snap https://superuser.com/a/1361201:




              $ sudo snap set system refresh.retain=2 


              The refresh.retain value can only be a number between 2 and 20 and has
              a default value of 3







              share|improve this answer

























                up vote
                1
                down vote













                The post https://superuser.com/questions/1310825/how-to-remove-old-version-of-installed-snaps lists several solutions for older snap version removing:



                Manual script by popey to delete "all old versions of snaps" - https://superuser.com/a/1330590




                #!/bin/bash
                # https://superuser.com/a/1330590
                # Removes old revisions of snaps
                # CLOSE ALL SNAPS BEFORE RUNNING THIS set -eu

                snap list --all | awk '/disabled/{print $1, $3}' |
                while read snapname revision; do
                snap remove "$snapname" --revision="$revision"
                done



                And "snap set system refresh.retain" setting for "snap 2.34 and later" by Mustapha Hadid to store only 2 revisions of every snap https://superuser.com/a/1361201:




                $ sudo snap set system refresh.retain=2 


                The refresh.retain value can only be a number between 2 and 20 and has
                a default value of 3







                share|improve this answer























                  up vote
                  1
                  down vote










                  up vote
                  1
                  down vote









                  The post https://superuser.com/questions/1310825/how-to-remove-old-version-of-installed-snaps lists several solutions for older snap version removing:



                  Manual script by popey to delete "all old versions of snaps" - https://superuser.com/a/1330590




                  #!/bin/bash
                  # https://superuser.com/a/1330590
                  # Removes old revisions of snaps
                  # CLOSE ALL SNAPS BEFORE RUNNING THIS set -eu

                  snap list --all | awk '/disabled/{print $1, $3}' |
                  while read snapname revision; do
                  snap remove "$snapname" --revision="$revision"
                  done



                  And "snap set system refresh.retain" setting for "snap 2.34 and later" by Mustapha Hadid to store only 2 revisions of every snap https://superuser.com/a/1361201:




                  $ sudo snap set system refresh.retain=2 


                  The refresh.retain value can only be a number between 2 and 20 and has
                  a default value of 3







                  share|improve this answer












                  The post https://superuser.com/questions/1310825/how-to-remove-old-version-of-installed-snaps lists several solutions for older snap version removing:



                  Manual script by popey to delete "all old versions of snaps" - https://superuser.com/a/1330590




                  #!/bin/bash
                  # https://superuser.com/a/1330590
                  # Removes old revisions of snaps
                  # CLOSE ALL SNAPS BEFORE RUNNING THIS set -eu

                  snap list --all | awk '/disabled/{print $1, $3}' |
                  while read snapname revision; do
                  snap remove "$snapname" --revision="$revision"
                  done



                  And "snap set system refresh.retain" setting for "snap 2.34 and later" by Mustapha Hadid to store only 2 revisions of every snap https://superuser.com/a/1361201:




                  $ sudo snap set system refresh.retain=2 


                  The refresh.retain value can only be a number between 2 and 20 and has
                  a default value of 3








                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Nov 7 at 3:35









                  osgx

                  442515




                  442515






























                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Ask Ubuntu!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.





                      Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                      Please pay close attention to the following guidance:


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f895634%2fold-ubuntu-core-snap-versions-are-filling-up-disk-space%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      How did Captain America manage to do this?

                      迪纳利

                      南乌拉尔铁路局