How to remove disabled (unused) snap packages with a single line of command?
![Creative The name of the picture](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgO9GURib1T8z7lCwjOGLQaGtrueEthgQ8LO42ZX8cOfTqDK4jvDDpKkLFwf2J49kYCMNW7d4ABih_XCb_2UXdq5fPJDkoyg7-8g_YfRUot-XnaXkNYycsNp7lA5_TW9td0FFpLQ2APzKcZ/s1600/1.jpg)
![Creative The name of the picture](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYQ0N5W1qAOxLP7t7iOM6O6AzbZnkXUy16s7P_CWfOb5UbTQY_aDsc727chyphenhyphen5W4IppVNernMMQeaUFTB_rFzAd95_CDt-tnwN-nBx6JyUp2duGjPaL5-VgNO41AVsA_vu30EJcipdDG409/s400/Clash+Royale+CLAN+TAG%2523URR8PPP.png)
up vote
4
down vote
favorite
When I run snap list --all
command it shows all the installed versions of snap packages.
Name Version Rev Tracking Developer Notes
atom 1.26.1 150 stable snapcrafters classic
brave v0.22.669dev 23 stable brave -
core 16-2.32.6 4571 stable canonical core
core 16-2.32.5 4486 stable canonical core,disabled
firefox 59.0.2-1 71 stable mozilla disabled
firefox 60.0-2 85 stable mozilla -
gimp 2.10.0 38 stable snapcrafters disabled
gimp 2.10.0 39 stable snapcrafters -
gimp 2.8.22 30 stable snapcrafters disabled
gnome-3-26-1604 3.26.0 64 stable/⦠canonical -
gnome-3-26-1604 3.26.0 62 stable/⦠canonical disabled
gnome-characters 3.28.0 86 stable/⦠canonical -
gnome-characters 3.26.2 69 stable/⦠canonical disabled
gnome-logs 3.26.2 25 stable/⦠canonical disabled
gnome-logs 3.28.0 31 stable/⦠canonical -
gnome-system-monitor 3.26.0 36 stable/⦠canonical disabled
gnome-system-monitor 3.26.0 39 stable/⦠canonical -
libreoffice 6.0.3.2 59 stable canonical disabled
libreoffice 6.0.4.2 63 stable canonical -
Now there are so many disabled packages there which are no longer used. So I want to remove those packages. Here the command is snap remove gnome-3-26-1604 --revision=62
. Now I have to do it for all the revisions and for all the packages one by one. Is there any command which will remove the disabled or unused snap packages with single line of command?
Thanks in advance...
package-management snap
add a comment |Â
up vote
4
down vote
favorite
When I run snap list --all
command it shows all the installed versions of snap packages.
Name Version Rev Tracking Developer Notes
atom 1.26.1 150 stable snapcrafters classic
brave v0.22.669dev 23 stable brave -
core 16-2.32.6 4571 stable canonical core
core 16-2.32.5 4486 stable canonical core,disabled
firefox 59.0.2-1 71 stable mozilla disabled
firefox 60.0-2 85 stable mozilla -
gimp 2.10.0 38 stable snapcrafters disabled
gimp 2.10.0 39 stable snapcrafters -
gimp 2.8.22 30 stable snapcrafters disabled
gnome-3-26-1604 3.26.0 64 stable/⦠canonical -
gnome-3-26-1604 3.26.0 62 stable/⦠canonical disabled
gnome-characters 3.28.0 86 stable/⦠canonical -
gnome-characters 3.26.2 69 stable/⦠canonical disabled
gnome-logs 3.26.2 25 stable/⦠canonical disabled
gnome-logs 3.28.0 31 stable/⦠canonical -
gnome-system-monitor 3.26.0 36 stable/⦠canonical disabled
gnome-system-monitor 3.26.0 39 stable/⦠canonical -
libreoffice 6.0.3.2 59 stable canonical disabled
libreoffice 6.0.4.2 63 stable canonical -
Now there are so many disabled packages there which are no longer used. So I want to remove those packages. Here the command is snap remove gnome-3-26-1604 --revision=62
. Now I have to do it for all the revisions and for all the packages one by one. Is there any command which will remove the disabled or unused snap packages with single line of command?
Thanks in advance...
package-management snap
Would it be possible for you to edit your question and instead of an image do copy and paste of the text? It really is discouraged to have images unless absolutely needed. It helps us with helping you. Thanks!
â Terrance
May 15 at 17:49
1
Yeah sure!! I have edited the question...
â Ryko
May 16 at 8:47
Note that keeping a single previous version is by design: when a snap is updated, the older revision will be removed.
â muru
May 16 at 8:55
But here gimp has 3 versions (revision-30,38,39). Though revision 38 and 39 has same versions... I will inform you later when any of this apps get further updates...
â Ryko
May 17 at 4:41
Is there any settings available in snap so that I could disable keeping previous versions of the snap applications... Because some of them requires so much space... like libre-office takes in nearly 2GB of space, and if the previous version is included it becomes 4GB.
â Ryko
May 17 at 4:44
add a comment |Â
up vote
4
down vote
favorite
up vote
4
down vote
favorite
When I run snap list --all
command it shows all the installed versions of snap packages.
Name Version Rev Tracking Developer Notes
atom 1.26.1 150 stable snapcrafters classic
brave v0.22.669dev 23 stable brave -
core 16-2.32.6 4571 stable canonical core
core 16-2.32.5 4486 stable canonical core,disabled
firefox 59.0.2-1 71 stable mozilla disabled
firefox 60.0-2 85 stable mozilla -
gimp 2.10.0 38 stable snapcrafters disabled
gimp 2.10.0 39 stable snapcrafters -
gimp 2.8.22 30 stable snapcrafters disabled
gnome-3-26-1604 3.26.0 64 stable/⦠canonical -
gnome-3-26-1604 3.26.0 62 stable/⦠canonical disabled
gnome-characters 3.28.0 86 stable/⦠canonical -
gnome-characters 3.26.2 69 stable/⦠canonical disabled
gnome-logs 3.26.2 25 stable/⦠canonical disabled
gnome-logs 3.28.0 31 stable/⦠canonical -
gnome-system-monitor 3.26.0 36 stable/⦠canonical disabled
gnome-system-monitor 3.26.0 39 stable/⦠canonical -
libreoffice 6.0.3.2 59 stable canonical disabled
libreoffice 6.0.4.2 63 stable canonical -
Now there are so many disabled packages there which are no longer used. So I want to remove those packages. Here the command is snap remove gnome-3-26-1604 --revision=62
. Now I have to do it for all the revisions and for all the packages one by one. Is there any command which will remove the disabled or unused snap packages with single line of command?
Thanks in advance...
package-management snap
When I run snap list --all
command it shows all the installed versions of snap packages.
Name Version Rev Tracking Developer Notes
atom 1.26.1 150 stable snapcrafters classic
brave v0.22.669dev 23 stable brave -
core 16-2.32.6 4571 stable canonical core
core 16-2.32.5 4486 stable canonical core,disabled
firefox 59.0.2-1 71 stable mozilla disabled
firefox 60.0-2 85 stable mozilla -
gimp 2.10.0 38 stable snapcrafters disabled
gimp 2.10.0 39 stable snapcrafters -
gimp 2.8.22 30 stable snapcrafters disabled
gnome-3-26-1604 3.26.0 64 stable/⦠canonical -
gnome-3-26-1604 3.26.0 62 stable/⦠canonical disabled
gnome-characters 3.28.0 86 stable/⦠canonical -
gnome-characters 3.26.2 69 stable/⦠canonical disabled
gnome-logs 3.26.2 25 stable/⦠canonical disabled
gnome-logs 3.28.0 31 stable/⦠canonical -
gnome-system-monitor 3.26.0 36 stable/⦠canonical disabled
gnome-system-monitor 3.26.0 39 stable/⦠canonical -
libreoffice 6.0.3.2 59 stable canonical disabled
libreoffice 6.0.4.2 63 stable canonical -
Now there are so many disabled packages there which are no longer used. So I want to remove those packages. Here the command is snap remove gnome-3-26-1604 --revision=62
. Now I have to do it for all the revisions and for all the packages one by one. Is there any command which will remove the disabled or unused snap packages with single line of command?
Thanks in advance...
package-management snap
edited May 16 at 8:46
asked May 15 at 17:36
Ryko
395313
395313
Would it be possible for you to edit your question and instead of an image do copy and paste of the text? It really is discouraged to have images unless absolutely needed. It helps us with helping you. Thanks!
â Terrance
May 15 at 17:49
1
Yeah sure!! I have edited the question...
â Ryko
May 16 at 8:47
Note that keeping a single previous version is by design: when a snap is updated, the older revision will be removed.
â muru
May 16 at 8:55
But here gimp has 3 versions (revision-30,38,39). Though revision 38 and 39 has same versions... I will inform you later when any of this apps get further updates...
â Ryko
May 17 at 4:41
Is there any settings available in snap so that I could disable keeping previous versions of the snap applications... Because some of them requires so much space... like libre-office takes in nearly 2GB of space, and if the previous version is included it becomes 4GB.
â Ryko
May 17 at 4:44
add a comment |Â
Would it be possible for you to edit your question and instead of an image do copy and paste of the text? It really is discouraged to have images unless absolutely needed. It helps us with helping you. Thanks!
â Terrance
May 15 at 17:49
1
Yeah sure!! I have edited the question...
â Ryko
May 16 at 8:47
Note that keeping a single previous version is by design: when a snap is updated, the older revision will be removed.
â muru
May 16 at 8:55
But here gimp has 3 versions (revision-30,38,39). Though revision 38 and 39 has same versions... I will inform you later when any of this apps get further updates...
â Ryko
May 17 at 4:41
Is there any settings available in snap so that I could disable keeping previous versions of the snap applications... Because some of them requires so much space... like libre-office takes in nearly 2GB of space, and if the previous version is included it becomes 4GB.
â Ryko
May 17 at 4:44
Would it be possible for you to edit your question and instead of an image do copy and paste of the text? It really is discouraged to have images unless absolutely needed. It helps us with helping you. Thanks!
â Terrance
May 15 at 17:49
Would it be possible for you to edit your question and instead of an image do copy and paste of the text? It really is discouraged to have images unless absolutely needed. It helps us with helping you. Thanks!
â Terrance
May 15 at 17:49
1
1
Yeah sure!! I have edited the question...
â Ryko
May 16 at 8:47
Yeah sure!! I have edited the question...
â Ryko
May 16 at 8:47
Note that keeping a single previous version is by design: when a snap is updated, the older revision will be removed.
â muru
May 16 at 8:55
Note that keeping a single previous version is by design: when a snap is updated, the older revision will be removed.
â muru
May 16 at 8:55
But here gimp has 3 versions (revision-30,38,39). Though revision 38 and 39 has same versions... I will inform you later when any of this apps get further updates...
â Ryko
May 17 at 4:41
But here gimp has 3 versions (revision-30,38,39). Though revision 38 and 39 has same versions... I will inform you later when any of this apps get further updates...
â Ryko
May 17 at 4:41
Is there any settings available in snap so that I could disable keeping previous versions of the snap applications... Because some of them requires so much space... like libre-office takes in nearly 2GB of space, and if the previous version is included it becomes 4GB.
â Ryko
May 17 at 4:44
Is there any settings available in snap so that I could disable keeping previous versions of the snap applications... Because some of them requires so much space... like libre-office takes in nearly 2GB of space, and if the previous version is included it becomes 4GB.
â Ryko
May 17 at 4:44
add a comment |Â
3 Answers
3
active
oldest
votes
up vote
2
down vote
accepted
I'll look into adding this sometime soon (as a 20% thing). Meanwhile, you could drop
#!/bin/sh
set -eu
snap list --all | awk '/disabled/print $1, $3' |
while read snapname revision; do
snap remove "$snapname" --revision="$revision"
done
into a shell script and run that.
add a comment |Â
up vote
3
down vote
The capability to purge/remove old/disabled snaps has been discussed previously but not yet implemented. In the meantime unfortunately it's a manual process.
Is there anyway to get machine-readable information about snaps (JSON or similar) that can be easily parsed to automate this?
â muru
May 25 at 8:23
add a comment |Â
up vote
1
down vote
This is being worked on by a snapd developer now: https://github.com/snapcore/snapd/pull/5207
add a comment |Â
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
accepted
I'll look into adding this sometime soon (as a 20% thing). Meanwhile, you could drop
#!/bin/sh
set -eu
snap list --all | awk '/disabled/print $1, $3' |
while read snapname revision; do
snap remove "$snapname" --revision="$revision"
done
into a shell script and run that.
add a comment |Â
up vote
2
down vote
accepted
I'll look into adding this sometime soon (as a 20% thing). Meanwhile, you could drop
#!/bin/sh
set -eu
snap list --all | awk '/disabled/print $1, $3' |
while read snapname revision; do
snap remove "$snapname" --revision="$revision"
done
into a shell script and run that.
add a comment |Â
up vote
2
down vote
accepted
up vote
2
down vote
accepted
I'll look into adding this sometime soon (as a 20% thing). Meanwhile, you could drop
#!/bin/sh
set -eu
snap list --all | awk '/disabled/print $1, $3' |
while read snapname revision; do
snap remove "$snapname" --revision="$revision"
done
into a shell script and run that.
I'll look into adding this sometime soon (as a 20% thing). Meanwhile, you could drop
#!/bin/sh
set -eu
snap list --all | awk '/disabled/print $1, $3' |
while read snapname revision; do
snap remove "$snapname" --revision="$revision"
done
into a shell script and run that.
answered May 25 at 8:28
Chipaca
8,4362243
8,4362243
add a comment |Â
add a comment |Â
up vote
3
down vote
The capability to purge/remove old/disabled snaps has been discussed previously but not yet implemented. In the meantime unfortunately it's a manual process.
Is there anyway to get machine-readable information about snaps (JSON or similar) that can be easily parsed to automate this?
â muru
May 25 at 8:23
add a comment |Â
up vote
3
down vote
The capability to purge/remove old/disabled snaps has been discussed previously but not yet implemented. In the meantime unfortunately it's a manual process.
Is there anyway to get machine-readable information about snaps (JSON or similar) that can be easily parsed to automate this?
â muru
May 25 at 8:23
add a comment |Â
up vote
3
down vote
up vote
3
down vote
The capability to purge/remove old/disabled snaps has been discussed previously but not yet implemented. In the meantime unfortunately it's a manual process.
The capability to purge/remove old/disabled snaps has been discussed previously but not yet implemented. In the meantime unfortunately it's a manual process.
answered May 25 at 8:18
![](https://i.stack.imgur.com/BOGAZ.png?s=32&g=1)
![](https://i.stack.imgur.com/BOGAZ.png?s=32&g=1)
popey
11.7k74388
11.7k74388
Is there anyway to get machine-readable information about snaps (JSON or similar) that can be easily parsed to automate this?
â muru
May 25 at 8:23
add a comment |Â
Is there anyway to get machine-readable information about snaps (JSON or similar) that can be easily parsed to automate this?
â muru
May 25 at 8:23
Is there anyway to get machine-readable information about snaps (JSON or similar) that can be easily parsed to automate this?
â muru
May 25 at 8:23
Is there anyway to get machine-readable information about snaps (JSON or similar) that can be easily parsed to automate this?
â muru
May 25 at 8:23
add a comment |Â
up vote
1
down vote
This is being worked on by a snapd developer now: https://github.com/snapcore/snapd/pull/5207
add a comment |Â
up vote
1
down vote
This is being worked on by a snapd developer now: https://github.com/snapcore/snapd/pull/5207
add a comment |Â
up vote
1
down vote
up vote
1
down vote
This is being worked on by a snapd developer now: https://github.com/snapcore/snapd/pull/5207
This is being worked on by a snapd developer now: https://github.com/snapcore/snapd/pull/5207
answered May 25 at 14:53
Zygmunt Krynicki
1,06157
1,06157
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1036633%2fhow-to-remove-disabled-unused-snap-packages-with-a-single-line-of-command%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Would it be possible for you to edit your question and instead of an image do copy and paste of the text? It really is discouraged to have images unless absolutely needed. It helps us with helping you. Thanks!
â Terrance
May 15 at 17:49
1
Yeah sure!! I have edited the question...
â Ryko
May 16 at 8:47
Note that keeping a single previous version is by design: when a snap is updated, the older revision will be removed.
â muru
May 16 at 8:55
But here gimp has 3 versions (revision-30,38,39). Though revision 38 and 39 has same versions... I will inform you later when any of this apps get further updates...
â Ryko
May 17 at 4:41
Is there any settings available in snap so that I could disable keeping previous versions of the snap applications... Because some of them requires so much space... like libre-office takes in nearly 2GB of space, and if the previous version is included it becomes 4GB.
â Ryko
May 17 at 4:44