Created a snap cheatsheet

This commit is contained in:
Chris Lane 2019-01-11 17:18:02 -05:00
parent 22b64d2d08
commit 60b05c8781

98
cheat/cheatsheets/snap Normal file
View File

@ -0,0 +1,98 @@
# To find the `foo` snap:
snap find foo
# To view detailed information about snap `foo`:
snap info foo
# To view all private snaps (must be logged in):
snap find --private
# To install the `foo` snap:
sudo snap install foo
# To install the `foo` snap from the "beta" channel:
sudo snap install foo --channel=beta
# To view installed snaps:
snap list
# To list all revisions of installed snaps:
snap list --all
# To (manually) update all snaps:
sudo snap refresh
# To (manually) update the `foo` snap:
sudo snap refresh foo
# To update the `foo` snap to the "beta" channel:
sudo snap refresh foo --channel=beta
# To revert the `foo` snap to a prior version:
sudo snap revert foo
# To revert the `foo` snap to revision 5:
snap revert foo --revision 5
# To remove the `foo` snap:
sudo snap remove foo
# To log in to snap (must first create account online):
sudo snap login
# To log out of snap:
snap logout
# To view a transaction log summary:
snap changes
# To view details of item 123 in the transaction log:
snap change 123
# To watch transaction 123:
snap watch 123
# To abort transaction 123:
snap abort 123
# To download the `foo` snap (and its assertions) *without* installing it:
snap download foo
# To install the locally-downloaded `foo` snap with assertions:
snap ack foo.assert
snap install foo.snap
# To install the locally-downloaded `foo` snap without assertions:
# NB: this is dangerous, because the integrity of the snap will not be
# verified. You should only do this to test a snap that you are currently
# developing.
snap install --dangerous foo.snap
# To install snap `foo` in "dev mode":
# NB: this is dangerous, and bypasses the snap sandboxing mechanisms
snap install --devmode foo
# To install snap `foo` in "classic mode":
# NB: this is likewise dangerous
snap install --classic foo
# To view available snap interfaces:
snap interfaces
# To connect the `foo:camera` plug to the ubuntu core slot:
snap connect foo:camera :camera
# To disconnect the `foo:camera` plug from the ubuntu core slot:
snap disconnect foo:camera
# To disable the `foo` snap
snap disable foo
# To enable the `foo` snap
snap enable foo
# To set snap `foo`'s `bar` property to 10:
snap set foo bar=10
# To read snap `foo`'s current `bar` property:
snap get foo bar