Snap: Difference between revisions

From Chorke Wiki
Jump to navigation Jump to search
No edit summary
Line 20: Line 20:
{|
{|
| valign="top" |
| valign="top" |
<source lang="bash">
<syntaxhighlight lang="bash">
sudo snap set system refresh.retain=2
sudo snap set system refresh.retain=2
sudo du -sh /var/lib/snapd/cache
sudo du -sh /var/lib/snapd/cache
sudo list --all
sudo list --all
</source>
</syntaxhighlight>


| valign="top" |
| valign="top" |
<source lang="bash">
<syntaxhighlight lang="bash">
sudo ls -l /var/lib/snapd/cache | sed '1d' \
sudo ls -l /var/lib/snapd/cache | sed '1d' \
  | cut --fields=2 --delimiter=' ' \
  | cut --fields=2 --delimiter=' ' \
  | grep 1 | wc --lines
  | grep 1 | wc --lines
</source>
</syntaxhighlight>


|-
|-
Line 38: Line 38:
|-
|-
| valign="top" colspan="2" |
| valign="top" colspan="2" |
<source lang="bash">
<syntaxhighlight lang="bash">
export LANG=en_US.UTF-8;\
export LANG=en_US.UTF-8;\
sudo snap set system refresh.retain=2;\
sudo snap set system refresh.retain=2;\
snap list --all | awk '/disabled/{print $1, $3}' |\
snap list --all | awk '/disabled/{print $1, $3}' |\
while read NAME REVISION;do echo "${NAME} » ${REVISION}";done
while read NAME REVISION;do echo "${NAME} » ${REVISION}";done
</source>
</syntaxhighlight>


|-
|-
Line 50: Line 50:
|-
|-
| valign="top" colspan="2" |
| valign="top" colspan="2" |
<source lang="bash">
<syntaxhighlight lang="bash">
export LANG=en_US.UTF-8;\
export LANG=en_US.UTF-8;\
sudo snap set system refresh.retain=2;\
sudo snap set system refresh.retain=2;\
snap list --all | awk '/disabled/{print $1, $3}' |\
snap list --all | awk '/disabled/{print $1, $3}' |\
while read NAME REVISION;do sudo snap remove "${NAME}" --revision="${REVISION}";done
while read NAME REVISION;do sudo snap remove "${NAME}" --revision="${REVISION}";done
</source>
</syntaxhighlight>


|-
|-

Revision as of 08:04, 19 October 2024

sudo apt update
sudo apt install snapd
sudo snap set system refresh.retain=2
sudo snap refresh
sudo list --all
sudo list
sudo du -sh  /var/lib/snapd/cache
sudo du -sh  /var/lib/snapd/snaps
sudo ls -lah /var/lib/snapd/snaps

Playground

sudo snap set system refresh.retain=2
sudo du -sh /var/lib/snapd/cache
sudo list --all
sudo ls -l /var/lib/snapd/cache | sed '1d' \
 | cut --fields=2 --delimiter=' ' \
 | grep 1 | wc --lines

export LANG=en_US.UTF-8;\
sudo snap set system refresh.retain=2;\
snap list --all | awk '/disabled/{print $1, $3}' |\
while read NAME REVISION;do echo "${NAME} » ${REVISION}";done

export LANG=en_US.UTF-8;\
sudo snap set system refresh.retain=2;\
snap list --all | awk '/disabled/{print $1, $3}' |\
while read NAME REVISION;do sudo snap remove "${NAME}" --revision="${REVISION}";done

systemctl status snapd.service
systemctl start  snapd.service
systemctl stop   snapd.service
df -PTh /var/lib/snapd

References